def driver_setup(request, browser, online, setuipath, setffpath, seturl): wdf = WebDriverFactory(browser, online, setuipath, setffpath, seturl) driver = wdf.get_webdriver_instance() yield driver wdf.clean_webdriver_instance() driver.quit()
def module_setup_to_test_class(request): print("Module setup") webdriver_factory = WebDriverFactory() driver = webdriver_factory.get_webdriver_instance() if request: request.cls.driver = driver yield driver driver.quit() print('Module teardown')
def driver(request): web_driver_factory = WebDriverFactory( request.config.getoption("--browser")) driver = web_driver_factory.get_webdriver_instance() def finalizer(): driver.quit() request.addfinalizer(finalizer) return driver
def browser(request): web_driver_factory = WebDriverFactory( request.config.getoption("--browser")) browser = web_driver_factory.get_webdriver_instance() browser.maximize_window() browser.implicitly_wait(10) def finalizer(): browser.quit() request.addfinalizer(finalizer) return browser
def oneTimeSetUp(request, browser): print("Running one time setUp") wdf = WebDriverFactory(browser) driver = wdf.get_webdriver_instance() lp = LoginPage(driver) lp.login("*****@*****.**", "abcabc") if request.cls is not None: request.cls.driver = driver yield driver driver.quit() print("Running one time tearDown")
def one_time_setUp(browser, request): print('Running One time Set Up') wdf = WebDriverFactory(browser) driver = wdf.get_webdriver_instance() lp = LoginPage(driver) lp.login(user_name="*****@*****.**", password="******") if request.cls is not None: request.cls.driver = driver yield driver driver.quit() print('Running One time Teardown')
def one_time_setup(request, browser): print('Running one time setup') wdf = WebDriverFactory(browser) driver = wdf.get_webdriver_instance() home = HomePage(driver) home.log_in() if request.cls is not None: request.cls.driver = driver yield driver driver.quit() print('Running One time Teardown')