Skip to content

Commit 1f291df

Browse files
committed
Parametrize tests to also test with headless browser
1 parent 4792a68 commit 1f291df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
NEXT_TEST_EVENT = Event()
1515

1616

17-
@pytest.fixture
18-
async def browser() -> AsyncGenerator[zd.Browser, None]:
17+
@pytest.fixture(params=[{"headless": True}, {"headless": False}])
18+
async def browser(request: pytest.FixtureRequest) -> AsyncGenerator[zd.Browser, None]:
1919
NEXT_TEST_EVENT.clear()
2020
browser = await zd.start(
2121
# use wayland for rendering instead of default X11 backend
2222
browser_args=["--enable-features=UseOzonePlatform", "--ozone-platform=wayland"],
23+
headless=request.param["headless"],
2324
)
2425
browser_pid = browser._process_pid
2526
assert browser_pid is not None and browser_pid > 0

0 commit comments

Comments
 (0)