def before_feature(context, feature):
    browser = "firefox"
    if hasattr(context.config, "browser") and context.config.browser is not None:
        browser = context.config.browser
    world.open_browser(browser)

    Logger.driver = world.driver
Example #2
0
    def test_alert_return_Alert(self):
        instance = AlertMock()
        instance.expect("text", "alert message!!")

        driver = WebDriverMock()
        driver.expect("switch_to_alert", instance)

        world.driver = driver

        alert = world.get_alert()
        assert alert.text == "alert message!!"
def after_feature(context, feature):
    world.close_browser()
Example #4
0
    def test_find_element_without_name_return_Element(self):
        world.pages = PageFactory.create_pages("./tests/*.yaml", "default")

        element = world.find_element("q")
        assert element.name == "!!undefined"
        assert element.identifier == "q"
Example #5
0
    def test_find_element_by_name_return_Element(self):
        world.pages = PageFactory.create_pages("./tests/*.yaml", "default")

        element = world.find_element("search input")
        assert element.name == "search input"
        assert element.identifier == "identifier"
Example #6
0
    def test_find_page_return_Page(self):
        world.pages = PageFactory.create_pages("./tests/*.yaml", "default")

        page = world.find_page("google")
        assert page.name == "google"