Repository navigation
Releases: microsoft/playwright-pytest
Release list
v0.10.0
Highlights
Traces for playwright.request API contexts (#333). --tracing now also records contexts created with playwright.request.new_context(), one chunk per test, so a session-scoped API context yields a trace per test. The traces follow the same retain-on-failure handling, trace-N.zip naming and report attachments as browser traces. Requires Playwright 1.60 or newer.
Artifacts in test reports (#332). Kept screenshots, videos and traces are added to the teardown report as playwright_screenshot, playwright_video and playwright_trace user properties, so --junitxml writes them as <property> elements and pytest_runtest_logreport hooks and reporters can pick them up. With pytest-html >= 4 they are linked from the report, and embedded with --self-contained-html.
Reruns keep their own artifacts (#331). With pytest-rerunfailures, every attempt now writes to its own folder, test-results/<test>-retry1/ and so on, like Playwright Test. Attempts no longer overwrite each other.
Artifacts survive fixture failures in teardown (#330). --tracing retain-on-failure, --video retain-on-failure and --screenshot only-on-failure now keep artifacts when a fixture fails during teardown. A test skipped from a fixture no longer counts as failed.
Per-test browser launch options (#329):
@pytest.mark.parametrize(
"browser_type_launch_args",
[{"args": ["--lang=de-DE"]}],
indirect=True,
)
def test_german(page):
...Each distinct value launches its own browser; command line options such as --headed and --slowmo still apply.
Multi-browser parametrization fixes. Overriding the page fixture no longer drops --browser parametrization on older pytest versions (#314). browser_name is now parametrized indirectly, so tests keep their original order within a browser (#284).
VS Code debugger (#328). The browser is launched headed under the debugger only when a display is available. On Linux without DISPLAY or WAYLAND_DISPLAY set, it stays headless unless --headed is passed.
Breaking changes
-
pytest-base-urlis now an optional dependency (#334). The plugin provides--base-url, thebase_urlini option, thePYTEST_BASE_URLenvironment variable and thebase_urlfixture on its own.--verify-base-urlneeds the extra:pip install pytest-playwright[base-url]
-
Minimum pytest version is 7.0 for pytest-playwright and 8.2 for pytest-playwright-asyncio (#333).
-
python-slugify9.x is now supported (#324).
Full Changelog: v0.9.0...v0.10.0
v0.9.0
Adds --playwright-debug=cli: pytest pauses at the start of the first context and prints a python -m playwright cli attach … command so agents (or you) can inspect the live browser.
pytest --playwright-debug=cli -s
# ### The test is currently paused at the start
# ### Debugging Instructions
# - Run `python -m playwright cli attach tw-a1b2c3` to attach to this test
python -m playwright cli attach tw-a1b2c3
python -m playwright cli --s=tw-a1b2c3 snapshot
python -m playwright cli --s=tw-a1b2c3 resumev0.8.0
Adds support for expect.soft() soft assertions.
v0.7.2
What's Changed
- chore(deps): bump django from 4.2.22 to 4.2.24 by Dependabot (@dependabot)[bot] in #292
- chore: drop Python 3.9 by Max Schmitt (@mxschmitt) in #299
- chore: support Pytest v9 by Max Schmitt (@mxschmitt) in #300
- fix: check common name for incompatible plugin by James (@JamesYFC) in #294
New Contributors
- James (@JamesYFC) made their first contribution in #294
Full Changelog: v0.7.1...v0.7.2
v0.7.1
Bugfixes:
- fix: use png screenshot type after Playwright v1.55.0 alignment by Max Schmitt (@mxschmitt) in #290
- feat: add async/sync compatibility check by Matt Campbell (@mecampbellsoup) in #282
New Contributors
- Roberto Fernández Iglesias (@roberfi) made their first contribution in #285
- Matt Campbell (@mecampbellsoup) made their first contribution in #282
Full Changelog: v0.7.0...v0.7.1
