From 6ceb34b8d388ddff0b3343f45f327e857f1f5b95 Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Guedes Date: Wed, 5 Jan 2022 10:30:34 -0300 Subject: [PATCH] Creating a new format of tests. --- api/chrome/features/chrome.feature | 6 ++++++ api/chrome/features/steps/steps.py | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 api/chrome/features/chrome.feature create mode 100644 api/chrome/features/steps/steps.py diff --git a/api/chrome/features/chrome.feature b/api/chrome/features/chrome.feature new file mode 100644 index 0000000..915f7e4 --- /dev/null +++ b/api/chrome/features/chrome.feature @@ -0,0 +1,6 @@ +Feature: The Chrome API client + + Scenario: Using the Chrome.Start method + Given the Chrome client + When the Start method is called + Then Google Chrome should open \ No newline at end of file diff --git a/api/chrome/features/steps/steps.py b/api/chrome/features/steps/steps.py new file mode 100644 index 0000000..57b9622 --- /dev/null +++ b/api/chrome/features/steps/steps.py @@ -0,0 +1,16 @@ +from behave import * +from cli import Chrome + +@given ("the Chrome client") +def step_impl (context): + context.client = Chrome() + +@when ("the Start method is called") +def step_impl (context): + # context._return = None + context._return = context.client.start() + +@then ("Google Chrome should open") +def step_impl (context): + print (f"\n-----------\n{context._return}\n------------\n") + assert context._return == "", "Google Chrome did not opened as expected." \ No newline at end of file