def setup_function(): global selenium_browser selenium_browser = get_test_driver() selenium_browser.get(TODOMVC_URL) WebDriverWait(selenium_browser, 4).until( expected_conditions.visibility_of_element_located( (By.CSS_SELECTOR, "#new-todo"))) browser.config.driver = get_test_driver() browser.open(TODOMVC_URL) browser.element("#new-todo").should(be.visible)
def setup_function(f): global browser global shaded_browser set_driver(get_test_driver()) open_url(TODOMVC_URL) s("#new-todo").should_be(visible) browser = get_test_driver() browser.get(TODOMVC_URL) WebDriverWait(browser, 4).until(expected_conditions.visibility_of_element_located((By.CSS_SELECTOR, "#new-todo"))) shaded_browser = get_test_driver()
def setup_module(m): global driver driver = SeleneDriver.wrap(get_test_driver()) global GIVEN_PAGE GIVEN_PAGE = GivenPage(driver) global WHEN WHEN = GIVEN_PAGE
def setup(request): set_driver(get_test_driver()) def teardown(): driver().quit() request.addfinalizer(teardown)
def test_can_get_set_shared_driver(): selene.driver._shared_web_driver_source.driver = NoneObject("NoneObject") shared_driver = factory.get_shared_driver() assert isinstance(shared_driver, NoneObject) factory.set_shared_driver(get_test_driver()) shared_driver = factory.get_shared_driver() assert shared_driver.name == "firefox" shared_driver.quit()
def setup_function(m): config.timeout = 4 set_driver(get_test_driver()) config.app_host = 'file://' + os.path.abspath( os.path.dirname(__file__)) + '/../../resources/orderapp/'
def setup_module(m): set_driver(get_test_driver())
def setup_module(m): browser.set_driver(get_test_driver())
def test_is_driver_still_opened(): webdriver = get_test_driver() assert factory.is_driver_still_open(webdriver) webdriver.quit() assert factory.is_driver_still_open(webdriver) is False
def test_ensure_driver_started__when__set_browser_directly(): webdriver = get_test_driver() set_driver(webdriver) factory.ensure_driver_started(Browser.CHROME) assert driver().name == Browser.CHROME driver().quit()
def test_manual_start(): driver = get_test_driver() set_driver(driver) open_url(start_page) s("#header").should_have(exact_text("Selene"))