示例#1
0
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()
示例#2
0
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')
示例#3
0
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
示例#4
0
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")
示例#6
0
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')
示例#7
0
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')