# pylint: disable=no-name-in-module
from behave import then, when, given

from browserdriver import BrowserDriver


@given('I have a firefox driver')
def get_firefox_driver(context):
    context.driver = BrowserDriver.get("firefox")


@given('I have a chrome driver')
def get_chrome_driver(context):
    context.driver = BrowserDriver.get("chrome")


@given('I have an edge driver')
def get_edge_driver(context):
    context.driver = BrowserDriver.get("edge")


@given('I have a safari driver')
def get_safari_driver(context):
    context.driver = BrowserDriver.get("safari")


@when('I navigate to test.io')
def navigate_to_testio(context):
    context.driver.get("https://test.io")


@then('The page is displayed')
def page_is_displayed(context):
    assert context.driver.title == "Home | Test IO"
