Пример #1
0
def setup(request):

    driver = DriverFactory.get_driver("chrome")
    driver.implicitly_wait(5)
    request.cls.driver = driver
    yield
    driver.quit()
Пример #2
0
def setup(request):
    driver = DriverFactory.get_driver(random.choice(browsers))
    driver.implicitly_wait(10)
    driver.maximize_window()
    request.cls.driver = driver
    yield
    driver.quit()
Пример #3
0
def setup(request):
    driver = DriverFactory.get_driver('chrome')
    driver.implicitly_wait(10)
    request.cls.driver = driver
    before_failed = request.session.testsfailed
    yield
    if request.session.testsfailed != before_failed:
        allure.attach(driver.get_screenshot_as_png(),
                      name='Test failed',
                      attachment_type=allure.attachment_type.PNG)
    driver.quit()
Пример #4
0
def setup(request, config):
    driver = DriverFactory.get_driver(config["browser"],
                                      config["headless_mode"])
    driver.implicitly_wait(config["timeout"])
    request.cls.driver = driver
    before_failed = request.session.testsfailed
    if config["browser"] == "firefox":
        driver.maximize_window()
    yield
    if request.session.testsfailed != before_failed:
        allure.attach(driver.get_screenshot_as_png(),
                      name="Test failed",
                      attachment_type=AttachmentType.PNG)
    driver.quit()