Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Regression - chromium browser closes during test or debugging session on macos #12974

Closed
str0zzapreti opened this issue Mar 23, 2022 · 10 comments

Comments

@str0zzapreti
Copy link

Context:

  • Playwright Version: 1.20.0
  • Operating System: Macos 11.6.5
  • Python version: Python 3.10.2
  • Browser: Chromium

Code Snippet

The easiest way to replicate this issue is to just add a breakpoint in the following snippet after launching the browser, e.g. line 5, and then initialize the debugger and wait for it to reach the breakpoint. Then just wait and Chromium will suddenly close all on its own within a minute or two.

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    page.goto("http://playwright.dev/")
    print(page.title())
    browser.close()

Describe the bug

This issue began to occur after upgrading playwright to version 1.20.0 on my local machine. We have ~30 playwright tests that get parameterized to run in both Firefox and Chromium and I validated that everything was working by running the full test suite inside an Ubuntu Focal Docker container. So far, so good. The issue started to occur when I was helping a colleague debug an issue in headed mode and my chromium browser kept quitting in the middle of the debug session. The Playwright process continued running.

Then I tried running our full test suite locally in MacOS and after about 15-17 tests, all of the remaining chromium tests would instantly fail with an error indicating the page was already closed. This is extremely consistent and persisted through reboots and rebuilding my venv (I had been testing a pytest-parallel plugin and wanted to make sure it wasn't interfering) and only stops occurring when I downgrade playwright to 1.18.2 which is the last stable version we were using. I've included the traceback from the first chromium test that fails during each session. Seems to be some kind of memory error.

TLDR

  • Playwright 1.20.0 Chromium appears to crash after running for a minute or two on MacOS
  • Firefox does not exhibit this issue (I haven't tested webkit)
  • This issue does not occur in Linux (haven't tested windows)
  • This is a regression since 1.18.2 which was the last version I tested (we skipped over 1.19.x)

Traceback

self = <playwright._impl._connection.Channel object at 0x1089be530>
method = 'click', params = {'selector': 'a[href="/app/edit-recruiter-profile"]'}
return_as_dict = False
    async def inner_send(
        self, method: str, params: Optional[Dict], return_as_dict: bool
    ) -> Any:
        if params is None:
            params = {}
        callback = self._connection._send_message_to_server(self._guid, method, params)
        if self._connection._error:
            error = self._connection._error
            self._connection._error = None
            raise error
        done, _ = await asyncio.wait(
            {
                self._connection._transport.on_error_future,
                callback.future,
            },
            return_when=asyncio.FIRST_COMPLETED,
        )
        if not callback.future.done():
            callback.future.cancel()
>       result = next(iter(done)).result()
E       playwright._impl._api_types.Error: Browser closed.
E       ==================== Browser output: ====================
E       <launching> /Users/silasj/Library/Caches/ms-playwright/chromium-978106/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --enable-use-zoom-for-dsf=false --no-sandbox --user-data-dir=/var/folders/kv/d09mrzfj49l9yp6hqzg58v840000gn/T/playwright_chromiumdev_profile-ibOEpD --remote-debugging-pipe --no-startup-window
E       <launched> pid=2236
E       [pid=2236][err] Received signal 6
E       [pid=2236][err]  [0x000118efda79]
E       [pid=2236][err]  [0x000118e59d13]
E       [pid=2236][err]  [0x000118efd9d1]
E       [pid=2236][err]  [0x7fff208d1d7d]
E       [pid=2236][err]  [0x7ffee14fb5d8]
E       [pid=2236][err]  [0x7fff207e1406]
E       [pid=2236][err]  [0x7fff206c1165]
E       [pid=2236][err]  [0x7fff206c42aa]
E       [pid=2236][err]  [0x000118a4b0fc]
E       [pid=2236][err]  [0x00011628f6af]
E       [pid=2236][err]  [0x000115395f67]
E       [pid=2236][err]  [0x0001166f4d1e]
E       [pid=2236][err]  [0x000118ee42e9]
E       [pid=2236][err]  [0x000118eb8a60]
E       [pid=2236][err]  [0x000118ecd979]
E       [pid=2236][err]  [0x000118ecd69c]
E       [pid=2236][err]  [0x000118ecde72]
E       [pid=2236][err]  [0x000118f0f323]
E       [pid=2236][err]  [0x000118f09cf2]
E       [pid=2236][err]  [0x000118f0ed5f]
E       [pid=2236][err]  [0x7fff2098437c]
E       [pid=2236][err]  [0x7fff209842e4]
E       [pid=2236][err]  [0x7fff20984064]
E       [pid=2236][err]  [0x7fff20982a8c]
E       [pid=2236][err]  [0x7fff2098204c]
E       [pid=2236][err]  [0x7fff28bcaa83]
E       [pid=2236][err]  [0x7fff28bca7e5]
E       [pid=2236][err]  [0x7fff28bca583]
E       [pid=2236][err]  [0x7fff2318ad72]
E       [pid=2236][err]  [0x7fff23189545]
E       [pid=2236][err]  [0x000118a12ab0]
E       [pid=2236][err]  [0x000118f09cf2]
E       [pid=2236][err]  [0x000118a129e9]
E       [pid=2236][err]  [0x7fff2317b869]
E       [pid=2236][err]  [0x000118f0fa2c]
E       [pid=2236][err]  [0x000118f0e892]
E       [pid=2236][err]  [0x000118ece0dd]
E       [pid=2236][err]  [0x000118e9843d]
E       [pid=2236][err]  [0x00011661ff7b]
E       [pid=2236][err]  [0x000116621612]
E       [pid=2236][err]  [0x00011661d8dc]
E       [pid=2236][err]  [0x00011899d4e8]
E       [pid=2236][err]  [0x00011899e53a]
E       [pid=2236][err]  [0x00011899e0cb]
E       [pid=2236][err]  [0x00011899c84c]
E       [pid=2236][err]  [0x00011899d0d0]
E       [pid=2236][err]  [0x0001152271be]
E       [pid=2236][err]  [0x00010e7018d1]
E       [pid=2236][err]  [0x7fff208a7f3d]
E       [pid=2236][err]  [0x000000000020]
E       [pid=2236][err] [end of stack trace]
E       [pid=2236][err] [0322/180717.089119:WARNING:process_memory_mac.cc(93)] mach_vm_read(0x7ffee14fe000, 0x2000): (os/kern) invalid address (1)
E       [pid=2236][err] [0322/180717.250919:WARNING:crash_report_exception_handler.cc(235)] UniversalExceptionRaise: (os/kern) failure (5)
E       =========================== logs ===========================
E       waiting for selector "a[href="/app/edit"]"
E         selector resolved to visible <a data-v-d7081870="" data-v-1b7f802e="" href="/app…>Complete task</a>
E       attempting click action
E         waiting for element to be visible, enabled and stable
E           element is not stable - waiting...
E       ============================================================
../venv/lib/python3.10/site-packages/playwright/_impl/_connection.py:63: Error
@mxschmitt mxschmitt transferred this issue from microsoft/playwright-python Mar 23, 2022
@devkat
Copy link
Contributor

devkat commented Mar 23, 2022

I am facing a similar issue:

  • macOS 12.3 Monterey
  • Playwright 1.20.0 Chromium; inspector mode (PWDEBUG=1)
    locator.click: Browser closed.
    ==================== Browser output: ====================
    <launching> /Users/…/Library/Caches/ms-playwright/chromium-978106/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --enable-use-zoom-for-dsf=false --no-sandbox --user-data-dir=/var/folders/k5/kg1jspx52tz3t_gmj8_cdpxh0000gn/T/playwright_chromiumdev_profile-8oWsSX --remote-debugging-pipe --no-startup-window
    <launched> pid=76314
    [pid=76314][err] objc[76325]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5b3a1318) and /Users/…/Library/Caches/ms-playwright/chromium-978106/chrome-mac/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/101.0.4929.0/Libraries/libGLESv2.dylib (0x113fafbf0). One of the two will be used. Which one is undefined.
    [pid=76314][err] Received signal 6
    [pid=76314][err]  [0x000128658a79]
    …
    [pid=76314][err] [end of stack trace]
    [pid=76314][err] [0323/125121.744605:WARNING:crash_report_exception_handler.cc(235)] UniversalExceptionRaise: (os/kern) failure (5)
    =========================== logs ===========================
    waiting for selector ".ant-select-item-option-content:has-text("admin")"
    ============================================================

@mxschmitt
Copy link
Member

mxschmitt commented Mar 23, 2022

I was able to repro on 1.20.0 but it seems fixed on ToT.

PWDEBUG=1 node test.js

const pw = require("playwright");

(async () => {
  const browser = await pw.chromium.launch();
  const page = await browser.newPage();
  await page.goto("https://example.com");
})()

Expected: it works for 2-3 minutes
Actual: it crashes after 1-2 minutes.

As a workaround the current @next seems to be working: npm i -D @playwright/test@next

@str0zzapreti
Copy link
Author

Nice, OK. For Python, this should be available in 1.21.0 then? Or will there be a 1.20.1 release?

Thanks!

@klhex
Copy link
Contributor

klhex commented Mar 23, 2022

On my Mac (M1, MacOS Monterey 12.3) I get the same dump as @devkat. On our CI/CD system however (Linux #58~16.04.1-Ubuntu SMP Mon Jun 24 13:21:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux), running the same test produces the following dump:

Click to expand!
page.click: Browser closed.
==================== Browser output: ====================
<launching> /ms-playwright/chromium-978106/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-setuid-sandbox --no-first-run --no-sandbox --no-zygote --user-data-dir=/tmp/playwright_chromiumdev_profile-urUX6S --remote-debugging-pipe --no-startup-window
<launched> pid=215
[pid=215][err] [215:231:0323/193028.962034:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] [215:231:0323/193028.962125:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] [215:230:0323/193028.964089:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[pid=215][err] [215:230:0323/193028.964122:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[pid=215][err] [215:230:0323/193028.998764:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[pid=215][err] [215:230:0323/193028.998799:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[pid=215][err] [215:254:0323/193029.008336:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] [215:254:0323/193029.008362:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] [215:254:0323/193029.008396:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] [215:254:0323/193029.008425:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] [215:254:0323/193029.008443:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[pid=215][err] libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[pid=215][err] [215:230:0323/193029.028426:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[pid=215][err] [215:230:0323/193029.028449:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[pid=215][err] [239:239:0323/193029.042071:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
[pid=215][err] [215:215:0323/193045.128178:ERROR:page_load_metrics_update_dispatcher.cc(66)] Received null navigation_start.
[pid=215][err] [0323/193129.432393:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Operation not permitted (1)
[pid=215][err] Received signal 11 <unknown> 000000000000
[pid=215][err] #0 0x556261eb2369 base::debug::CollectStackTrace()
[pid=215][err] #1 0x556261e188c3 base::debug::StackTrace::StackTrace()
[pid=215][err] #2 0x556261eb1e71 base::debug::(anonymous namespace)::StackDumpSignalHandler()
[pid=215][err] #3 0x7f0f8cd033c0 (/usr/lib/x86_64-linux-gnu/libpthread-2.31.so+0x143bf)
[pid=215][err] #4 0x556261ece5f7 base::internal::PartitionFree()
[pid=215][err] #5 0x556261a5391c component_updater::PKIMetadataComponentInstallerPolicy::UpdateNetworkServiceOnUI()
[pid=215][err] #6 0x55625f51c0df base::internal::ReplyAdapter<>()
[pid=215][err] #7 0x55625e65c637 base::internal::Invoker<>::RunOnce()
[pid=215][err] #8 0x55625f9840ae base::internal::Invoker<>::RunOnce()
[pid=215][err] #9 0x556261e99d79 base::internal::Invoker<>::RunOnce()
[pid=215][err] #10 0x556261e70bb0 base::TaskAnnotator::RunTaskImpl()
[pid=215][err] #11 0x556261e84a99 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
[pid=215][err] #12 0x556261e847bc base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
[pid=215][err] #13 0x556261e84f92 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
[pid=215][err] #14 0x556261e33ecf base::MessagePumpGlib::Run()
[pid=215][err] #15 0x556261e851fe base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
[pid=215][err] #16 0x556261e523ed base::RunLoop::Run()
[pid=215][err] #17 0x55625f8b52ad content::BrowserMainLoop::RunMainMessageLoop()
[pid=215][err] #18 0x55625f8b6b62 content::BrowserMainRunnerImpl::Run()
[pid=215][err] #19 0x55625f8b2d6c content::BrowserMain()
[pid=215][err] #20 0x5562619ca8a8 content::RunBrowserProcessMain()
[pid=215][err] #21 0x5562619cbd0f content::ContentMainRunnerImpl::RunBrowser()
[pid=215][err] #22 0x5562619cb89f content::ContentMainRunnerImpl::Run()
[pid=215][err] #23 0x5562619c8cb4 content::RunContentProcess()
[pid=215][err] #24 0x5562619c95ce content::ContentMain()
[pid=215][err] #25 0x55625e4e9fed ChromeMain
[pid=215][err] #26 0x7f0f8be2e0b3 __libc_start_main
[pid=215][err] #27 0x55625e4e9dea _start
[pid=215][err]   r8: 00003b30028a9400  r9: 00007ffc61ed0767 r10: bb31e949bf7562f8 r11: 0000000000000000
[pid=215][err]  r12: 22656d6172467473 r13: 00003b30028a9400 r14: 00003b3002958cb0 r15: 0000000000000008
[pid=215][err]   di: 0000556267509910  si: 22656d6172467473  bp: 00007ffc61ed0800  bx: 22656d6172400000
[pid=215][err]   dx: 0000000000000000  ax: 0000556261ece5d0  cx: 00003b30002caa7a  sp: 00007ffc61ed07d0
[pid=215][err]   ip: 0000556261ece5f7 efl: 0000000000010206 cgf: 002b000000000033 erf: 0000000000000000
[pid=215][err]  trp: 000000000000000d msk: 0000000000000000 cr2: 0000000000000000
[pid=215][err] [end of stack trace]

@mxschmitt
Copy link
Member

mxschmitt commented Mar 23, 2022

Workaround for affected folks

Install latest beta: npm install -D @playwright/test@beta

We'll release 1.20.1 soon.

Closing this since the fixes have been merged!

@klhex
Copy link
Contributor

klhex commented Mar 23, 2022

PW 1.20.1 has fixed the issue on my side, thanks for the quick fix. 😄

@str0zzapreti
Copy link
Author

100% fixed on python-playwright 1.20.1. Thanks much!

@mirao
Copy link

mirao commented Mar 24, 2022

I had the same issue on Ubuntu 21.10, with CodeceptJS + Playwright 1.20.0 and headed Chromium only (headless Chromium worked fine). Chromium was crashing almost in every test.
Now it seems to be fine, with Playwright 1.20.1

@MrPowerGamerBR
Copy link

While this was fixed, I'm experiencing issues with Headed Chromium on Playwright 1.24.1 (Windows 10, Java) where the browser just closes by itself with Target page, context or browser has been closed

However this seems to be very random, and it takes way more time to get to the point where the browser closes by itself (in my last run, it took 27 minutes until Chromium closed by itself)

Running headless Chromium does not have the same issue, and now I'm running the app with PWDEBUG to try to get more information about the issue.

@MrPowerGamerBR
Copy link

Small update: Even with PWDEBUG enabled, there doesn't seem to be any errors that indicate anything.

If I keep my app running, after a while Playwright Debugger closes by itself (the browser stays open), and sometimes both the Playwright Debugger and the browser closes by itself.

However, this is hard to reproduce because there doesn't seem to be anything that could cause this, it just poofs, closes by itself after a while.

bors bot referenced this issue in ttbud/ttbud Dec 11, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@playwright/test](https://playwright.dev) ([source](https://togithub.com/Microsoft/playwright)) | [`1.15.2` -> `1.28.1`](https://renovatebot.com/diffs/npm/@playwright%2ftest/1.15.2/1.28.1) | [![age](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/compatibility-slim/1.15.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/confidence-slim/1.15.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>Microsoft/playwright</summary>

### [`v1.28.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.28.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.28.0...v1.28.1)

#### Highlights

This patch release includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/18928](https://togithub.com/microsoft/playwright/issues/18928) - \[BUG] Electron firstWindow times out after upgrading to 1.28.0[https://github.com/microsoft/playwright/issues/18920](https://togithub.com/microsoft/playwright/issues/18920)0 - \[BUG] \[expanded=false] in role selector returns elements without aria-expanded attribu[https://github.com/microsoft/playwright/issues/18865](https://togithub.com/microsoft/playwright/issues/18865)865 - \[BUG] regression in killing web server process in 1.28.0

#### Browser Versions

-   Chromium 108.0.5359.29
-   Mozilla Firefox 106.0
-   WebKit 16.4

This version was also tested against the following stable channels:

-   Google Chrome 107
-   Microsoft Edge 107

### [`v1.28.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.28.0): v1.28

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.27.1...v1.28.0)

#### Playwright Tools

-   **Record at Cursor in VSCode.** You can run the test, position the cursor at the end of the test and continue generating the test.

<img alt="New VSCode Extension" width=600 src="https://user-images.githubusercontent.com/746130/202005839-aba2eeba-217b-424d-8496-8b4f5fa72f41.png">

-   **Live Locators in VSCode.** You can hover and edit locators in VSCode to get them  highlighted in the opened browser.
-   **Live Locators in CodeGen.** Generate a locator for any element on the page using "Explore" tool.

<img alt="Locator Explorer" src="https://user-images.githubusercontent.com/746130/201796876-01567a0b-ca61-4a9d-b12b-04786c471671.png" width=600>

-   **Codegen and Trace Viewer Dark Theme.** Automatically picked up from operating system settings.

<img alt="Dark Theme" src="https://user-images.githubusercontent.com/746130/201797969-603f74df-d7cf-4c56-befd-798dbd269796.png" width=600>

##### Test Runner

-   Configure retries and test timeout for a file or a test with [`test.describe.configure([options])`](https://playwright.dev/docs/api/class-test#test-describe-configure).

    ```js
    // Each test in the file will be retried twice and have a timeout of 20 seconds.
    test.describe.configure({ retries: 2, timeout: 20_000 });
    test('runs first', async ({ page }) => {});
    test('runs second', async ({ page }) => {});
    ```

-   Use [`testProject.snapshotPathTemplate`](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template) and [`testConfig.snapshotPathTemplate`](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template) to configure a template controlling location of snapshots generated by [`expect(page).toHaveScreenshot(name[, options])`](https://playwright.dev/docs/test-assertions#page-assertions-to-have-screenshot-1) and [`expect(screenshot).toMatchSnapshot(name[, options])`](https://playwright.dev/docs/test-assertions#screenshot-assertions-to-match-snapshot-1).

    ```js
    // playwright.config.ts
    import type { PlaywrightTestConfig } from '@&#8203;playwright/test';

    const config: PlaywrightTestConfig = {
      testDir: './tests',
      snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}',
    };

    export default config;
    ```

##### New APIs

-   [`locator.blur([options])`](https://playwright.dev/docs/api/class-locator#locator-blur)
-   [`locator.clear([options])`](https://playwright.dev/docs/api/class-locator#locator-clear)
-   [`android.launchServer([options])`](https://playwright.dev/docs/api/class-android#android-launch-server) and [`android.connect(wsEndpoint[, options])`](https://playwright.dev/docs/api/class-android#android-connect)
-   [`androidDevice.on('close')`](https://playwright.dev/docs/api/class-androiddevice#android-device-event-close)

##### Browser Versions

-   Chromium 108.0.5359.29
-   Mozilla Firefox 106.0
-   WebKit 16.4

This version was also tested against the following stable channels:

-   Google Chrome 107
-   Microsoft Edge 107

### [`v1.27.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.27.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.27.0...v1.27.1)

#### Highlights

This patch release includes the following bug fixes:

[https://github.com/microsoft/playwright/pull/18010](https://togithub.com/microsoft/playwright/pull/18010) - fix(generator): generate nice locators for arbitrary selectors
[https://github.com/microsoft/playwright/pull/17999](https://togithub.com/microsoft/playwright/pull/17999) - chore: don't fail on undefined video/trace
[https://github.com/microsoft/playwright/issues/17955](https://togithub.com/microsoft/playwright/issues/17955) - \[Question] Github Actions test compatibility check failed mitigation?[https://github.com/microsoft/playwright/issues/17960](https://togithub.com/microsoft/playwright/issues/17960)0 - \[BUG] Codegen 1.27 creates NUnit code that does not compil[https://github.com/microsoft/playwright/pull/17952](https://togithub.com/microsoft/playwright/pull/17952)52 - fix: fix typo in treeitem role typing

#### Browser Versions

-   Chromium 107.0.5304.18
-   Mozilla Firefox 105.0.1
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 106
-   Microsoft Edge 106

### [`v1.27.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.27.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.26.1...v1.27.0)

##### Locators

With these new APIs, inspired by [Testing Library](https://testing-library.com/), writing locators is a joy:

-   [`page.getByText(text, options)`](https://playwright.dev/docs/api/class-page#page-get-by-text) to locate by text content.
-   [`page.getByRole(role, options)`](https://playwright.dev/docs/api/class-page#page-get-by-role) to locate by [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).
-   [`page.getByLabel(label, options)`](https://playwright.dev/docs/api/class-page#page-get-by-label) to locate a form control by associated label's text.
-   [`page.getByPlaceholder(placeholder, options)`](https://playwright.dev/docs/api/class-page#page-get-by-placeholder) to locate an input by placeholder.
-   [`page.getByAltText(altText, options)`](https://playwright.dev/docs/api/class-page#page-get-by-alt-text) to locate an element, usually image, by its text alternative.
-   [`page.getByTitle(title, options)`](https://playwright.dev/docs/api/class-page#page-get-by-title) to locate an element by its title.

```js
await page.getByLabel('User Name').fill('John');

await page.getByLabel('Password').fill('secret-password');

await page.getByRole('button', { name: 'Sign in' }).click();

await expect(page.getByText('Welcome, John!')).toBeVisible();
```

All the same methods are also available on [Locator](https://playwright.dev/docs/api/class-locator), [FrameLocator](https://playwright.dev/docs/api/class-framelocator) and [Frame](https://playwright.dev/docs/api/class-frame) classes.

##### Other highlights

-   `workers` option in the `playwright.config.ts` now accepts a percentage string to use some of the available CPUs. You can also pass it in the command line:
    ```bash
    npx playwright test --workers=20%
    ```

-   New options `host` and `port` for the html reporter.
    ```js
    reporters: [['html', { host: 'localhost', port: '9223' }]]
    ```

-   New field `FullConfig.configFile` is available to test reporters, specifying the path to the config file if any.

-   As announced in v1.25, Ubuntu 18 will not be supported as of Dec 2022. In addition to that, there will be no WebKit updates on Ubuntu 18 starting from the next Playwright release.

##### Behavior Changes

-   [`expect(locator).toHaveAttribute(name, value, options)`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-attribute) with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when `button` **does not** have a `disabled` attribute.

    ```js
    await expect(page.getByRole('button')).toHaveAttribute('disabled', '');
    ```

-   Command line options `--grep` and `--grep-invert` previously incorrectly ignored `grep` and `grepInvert` options specified in the config. Now all of them are applied together.

-   JSON reporter path resolution is performed relative to the config directory instead of the current working directory:

    ```js
    ["json", { outputFile: "./test-results/results.json" }]]
    ```

##### Browser Versions

-   Chromium 107.0.5304.18
-   Mozilla Firefox 105.0.1
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 106
-   Microsoft Edge 106

### [`v1.26.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.26.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.26.0...v1.26.1)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/17500](https://togithub.com/microsoft/playwright/issues/17500) - \[BUG] No tests found using the test explorer - pw/test@1.26.0

#### Browser Versions

-   Chromium 106.0.5249.30
-   Mozilla Firefox 104.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 105
-   Microsoft Edge 105

### [`v1.26.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.26.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.25.2...v1.26.0)

#### Assertions

-   New option enabled for [`expect(locator).toBeEnabled([options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-be-enabled).
-   [`expect(locator).toHaveText(expected[, options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-text) now pierces open shadow roots.
-   New option editable for [`expect(locator).toBeEditable([options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-be-editable).
-   New option visible for [`expect(locator).toBeVisible([options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-be-visible).

#### Other Highlights

-   New option `maxRedirects` for [`apiRequestContext.get(url[, options])`](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get) and others to limit redirect count.
-   New command-line flag `--pass-with-no-tests` that allows the test suite to pass when no files are found.
-   New command-line flag `--ignore-snapshots` to skip snapshot expectations, such as `expect(value).toMatchSnapshot()` and `expect(page).toHaveScreenshot()`.

#### Behavior Change

A bunch of Playwright APIs already support the waitUntil: 'domcontentloaded' option. For example:

```ts
await page.goto('https://playwright.dev', {
  waitUntil: 'domcontentloaded',
});
```

Prior to 1.26, this would wait for all iframes to fire the `DOMContentLoaded` event.

To align with web specification, the `'domcontentloaded'` value only waits for the target frame to fire the `'DOMContentLoaded'` event. Use `waitUntil: 'load'` to wait for all iframes.

#### Browser Versions

-   Chromium 106.0.5249.30
-   Mozilla Firefox 104.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 105
-   Microsoft Edge 105

### [`v1.25.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.25.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.25.1...v1.25.2)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/16937](https://togithub.com/microsoft/playwright/issues/16937) - \[REGRESSION]: session storage failing >= 1.25.0 in firefox[https://github.com/microsoft/playwright/issues/16955](https://togithub.com/microsoft/playwright/issues/16955)5 - Not using channel on config file when Show and Reuse browser is checked

#### Browser Versions

-   Chromium 105.0.5195.19
-   Mozilla Firefox 103.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 104
-   Microsoft Edge 104

### [`v1.25.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.25.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.25.0...v1.25.1)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/16319](https://togithub.com/microsoft/playwright/issues/16319) - \[BUG] webServer.command esbuild fails with ESM and Yarn[https://github.com/microsoft/playwright/issues/16460](https://togithub.com/microsoft/playwright/issues/16460)0 - \[BUG] Component test fails on 2nd run when SSL is use[https://github.com/microsoft/playwright/issues/16665](https://togithub.com/microsoft/playwright/issues/16665)65 - \[BUG] custom selector engines don't work when running in debug mode

#### Browser Versions

-   Chromium 105.0.5195.19
-   Mozilla Firefox 103.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 104
-   Microsoft Edge 104

### [`v1.25.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.25.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.24.2...v1.25.0)

#### VSCode Extension

-   **New Playwright actions view**

    <img width="246" alt="Playwright actions" src="https://user-images.githubusercontent.com/883973/184041259-812722f2-26e3-4561-a972-a1c7973f1332.png">

-   **Pick selector**
    You can pick selector right from a live page, before or after running a test

    <img width="660" alt="Pick selector" src="https://user-images.githubusercontent.com/883973/184041462-288b9458-1650-4789-bd9e-b60d2ccd11dc.png">

-   **Record new test**
    Start recording where you left off with the new 'Record new test' feature.

-   **Show & reuse browser**
    Watch your tests running live & keep devtools open. Develop while continuously running tests.

<img width="660" alt="extension screenshot" src="https://user-images.githubusercontent.com/746130/184043183-1b3932ec-2ca9-4775-a10e-e6fbb20f9a95.jpg">

#### Test Runner

-   [`test.step(title, body)`](https://playwright.dev/docs/api/class-test#test-step) now returns the value of the step function:

    ```ts
    test('should work', async ({ page }) => {
        const pageTitle = await test.step('get title', async () => {
            await page.goto('https://playwright.dev');
            return await page.title();
        });
        console.log(pageTitle);
    });
    ```

-   Added [`test.describe.fixme(title, callback)`](https://playwright.dev/docs/api/class-test#test-describe-fixme).

-   New `'interrupted'` test status.

-   Enable tracing via CLI flag: `npx playwright test --trace=on`.

-   New property [`testCase.id`](https://playwright.dev/docs/api/class-testcase#test-case-id) that can be use in reporters as a history ID.

#### Announcements

-   🎁 We now ship Ubuntu 22.04 Jammy Jellyfish docker image: `mcr.microsoft.com/playwright:v1.25.0-jammy`.
-   🪦 This is the last release with macOS 10.15 support (deprecated as of 1.21).
-   🪦 This is the last release with Node.js 12 support, we recommend upgrading to Node.js LTS (16).
-   ⚠️ Ubuntu 18 is now deprecated and will not be supported as of Dec 2022.

#### Browser Versions

-   Chromium 105.0.5195.19
-   Mozilla Firefox 103.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 104
-   Microsoft Edge 104

### [`v1.24.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.24.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.24.1...v1.24.2)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/15977](https://togithub.com/microsoft/playwright/issues/15977) - \[BUG] test.use of storage state regression in 1.24

#### Browser Versions

-   Chromium 104.0.5112.48
-   Mozilla Firefox 102.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.24.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.24.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.24.0...v1.24.1)

##### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/15898](https://togithub.com/microsoft/playwright/issues/15898) - \[BUG] Typescript error: The type for webServer config property (TestConfigWebServer) is not typed correctly[https://github.com/microsoft/playwright/issues/15913](https://togithub.com/microsoft/playwright/issues/15913)3 - \[BUG] hooksConfig is required for mount fixtur[https://github.com/microsoft/playwright/issues/15932](https://togithub.com/microsoft/playwright/issues/15932)32 - \[BUG] - Install MS Edge on CI Fails

##### Browser Versions

-   Chromium 104.0.5112.48
-   Mozilla Firefox 102.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.24.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.24.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.4...v1.24.0)

#### 🌍 Multiple Web Servers in `playwright.config.ts`

Launch multiple web servers, databases, or other processes by passing an array of configurations:

```ts
// playwright.config.ts
import type { PlaywrightTestConfig } from '@&#8203;playwright/test';
const config: PlaywrightTestConfig = {
  webServer: [
    {
      command: 'npm run start',
      port: 3000,
      timeout: 120 * 1000,
      reuseExistingServer: !process.env.CI,
    },
    {
      command: 'npm run backend',
      port: 3333,
      timeout: 120 * 1000,
      reuseExistingServer: !process.env.CI,
    }
  ],
  use: {
    baseURL: 'http://localhost:3000/',
  },
};
export default config;
```

#### 🐂 Debian 11 Bullseye Support

Playwright now supports Debian 11 Bullseye on x86\_64 for Chromium, Firefox and WebKit. Let us know
if you encounter any issues!

Linux support looks like this:

|          | Ubuntu 18.04 | Ubuntu 20.04 | Ubuntu 22.04 | Debian 11
| :--- | :---: | :---: | :---: | :---: |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| WebKit | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |

#### 🕵️ Anonymous Describe

It is now possible to call [`test.describe(callback)`](https://playwright.dev/docs/api/class-test#test-describe-2) to create suites without a title. This is useful for giving a group of tests a common option with [`test.use(options)`](https://playwright.dev/docs/api/class-test#test-use).

```ts
test.describe(() => {
  test.use({ colorScheme: 'dark' });

  test('one', async ({ page }) => {
    // ...
  });

  test('two', async ({ page }) => {
    // ...
  });
});
```

#### 🧩 Component Tests Update

Playwright 1.24 Component Tests introduce `beforeMount` and `afterMount` hooks.
Use these to configure your app for tests.

##### Vue + Vue Router

For example, this could be used to setup App router in Vue.js:

```js
// src/component.spec.ts
import { test } from '@&#8203;playwright/experimental-ct-vue';
import { Component } from './mycomponent';

test('should work', async ({ mount }) => {
  const component = await mount(Component, {
    hooksConfig: {
      /* anything to configure your app */
    }
  });
});
```

```js
// playwright/index.ts
import { router } from '../router';
import { beforeMount } from '@&#8203;playwright/experimental-ct-vue/hooks';

beforeMount(async ({ app, hooksConfig }) => {
  app.use(router);
});
```

##### React + Next.js

A similar configuration in Next.js would look like this:

```js
// src/component.spec.jsx
import { test } from '@&#8203;playwright/experimental-ct-react';
import { Component } from './mycomponent';

test('should work', async ({ mount }) => {
  const component = await mount(<Component></Component>, {
    // Pass mock value from test into `beforeMount`.
    hooksConfig: {
      router: {
        query: { page: 1, per_page: 10 },
        asPath: '/posts'
      }
    }
  });
});
```

```js
// playwright/index.js
import router from 'next/router';
import { beforeMount } from '@&#8203;playwright/experimental-ct-react/hooks';

beforeMount(async ({ hooksConfig }) => {
  // Before mount, redefine useRouter to return mock value from test.
  router.useRouter = () => hooksConfig.router;
});
```

#### Browser Versions

-   Chromium 104.0.5112.48
-   Mozilla Firefox 102.0
-   WebKit 16.0

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.23.4`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.4)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.3...v1.23.4)

#### Highlights

This patch includes the following bug fix:

[https://github.com/microsoft/playwright/issues/15717](https://togithub.com/microsoft/playwright/issues/15717) - \[REGRESSION]: Suddenly stopped working despite nothing having changed (`experimentalLoader.js:load` did not call the next hook in its chain and did not explicitly signal a short circuit)

#### Browser Versions

-   Chromium 104.0.5112.20
-   Mozilla Firefox 100.0.2
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.23.3`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.3)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.2...v1.23.3)

##### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/15557](https://togithub.com/microsoft/playwright/issues/15557) - \[REGRESSION]: Event Listeners not being removed if same handler is used for different events

##### Browser Versions

-   Chromium 104.0.5112.20
-   Mozilla Firefox 100.0.2
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.23.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.1...v1.23.2)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/15273](https://togithub.com/microsoft/playwright/issues/15273) - \[BUG] LaunchOptions config has no effect after update to v1.23.0[https://github.com/microsoft/playwright/issues/15351](https://togithub.com/microsoft/playwright/issues/15351)1 - \[REGRESSION]: Component testing project does not compile anymor[https://github.com/microsoft/playwright/issues/15431](https://togithub.com/microsoft/playwright/issues/15431)31 - \[BUG] Regression: page.on('console') is ignored in 1.23

#### Browser Versions

-   Chromium 104.0.5112.20
-   Mozilla Firefox 100.0.2
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.23.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.0...v1.23.1)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/15219](https://togithub.com/microsoft/playwright/issues/15219) - \[REGRESSION]: playwright-core 1.23.0 issue with 'TypeError \[ERR_INVALID_ARG_TYPE]: The "listener" argument'

#### Browser Versions

-   Chromium 104.0.5112.20
-   Mozilla Firefox 100.0.2
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 103
-   Microsoft Edge 103

### [`v1.23.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.22.2...v1.23.0)

<a href="https://youtu.be/NRGOV46P3kU"><img src="https://user-images.githubusercontent.com/746130/177854522-a07f4701-9528-4bf9-bf0f-30fbdfb04c8c.png" width=340></a> <a href="https://youtu.be/NRGOV46P3kU">Playwright v1.23 updates</a>

#### Network Replay

Now you can record network traffic into a HAR file and re-use the data in your tests.

To record network into HAR file:

```bash
npx playwright open --save-har=github.har.zip https://github.com/microsoft
```

Alternatively, you can record HAR programmatically:

```ts
const context = await browser.newContext({
  recordHar: { path: 'github.har.zip' }
});
// ... do stuff ...
await context.close();
```

Use the new methods [`page.routeFromHAR()`](https://playwright.dev/docs/api/class-page#page-route-from-har) or [`browserContext.routeFromHAR()`](https://playwright.dev/docs/api/class-browsercontext#browser-context-route-from-har) to serve matching responses from the [HAR](http://www.softwareishard.com/blog/har-12-spec/) file:

```ts
await context.routeFromHAR('github.har.zip');
```

Read more in [our documentation](https://playwright.dev/docs/network#record-and-replay-requests).

##### Advanced Routing

You can now use [`route.fallback()`](https://playwright.dev/docs/api/class-route#route-fallback) to defer routing to other handlers.

Consider the following example:

```ts
// Remove a header from all requests.
test.beforeEach(async ({ page }) => {
  await page.route('**/*', route => {
    const headers = route.request().headers();
    delete headers['if-none-match'];
    route.fallback({ headers });
  });
});

test('should work', async ({ page }) => {
  await page.route('**/*', route => {
    if (route.request().resourceType() === 'image')
      route.abort();
    else
      route.fallback();
  });
});
```

Note that the new methods [`page.routeFromHAR()`](https://playwright.dev/docs/api/class-page#page-route-from-har) and [`browserContext.routeFromHAR()`](https://playwright.dev/docs/api/class-browsercontext#browser-context-route-from-har) also participate in routing and could be deferred to.

##### Web-First Assertions Update

-   New method [`expect(locator).toHaveValues()`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-values) that asserts all selected values of `<select multiple>` element.
-   Methods [`expect(locator).toContainText()`](https://playwright.dev/docs/test-assertions#locator-assertions-to-contain-text) and [`expect(locator).toHaveText()`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-text) now accept `ignoreCase` option.

##### Component Tests Update

-   Support for Vue2 via the [`@playwright/experimental-ct-vue2`](https://www.npmjs.com/package/@&#8203;playwright/experimental-ct-vue2) package.
-   Support for component tests for [create-react-app](https://www.npmjs.com/package/create-react-app) with components in `.js` files.

Read more about [component testing with Playwright](https://playwright.dev/docs/test-components).

##### Miscellaneous

-   If there's a service worker that's in your way, you can now easily disable it with a new context option [`serviceWorkers`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-service-workers):
    ```ts
    // playwright.config.ts
    export default {
      use: {
        serviceWorkers: 'block',
      }
    }
    ```
-   Using `.zip` path for [`recordHar`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har) context option automatically zips the resulting HAR:
    ```ts
    const context = await browser.newContext({
      recordHar: {
        path: 'github.har.zip',
      }
    });
    ```
-   If you intend to edit HAR by hand, consider using the `"minimal"` HAR recording mode
    that only records information that is essential for replaying:
    ```ts
    const context = await browser.newContext({
      recordHar: {
        path: 'github.har.zip',
        mode: 'minimal',
      }
    });
    ```
-   Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64. We also publish new docker image `mcr.microsoft.com/playwright:v1.23.0-focal`.

##### ⚠️ Breaking Changes ⚠️

WebServer is now considered "ready" if request to the specified port has any of the following HTTP status codes:

-   `200-299`
-   `300-399` (new)
-   `400`, `401`, `402`, `403` (new)

### [`v1.22.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.22.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.22.1...v1.22.2)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/14254](https://togithub.com/microsoft/playwright/issues/14254) - \[BUG] focus() function in version 1.22 closes dropdown (not of select type) instead of just focus on the option

#### Browser Versions

-   Chromium 102.0.5005.40
-   Mozilla Firefox 99.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 101
-   Microsoft Edge 101

### [`v1.22.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.22.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.22.0...v1.22.1)

##### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/14186](https://togithub.com/microsoft/playwright/issues/14186) - \[BUG] expect.toHaveScreenshot() generates an argument error

##### Browser Versions

-   Chromium 102.0.5005.40
-   Mozilla Firefox 99.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 101
-   Microsoft Edge 101

### [`v1.22.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.22.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.21.1...v1.22.0)

#### Introducing Component Testing (preview)

Playwright Test can now test your [React](https://reactjs.org/), [Vue.js](https://vuejs.org/) or [Svelte](https://svelte.dev/) components. You can use all the features of Playwright Test (such as parallelization, emulation & debugging) while running components in real browsers.

<a href="https://youtu.be/y3YxX4sFJbM">![component testing](https://user-images.githubusercontent.com/883973/169662902-deedc95e-12b9-4dfd-b37d-db249910de35.jpg)</a> <a href="https://youtu.be/y3YxX4sFJbM">Component Tests (Preview)</a>

Here is what a typical component test looks like:

```tsx
// App.spec.tsx
import { test, expect } from '@&#8203;playwright/experimental-ct-react';
import App from './App';

// Let's test component in a dark scheme!
test.use({ colorScheme: 'dark' });

test('should render', async ({ mount }) => {
  const component = await mount(<App></App>);

  // As with any Playwright test, assert locator text.
  await expect(component).toContainText('React');
  // Or do a screenshot 🚀
  await expect(component).toHaveScreenshot();
  // Or use any Playwright method
  await component.click();
});
```

Read more in [our documentation](https://playwright.dev/docs/test-components).

***

<a href="https://youtu.be/keV2CIgtBlg">![release update](https://user-images.githubusercontent.com/883973/169663011-23156ebf-c5a9-4eea-91bf-06b555dc60e9.jpg)</a> <a href="https://youtu.be/keV2CIgtBlg">Playwright v1.22 updates</a>

#### Locators Update

-   Role selectors allow selecting elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).

    ```ts
    // Click a button with accessible name "log in"
    await page.click('role=button[name="log in"]')
    ```

    Read more in [our documentation](https://playwright.dev/docs/selectors#role-selector).

-   New [`locator.filter([options])`](https://playwright.dev/docs/api/class-locator#locator-filter) API to filter an existing locator
    ```ts
    const buttons = page.locator('role=button');
    // ...
    const submitButton = buttons.filter({ hasText: 'Submit' });
    await submitButton.click();
    ```

#### Screenshots Update

New web-first assertions [`expect(page).toHaveScreenshot()`](https://playwright.dev/docs/test-assertions#page-assertions-to-have-screenshot) and [`expect(locator).toHaveScreenshot()`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-screenshot) that wait for screenshot stabilization and enhances test reliability.

The new assertions has screenshot-specific defaults, such as:

-   disables animations
-   uses CSS scale option

```ts
await page.goto('https://playwright.dev');
await expect(page).toHaveScreenshot();
```

The new [`expect(page).toHaveScreenshot()`](https://playwright.dev/docs/test-assertions#page-assertions-to-have-screenshot) saves screenshots at the same location as [`expect(screenshot).toMatchSnapshot()`](https://playwright.dev/docs/test-assertions#screenshot-assertions-to-match-snapshot-1).

#### Browser Versions

-   Chromium 102.0.5005.40
-   Mozilla Firefox 99.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 101
-   Microsoft Edge 101

### [`v1.21.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.21.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.21.0...v1.21.1)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/pull/13597](https://togithub.com/microsoft/playwright/pull/13597) - \[BUG] fullyParallel created too many workers, slowing down test run[https://github.com/microsoft/playwright/issues/13530](https://togithub.com/microsoft/playwright/issues/13530)0 - \[REGRESSION]: Pull request [#&#8203;12877](https://togithub.com/Microsoft/playwright/issues/12877) prevents the library from being used on any linux distro that is not Ubuntu

#### Browser Versions

-   Chromium 101.0.4951.26
-   Mozilla Firefox 98.0.2
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 100
-   Microsoft Edge 100

### [`v1.21.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.21.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.20.2...v1.21.0)

<a href="https://youtu.be/45HZdbmgEw8">![release 1.21](https://user-images.githubusercontent.com/883973/169663514-5f93834a-a0cc-49f8-be11-892010f89f09.jpg)</a> <a href="https://youtu.be/45HZdbmgEw8">Playwright v1.21 updates</a>

#### Highlights

-   New **experimental** role selectors that allow selecting elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).

    ```js
    // Click a button with accessible name "log in"
    await page.click('role=button[name="log in"]')
    ```

    To use role selectors, make sure to pass `PLAYWRIGHT_EXPERIMENTAL_FEATURES=1` environment variable:

    ```js
    // playwright.config.js
    process.env.PLAYWRIGHT_EXPERIMENTAL_FEATURES = '1';
    module.exports = {
      /* ... */
    };
    ```

    Read more in [our documentation](https://playwright.dev/docs/selectors#role-selector).

-   New `scale` option in [`Page.screenshot`](https://playwright.dev/docs/api/class-page#page-screenshot) for smaller sized screenshots.

-   New `caret` option in [`Page.screenshot`](https://playwright.dev/docs/api/class-page#page-screenshot) to control text caret. Defaults to `"hide"`.

-   New method `expect.poll` to wait for an arbitrary condition:

    ```js
    // Poll the method until it returns an expected result.
    await expect.poll(async () => {
      const response = await page.request.get('https://api.example.com');
      return response.status();
    }).toBe(200);
    ```

    `expect.poll` supports most synchronous matchers, like `.toBe()`, `.toContain()`, etc.
    Read more in [our documentation](https://playwright.dev/docs/test-assertions#polling).

#### Behavior Changes

-   ESM support when running TypeScript tests is now enabled by default. The `PLAYWRIGHT_EXPERIMENTAL_TS_ESM` env variable is
    no longer required.
-   The `mcr.microsoft.com/playwright` docker image no longer contains Python. Please use `mcr.microsoft.com/playwright/python`
    as a Playwright-ready docker image with pre-installed Python.
-   Playwright now supports large file uploads (100s of MBs) via [`Locator.setInputFiles`](https://playwright.dev/docs/api/class-locator#locator-set-input-files) API.

#### Browser Versions

-   Chromium 101.0.4951.26
-   Mozilla Firefox 98.0.2
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 100
-   Microsoft Edge 100

### [`v1.20.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.20.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.20.1...v1.20.2)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/13078](https://togithub.com/microsoft/playwright/issues/13078) - \[BUG] Extension required when importing other files with type="module"[https://github.com/microsoft/playwright/issues/13099](https://togithub.com/microsoft/playwright/issues/13099)9 - \[BUG] beforeAll is called before each test (fullyParallel[https://github.com/microsoft/playwright/issues/13204](https://togithub.com/microsoft/playwright/issues/13204)04 - \[BUG] mask stalls the screenshot

#### Browser Versions

-   Chromium 101.0.4921.0
-   Mozilla Firefox 97.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 99
-   Microsoft Edge 99

### [`v1.20.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.20.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.20.0...v1.20.1)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/12711](https://togithub.com/microsoft/playwright/issues/12711) - \[REGRESSION] Page.screenshot hangs on some sites[https://github.com/microsoft/playwright/issues/12807](https://togithub.com/microsoft/playwright/issues/12807)7 - \[BUG] Cookies get assigned before fulfilling a respons[https://github.com/microsoft/playwright/issues/12814](https://togithub.com/microsoft/playwright/issues/12814)14 - \[Question] how to use expect.any in playwrig[https://github.com/microsoft/playwright/issues/12821](https://togithub.com/microsoft/playwright/issues/12821)821 - \[BUG] Chromium: Cannot click, element intercepts pointer eve[https://github.com/microsoft/playwright/issues/12836](https://togithub.com/microsoft/playwright/issues/12836)2836 - \[REGRESSION]: Tests not detected as ES module in v[https://github.com/microsoft/playwright/issues/12862](https://togithub.com/microsoft/playwright/issues/12862)12862 - \[Feature] Allow to use toMatchSnapshot for file formats other than txt (e.g.[https://github.com/microsoft/playwright/issues/12887](https://togithub.com/microsoft/playwright/issues/12887)/12887 - \[BUG] Locator.count() with \_vue selector wit[https://github.com/microsoft/playwright/issues/12940](https://togithub.com/microsoft/playwright/issues/12940)es/12940 - \[BUG] npm audit - High Severity vulnerability in json5 package forcing to install Playwrigh[https://github.com/microsoft/playwright/issues/12974](https://togithub.com/microsoft/playwright/issues/12974)ues/12974 - \[BUG] Regression - chromium browser closes during test or debugging session on macos

#### Browser Versions

-   Chromium 101.0.4921.0
-   Mozilla Firefox 97.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 99
-   Microsoft Edge 99

### [`v1.20.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.20.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.19.2...v1.20.0)

<a href="https://youtu.be/6vV-XXKsrbA">![release-1.20](https://user-images.githubusercontent.com/883973/169663565-0b99510a-cca2-44f6-8c49-60c9569eb0a5.jpg)</a> <a href="https://youtu.be/6vV-XXKsrbA">Playwright v1.20 updates</a>

#### Highlights

-   New options for methods [`page.screenshot()`](https://playwright.dev/docs/api/class-page#page-screenshot), [`locator.screenshot()`](https://playwright.dev/docs/api/class-locator#locator-screenshot) and [`elementHandle.screenshot()`](https://playwright.dev/docs/api/class-elementhandle#element-handle-screenshot):
    -   Option `animations: "disabled"` rewinds all CSS animations and transitions to a consistent state.
    -   Option `mask: Locator[]` masks given elements, overlaying them with pink `#FF00FF` boxes.

-   [`expect().toMatchSnapshot()`](https://playwright.dev/docs/test-assertions#screenshot-assertions-to-match-snapshot) now supports anonymous snapshots: when snapshot name is missing, Playwright Test will generate one
    automatically:

    ```js
    expect('Web is Awesome <3').toMatchSnapshot();
    ```

-   New `maxDiffPixels` and `maxDiffPixelRatio` options for fine-grained screenshot comparison using [`expect().toMatchSnapshot()`](https://playwright.dev/docs/test-assertions#screenshot-assertions-to-match-snapshot):

    ```js
    expect(await page.screenshot()).toMatchSnapshot({
      maxDiffPixels: 27, // allow no more than 27 different pixels.
    });
    ```

    It is most convenient to specify `maxDiffPixels` or `maxDiffPixelRatio` once in [`TestConfig.expect`](https://playwright.dev/docs/api/class-testconfig#test-config-expect).

-   Playwright Test now adds [`TestConfig.fullyParallel`](https://playwright.dev/docs/api/class-testconfig#test-config-fully-parallel) mode. By default, Playwright Test parallelizes between files. In fully parallel mode, tests inside a single file are also run in parallel. You can also use `--fully-parallel` command line flag.

    ```ts
    // playwright.config.ts
    export default {
      fullyParallel: true,
    };
    ```

-   [`TestProject.grep`](https://playwright.dev/docs/api/class-testproject#test-project-grep) and [`TestProject.grepInvert`](https://playwright.dev/docs/api/class-testproject#test-project-grep-invert) are now configurable per project. For example, you can now
    configure smoke tests project using `grep`:
    ```ts
    // playwright.config.ts
    export default {
      projects: [
        {
          name: 'smoke tests',
          grep: /@&#8203;smoke/,
        },
      ],
    };
    ```

-   [Trace Viewer](https://playwright.dev/docs/trace-viewer) now shows [API testing requests](https://playwright.dev/docs/test-api-testing).

-   [`locator.highlight()`](https://playwright.dev/docs/api/class-locator#locator-highlight) visually reveals element(s) for easier debugging.

#### Announcements

-   We now ship a designated Python docker image `mcr.microsoft.com/playwright/python`. Please switch over to it if you use Python. This is the last release that includes Python inside our javascript `mcr.microsoft.com/playwright` docker image.
-   v1.20 is the last release to receive WebKit update for macOS 10.15 Catalina. Please update MacOS to keep using latest & greatest WebKit!

#### Browser Versions

-   Chromium 101.0.4921.0
-   Mozilla Firefox 97.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 99
-   Microsoft Edge 99

### [`v1.19.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.19.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.19.1...v1.19.2)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/12091](https://togithub.com/microsoft/playwright/issues/12091) - \[BUG] playwright 1.19.0 generates more than 1 trace file per test[https://github.com/microsoft/playwright/issues/12106](https://togithub.com/microsoft/playwright/issues/12106)6 - \[BUG] Error: EBUSY: resource busy or locked when using volumes in docker-compose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0-focal

#### Browser Versions

-   Chromium 100.0.4863.0
-   Mozilla Firefox 96.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 98
-   Microsoft Edge 98

### [`v1.19.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.19.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.19.0...v1.19.1)

#### Highlights

This patch includes the following bug fixes:

[https://github.com/microsoft/playwright/issues/12075](https://togithub.com/microsoft/playwright/issues/12075) - \[Question] After update to 1.19 firefox fails to run[https://github.com/microsoft/playwright/issues/12090](https://togithub.com/microsoft/playwright/issues/12090)0 - \[BUG] did something change on APIRequest/Response APIs ?

#### Browser Versions

-   Chromium 100.0.4863.0
-   Mozilla Firefox 96.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 98
-   Microsoft Edge 98

### [`v1.19.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.19.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.18.1...v1.19.0)

<a href="https://youtu.be/z0EOFvlf14U">![release-1.19](https://user-images.githubusercontent.com/883973/169663681-d82de420-fd32-4280-9431-8deea1efd5f3.jpg)</a> <a href="https://youtu.be/z0EOFvlf14U">Playwright v1.19 updates</a>

##### Playwright Test Updates

##### Soft assertions

Playwright Test v1.19 now supports **soft assertions**. Failed soft assertions **do not** terminate test execution, but mark the test as failed. Read more in [our documentation](https://playwright.dev/docs/test-assertions#soft-assertions).

```js
// Make a few checks that will not stop the test when failed...
await expect.soft(page.locator('#status')).toHaveText('Success');
await expect.soft(page.locator('#eta')).toHaveText('1 day');

// ... and continue the test to check more things.
await page.locator('#next-page').click();
await expect.soft(page.locator('#title')).toHaveText('Make another order');
```

##### Custom error messages

You can now specify a [**custom error message**](https://playwright.dev/docs/test-assertions#custom-error-message) as a second argument to the `expect` and `expect.soft` functions, for example:

```js
await expect(page.locator('text=Name'), 'should be logged in').toBeVisible();
```

The error would look like this:

```bash
    Error: should be logged in

    Call log:
      - expect.toBeVisible with timeout 5000ms
      - waiting for selector "text=Name"

      2 |
      3 | test('example test', async({ page }) => {
    > 4 |   await expect(page.locator('text=Name'), 'should be logged in').toBeVisible();
        |                                                                  ^
      5 | });
      6 |
```

##### Parallel mode in file

By default, tests in a single file are run in order. If you have many independent tests in a single file, you can now
run them in parallel with [`method: test.describe.configure`](https://playwright.dev/docs/api/class-test#test-describe-configure):

```js
import { test } from '@&#8203;playwright/test';

test.describe.configure({ mode: 'parallel' });

test('parallel 1', async () => {});
test('parallel 2', async () => {});
```

##### [⚠️](https://emojipedia.org/warning/#:~:text=A%20triangle%20with%20an%20exclamation,to%20Emoji%201.0%20in%202015.) Potentially breaking change in Playwright Test Global Setup

It is unlikely that this change will affect you, no action is required if your tests keep running as they did.

We've noticed that in rare cases, the set of tests to be executed was configured in the global setup by means of the environment variables. We also noticed some applications that were post processing the reporters' output in the global teardown. If you are doing one of the two, [learn more](https://togithub.com/microsoft/playwright/issues/12018)

##### Locator Updates

##### Locator now supports a `has` option that makes sure it contains another locator inside:

```js
await page.locator('article', {
  has: page.locator('.highlight'),
}).locator('button').click();
```

The snippet above will select article that has highlight in it and will press the button in it.
Read more in [locator documentation](https://playwright.dev/docs/api/class-locator#locator-locator-option-has)

##### Other Updates

-   New [`method: Locator.page`](https://playwright.dev/docs/api/class-locator#locator-page)
-   [`method: Page.screenshot`](https://playwright.dev/docs/api/class-page#page-screenshot) and [`method: Locator.screenshot`](https://playwright.dev/docs/api/class-locator#locator-screenshot) now automatically hides blinking caret
-   Playwright Codegen now generates locators and frame locators
-   New option `url`  in [`testConfig.webServer`](https://playwright.dev/docs/api/class-testconfig#test-config-web-server) to ensure your web server is ready before running the tests
-   New [`property: TestInfo.errors`](https://playwright.dev/docs/api/class-testinfo#test-info-errors) and [`property: TestResult.errors`](https://playwright.dev/docs/api/class-testresult#test-result-errors) that contain all failed assertions and soft assertions.

#### Browser Versions

-   Chromium 100.0.4863.0
-   Mozilla Firefox 96.0.1
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 98
-   Microsoft Edge 98

***

### [`v1.18.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.18.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.18.0...v1.18.1)

#### Highlights

This patch includes improvements to the TypeScript support and the following bug fixes:

[https://github.com/microsoft/playwright/issues/11550](https://togithub.com/microsoft/playwright/issues/11550) - \[REGRESSION]: Errors inside route handler does not lead to unhandled rejections anymore[https://github.com/microsoft/playwright/issues/11552](https://togithub.com/microsoft/playwright/issues/11552)2 - \[BUG] Could not resolve "C:\repo\framework\utils" in file C:\repo\tests\test.ts.

#### Browser Versions

-   Chromium 99.0.4812.0
-   Mozilla Firefox 95.0
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 97
-   Microsoft Edge 97

### [`v1.18.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.18.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.17.2...v1.18.0)

<a href="https://youtu.be/ABLYpw2BN_g">![release-1.18](https://user-images.githubusercontent.com/883973/169663725-400d1b08-7278-4322-9d42-8e4ec1199a9a.jpg)</a> <a href="https://youtu.be/ABLYpw2BN_g">Playwright v1.18 updates</a>

#### Locator Improvements

-   [`locator.dragTo(locator)`][locator.dragTo(locator)]
-   [`expect(locator).toBeChecked({ checked })`][expect(locator).toBeChecked({ checked })]
-   Each locator can now be optionally filtered by the text it contains:
    ```js
    await page.locator('li', { hasText: 'my item' }).locator('button').click();
    ```
    Read more in [locator documentation].

#### Testing API improvements

-   [`expect(response).toBeOK()`][expect(response).toBeOK()]
-   [`testInfo.attach()`][testInfo.attach()]
-   [`test.info()`][test.info()]

#### Improved TypeScript Support

1.  Playwright Test now respects `tsconfig.json`'s [`baseUrl`](https://www.typescriptlang.org/tsconfig#baseUrl) and [`paths`](https://www.typescriptlang.org/tsconfig#paths), so you can use aliases
2.  There is a new environment variable `PW_EXPERIMENTAL_TS_ESM` that allows importing ESM modules in your TS code, without the need for the compile step. Don't forget the `.js` suffix when you are importing your esm modules. Run your tests as follows:

```bash
npm i --save-dev @&#8203;playwright/test@1.18.0
PW_EXPERIMENTAL_TS_ESM=1 npx playwright test
```

#### Create Playwright

The `npm init playwright` command is now generally available for your use:

```sh

### Run from your project's root directory
npm init playwright

### Or create a new project
npm init playwright new-project
```

This will scaffold everything needed to get started with Playwright Test: configuration file, optionally add examples, a GitHub Action workflow and a first test `example.spec.ts`.

#### New APIs & changes

-   new [`testCase.repeatEachIndex`][testCase.repeatEachIndex] API
-   [`acceptDownloads`][acceptDownloads] option now defaults to `true`

#### Breaking change: custom config options

Custom config options are a convenient way to parametrize projects with different values. Learn more in the [parametrization guide].

Previously, any fixture introduced through [`test.extend`][test.extend] could be overridden in the [`testProject.use`][testProject.use] config section. For example,

```js
// WRONG: THIS SNIPPET DOES NOT WORK SINCE v1.18.

// fixtures.js
const test = base.extend({
  myParameter: 'default',
});

// playwright.config.js
module.exports = {
  use: {
    myParameter: 'value',
  },
};
```

The proper way to make a fixture parametrized in the config file is to specify `option: true` when defining the fixture. For example,

```js
// CORRECT: THIS SNIPPET WORKS SINCE v1.18.

// fixtures.js
const test = base.extend({
  // Fixtures marked as "option: true" will get a value specified in the config,
  // or fallback to the default value.
  myParameter: ['default', { option: true }],
});

// playwright.config.js
module.exports = {
  use: {
    myParameter: 'value',
  },
};
```

#### Browser Versions

-   Chromium 99.0.4812.0
-   Mozilla Firefox 95.0
-   WebKit 15.4

This version was also tested against the following stable channels:

-   Google Chrome 97
-   Microsoft Edge 97

***

[`locator.dragTo(locator)`]: https://playwright.dev/docs/api/class-locator#locator-drag-to

[`expect(locator).toBeChecked({ checked })`]: https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-checked

[locator documentation]: https://playwright.dev/docs/api/class-locator#locator-locator-option-has-text

[`expect(response).toBeOK()`]: https://playwright.dev/docs/api/class-apiresponseassertions

[`testInfo.attach()`]: https://playwright.dev/docs/api/class-testinfo#test-info-attach

[`test.info()`]: https://playwright.dev/docs/api/class-test#test-info

[`testCase.repeatEachIndex`]: https://playwright.dev/docs/api/class-testcase#test-case-repeat-each-index

[parametrization guide]: https://playwright.dev/docs/test-parameterize#parameterized-projects

[`acceptDownloads`]: https://playwright.dev/docs/api/class-browser#browser-new-context-option-accept-downloads

[`test.extend`]: https://playwright.dev/docs/api/class-test#test-extend

[`testProject.use`]: https://playwright.dev/docs/api/class-testproject#test-project-use

(`1.18.0-beta-1642620709000`)

### [`v1.17.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.17.2)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.17.1...v1.17.2)

#### Bugfixes

[#&#8203;11274](https://togithub.com/Microsoft/playwright/issues/11274) - fix: pin colors to 1.4.0
[#&#8203;11228](https://togithub.com/Microsoft/playwright/issues/11228) - fix(click): don't fail on stale context while click

### [`v1.17.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.17.1)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.17.0...v1.17.1)

#### Highlights

This patch includes bug fixes for the following issues:

[https://github.com/microsoft/playwright/issues/10638](https://togithub.com/microsoft/playwright/issues/10638) - \[BUG] Locator.click -> subtree intercepts pointer events since version 1.17.0[https://github.com/microsoft/playwright/issues/10632](https://togithub.com/microsoft/playwright/issues/10632)2 - \[BUG] Playwright 1.17.0 -> After clicking the element - I get an error that click action was faile[https://github.com/microsoft/playwright/issues/10627](https://togithub.com/microsoft/playwright/issues/10627)27 - \[REGRESSION]: Can no longer click Material UI select b[https://github.com/microsoft/playwright/issues/10620](https://togithub.com/microsoft/playwright/issues/10620)620 - \[BUG] trailing zero width whitespace fails toHaveText

#### Browser Versions

-   Chromium 98.0.4695.0
-   Mozilla Firefox 94.0.1
-   WebKit 15.4

This version of Playwright was also tested against the following stable channels:

-   Google Chrome 96
-   Microsoft Edge 96

***

(1.17.1)

### [`v1.17.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.17.0)

[Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.16.3...v1.17.0)

<a href="https://youtu.be/7iyIdeoAP04">![release-1.17](https://user-images.githubusercontent.com/883973/169663759-f810a03f-6488-436a-835a-21d18bed8fb1.jpg)</a> <a href="https://youtu.be/7iyIdeoAP04">Playwright v1.17 updates</a>

#### Frame Locators

Playwright 1.17 introduces [frame locators] - a locator to the iframe on the page. Frame locators capture the logic sufficient to retrieve the `iframe` and then locate elements in that iframe. Frame locators are strict by default, will wait for `iframe` to appear and can be used in Web-First assertions.

![Graphics](https://user-images.githubusercontent.com/746130/142082759-2170db38-370d-43ec-8d41-5f9941f57d83.png)

Frame locators can be created with either [`page.frameLocator(selector)`][page.frameLocator(selector)] or [`locator.frameLocator(selector)`][locator.frameLocator(selector)] method.

```js
const locator = page.frameLocator('#my-iframe').locator('text=Submit');
await locator.click();
```

Read more at [our documentation](https://playwright.dev/docs/next/api/class-framelocator).

#### Trace Viewer Update

Playwright Trace Viewer is now **available online** at https://trace.playwright.dev! Just drag-and-drop your `trace.zip` file to inspect its contents.

> **NOTE**: trace files are not uploaded anywhere; [trace.playwright.dev](https://trace.playwright.dev) is a [progressive web application](https://web.dev/progressive-web-apps/) that processes traces locally.

-

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ttbud/ttbud).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMDIuNCIsInVwZGF0ZWRJblZlciI6IjM0LjUxLjAifQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants