Skip to content

Commit 6893ae5

Browse files
committed
Modifications in Pytest config file
1 parent e92b077 commit 6893ae5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

conftest.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515

1616
exec_async = os.getenv('EXEC_ASYNC')
1717

18+
options = ChromeOptions()
19+
20+
# Refer https://www.selenium.dev/blog/2023/headless-is-going-away/ for the new way
21+
# to trigger browser in headless mode
22+
options.add_argument("--headless=new")
23+
1824
if exec_async == 'true':
1925
# logs via pytest-xdist
2026
# https://github.com/pytest-dev/pytest-xdist/issues/354#issuecomment-430502446
2127
# sys.stdout = sys.stderr
22-
23-
options = ChromeOptions()
24-
25-
# Refer https://www.selenium.dev/blog/2023/headless-is-going-away/ for the new way
26-
# to trigger browser in headless mode
27-
options.add_argument("--headless=new")
28-
2928
@pytest.fixture(scope='function')
3029
async def driver():
3130
driver = await asyncio.to_thread(webdriver.Chrome, options=options)

0 commit comments

Comments
 (0)