2024-07-23 14:00:35 +00:00
|
|
|
# pylint: disable=no-name-in-module
|
2020-10-09 17:34:54 +00:00
|
|
|
from behave import then, when, given
|
|
|
|
|
|
|
|
from browserdriver import BrowserDriver
|
|
|
|
|
|
|
|
|
2020-10-10 18:04:35 +00:00
|
|
|
@given('I have a firefox driver')
|
2024-07-23 14:00:35 +00:00
|
|
|
def get_firefox_driver(context):
|
2020-10-10 18:04:35 +00:00
|
|
|
context.driver = BrowserDriver.get("firefox")
|
|
|
|
|
|
|
|
|
2020-10-09 17:34:54 +00:00
|
|
|
@given('I have a chrome driver')
|
2024-07-23 14:00:35 +00:00
|
|
|
def get_chrome_driver(context):
|
2020-10-09 17:34:54 +00:00
|
|
|
context.driver = BrowserDriver.get("chrome")
|
|
|
|
|
|
|
|
|
2024-07-23 14:00:35 +00:00
|
|
|
@given('I have an edge driver')
|
|
|
|
def get_edge_driver(context):
|
2020-10-14 22:24:01 +00:00
|
|
|
context.driver = BrowserDriver.get("edge")
|
|
|
|
|
|
|
|
|
2024-07-23 14:00:35 +00:00
|
|
|
@given('I have a safari driver')
|
|
|
|
def get_safari_driver(context):
|
2020-10-14 22:24:01 +00:00
|
|
|
context.driver = BrowserDriver.get("safari")
|
|
|
|
|
|
|
|
|
2020-10-09 17:34:54 +00:00
|
|
|
@when('I navigate to test.io')
|
2024-07-23 14:00:35 +00:00
|
|
|
def navigate_to_testio(context):
|
2020-10-09 17:34:54 +00:00
|
|
|
context.driver.get("https://test.io")
|
|
|
|
|
2020-10-10 18:04:35 +00:00
|
|
|
|
2020-10-09 17:34:54 +00:00
|
|
|
@then('The page is displayed')
|
2024-07-23 14:00:35 +00:00
|
|
|
def page_is_displayed(context):
|
|
|
|
assert context.driver.title == "Home | Test IO"
|