コード例 #1
0
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')
コード例 #2
0
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")
コード例 #3
0
def one_time_setup(request, browser, base_url):
    wdf = WebDriverFactory(browser, base_url)
    driver = wdf.get_webdriver()
    yield driver, base_url
    driver.quit()