Skip to content

feat: allow per-test browser launch options via indirect parametrization - #329

Merged
Pavel Feldman (pavelfeldman) merged 2 commits into
mainfrom
feat-205-launch-args-param
Oct 8, 2026
Merged

Pavel Feldman (pavelfeldman) merged 2 commits into
mainfrom
feat-205-launch-args-param

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

@pytest.mark.parametrize("browser_type_launch_args", [{...}], indirect=True) was silently ignored by the built-in fixture. It now merges request.param into the launch options, on top of the command line options (--headed, --browser-channel, --slowmo). The fixture is session scoped, so pytest relaunches the browser for each distinct value and groups the tests accordingly. A value that is not a mapping raises pytest.UsageError naming the fixture instead of failing inside dict.update.

Tests: two parametrized user agents plus an unparametrized test in one run, and the error for a non-mapping value (sync + async).

Docs follow-up (microsoft/playwright docs/src/test-runners-python.md): document the parametrization and that each distinct value launches its own browser.

Fixes #205

Stack created with GitHub Stacks CLI • Give Feedback 💬

@pavelfeldman
Pavel Feldman (pavelfeldman) added this pull request to stack #335 October 7, 2026 23:05
Base automatically changed from fix-122-headed-without-display to main October 8, 2026 01:42
@pytest.mark.parametrize("browser_type_launch_args", [{...}], indirect=True)
used to be silently ignored by the built-in fixture. Merge request.param into
the launch options; pytest relaunches the session browser per distinct value.

Fixes #205
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit cfd68b8 into main Oct 8, 2026
14 checks passed
@pavelfeldman
Pavel Feldman (pavelfeldman) deleted the feat-205-launch-args-param branch October 8, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: extending browser_type_launch_args to work with request

2 participants