Releases · microsoft/playwright-pytest · GitHub
Skip to content

Releases: microsoft/playwright-pytest

v0.10.0

Choose a tag to compare

@pavelfeldman pavelfeldman released this 08 Oct 20:53
80d7569

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-url is now an optional dependency (#334). The plugin provides --base-url, the base_url ini option, the PYTEST_BASE_URL environment variable and the base_url fixture on its own. --verify-base-url needs 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-slugify 9.x is now supported (#324).

Full Changelog: v0.9.0...v0.10.0

v0.9.0

Choose a tag to compare

@Skn0tt Skn0tt released this 10 Aug 10:00
70e8949

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 resume

v0.8.0

Choose a tag to compare

@Skn0tt Skn0tt released this 18 May 09:48
703c884

Adds support for expect.soft() soft assertions.

v0.7.2

Choose a tag to compare

@Skn0tt Skn0tt released this 20 Nov 13:53
b64ad1c

What's Changed

New Contributors

Full Changelog: v0.7.1...v0.7.2

v0.7.1

Choose a tag to compare

@mxschmitt mxschmitt released this 08 Sep 07:49
44ca971

Bugfixes:

New Contributors

Full Changelog: v0.7.0...v0.7.1

v0.7.0

Choose a tag to compare

@mxschmitt mxschmitt released this 31 Jan 11:01
36ee721

Allow declaring connect_options fixture to connect to remote browsers.

v0.6.2

Choose a tag to compare

@mxschmitt mxschmitt released this 26 Nov 10:40
b22872c

Bugfixes:

  • devops: publish wheels in #261

v0.6.1

Choose a tag to compare

@mxschmitt mxschmitt released this 25 Nov 16:27

Fix conda publishing

v0.6.0

Choose a tag to compare

@mxschmitt mxschmitt released this 25 Nov 16:03
fb51327

What's Changed

  • feat: pytest-playwright-asyncio as separate plugin in #257
  • feat: expose output_path fixture in #248
  • chore: drop Python 3.8 in #253

Full Changelog: v0.5.2...v0.6.0

v0.5.2

Choose a tag to compare

@mxschmitt mxschmitt released this 06 Sep 09:40
ea833ce

Bugfixes:

  • chore: add py.typed file in #245
  • chore: hide internal methods in #236
  • Update conda dependencies to match setup.py in #242
  • Fix conda build and publish workflow in #243

Full Changelog: v0.5.1...v0.5.2