def class_setup(request): print('Running class_setup') browser = request.config.getoption('--browser') wdf = WebDriverFactory(browser) driver = wdf.get_webdriver() if request.cls is not None: request.cls.driver = driver request.cls.browser = browser yield driver driver.quit() print('Running class_teardown')
def class_setup_with_login(request): print("Running class_setup_with_login") browser = request.config.getoption("--browser") wdf = WebDriverFactory(browser) driver = wdf.get_webdriver() login_page = LoginPage(driver) login_page.navigate_to_login_page() login_page.login('*****@*****.**', 'RA^@*95QaOav') if request.cls is not None: request.cls.driver = driver request.cls.browser = browser yield driver driver.quit() print("Running class_teardown_with_login")
def one_time_setup(request, browser, base_url): wdf = WebDriverFactory(browser, base_url) driver = wdf.get_webdriver() yield driver, base_url driver.quit()