-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
22 lines (20 loc) · 709 Bytes
/
conftest.py
File metadata and controls
22 lines (20 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""This module is used for configuring webdriver."""
from datetime import datetime
import pytest
import allure
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
@pytest.fixture(scope='function')
def driver():
"""Google Chrome is used as driver."""
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))
driver.maximize_window()
yield driver
screenshot = driver.get_screenshot_as_png()
allure.attach(
body=screenshot,
name=f'Screenshot {datetime.today()}',
attachment_type=allure.attachment_type.PNG
)
driver.quit()