forked from RedRoverSchool/JenkinsQA_Python_2026_spring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
29 lines (23 loc) · 628 Bytes
/
conftest.py
File metadata and controls
29 lines (23 loc) · 628 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import pytest
from selenium import webdriver
from common.jenkins_utils import login, logout, clear_data
from common.project_utils import get_browser, get_options, get_url
@pytest.fixture(scope="function")
def browser():
get_browser()
clear_data()
options = webdriver.ChromeOptions()
for option in get_options():
options.add_argument(option)
driver = webdriver.Chrome(options=options)
driver.implicitly_wait(5)
driver.get(get_url())
login(driver)
try:
yield driver
finally:
try:
logout(driver)
finally:
driver.quit()