Skip to content

Commit

Permalink
📦 deps: update playwright to v1.27.1 (#1814)
Browse files Browse the repository at this point in the history
[![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](https://playwright.dev) ([source](https://togithub.com/Microsoft/playwright)) | [`1.23.4` -> `1.27.1`](https://renovatebot.com/diffs/npm/playwright/1.23.4/1.27.1) | [![age](https://badges.renovateapi.com/packages/npm/playwright/1.27.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/playwright/1.27.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/playwright/1.27.1/compatibility-slim/1.23.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/playwright/1.27.1/confidence-slim/1.23.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

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

### [`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:

[microsoft/playwright#18010 - fix(generator): generate nice locators for arbitrary selectors
[microsoft/playwright#17999 - chore: don't fail on undefined video/trace
[microsoft/playwright#17955 - \[Question] Github Actions test compatibility check failed mitigation?[microsoft/playwright#17960 - \[BUG] Codegen 1.27 creates NUnit code that does not compil[microsoft/playwright#17952 - 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:

[microsoft/playwright#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:

[microsoft/playwright#16937 - \[REGRESSION]: session storage failing >= 1.25.0 in firefox[microsoft/playwright#16955 - 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:

[microsoft/playwright#16319 - \[BUG] webServer.command esbuild fails with ESM and Yarn[microsoft/playwright#16460 - \[BUG] Component test fails on 2nd run when SSL is use[microsoft/playwright#16665 - \[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:

[microsoft/playwright#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:

[microsoft/playwright#15898 - \[BUG] Typescript error: The type for webServer config property (TestConfigWebServer) is not typed correctly[microsoft/playwright#15913 - \[BUG] hooksConfig is required for mount fixtur[microsoft/playwright#15932 - \[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

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 2am" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **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.

---

 - [ ] If you want to rebase/retry this PR, click this checkbox.

---

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/roots/bud).
  • Loading branch information
renovate[bot] committed Oct 25, 2022
1 parent 7352375 commit 5fb6996
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -51,7 +51,7 @@
"jest": "29.0.3",
"json5": "2.2.1",
"lodash-es": "4.17.21",
"playwright": "1.23.4",
"playwright": "1.27.1",
"prettier": "2.7.1",
"syncpack": "8.2.4",
"tinybench": "2.1.5",
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Expand Up @@ -11284,7 +11284,7 @@ __metadata:
jest: 29.0.3
json5: 2.2.1
lodash-es: 4.17.21
playwright: 1.23.4
playwright: 1.27.1
prettier: 2.7.1
syncpack: 8.2.4
tinybench: 2.1.5
Expand Down Expand Up @@ -24807,23 +24807,23 @@ __metadata:
languageName: node
linkType: hard

"playwright-core@npm:1.23.4":
version: 1.23.4
resolution: "playwright-core@npm:1.23.4"
"playwright-core@npm:1.27.1":
version: 1.27.1
resolution: "playwright-core@npm:1.27.1"
bin:
playwright: cli.js
checksum: 347a40f2fbcc9ee896c5cf8d8211ffa7a200e22f154e879d9e829ee6bd365acc1c69c8b11a64a96a9d2fae9c85e859c995680be1a15b5e74c367ffa53425c9c9
checksum: fd65d3eb29978e0e7a755158625e8922a66ca9d599b7c24ddf920822b261d81c51a5964ef8e0e5ed9b2b12dc64541c5949b6a898d965e107f43261964e8c29a0
languageName: node
linkType: hard

"playwright@npm:1.23.4":
version: 1.23.4
resolution: "playwright@npm:1.23.4"
"playwright@npm:1.27.1":
version: 1.27.1
resolution: "playwright@npm:1.27.1"
dependencies:
playwright-core: 1.23.4
playwright-core: 1.27.1
bin:
playwright: cli.js
checksum: a646b08ceecba56b1bb69125e26dc487260fb1ccbb32e516451b0e85387e3118fd38d68d9c43abe8a81558be992cf86a2f652e926a534e8f42ca0a11dd626918
checksum: 7bb31998e1783f96443bd1a38f0d7838d1b6fd0cf410ac83ef480c0f0e3e930b809b7e42ccda35b9e272c84aaa8f15e0ee8bdddc19a60b224eecc57d285bf92f
languageName: node
linkType: hard

Expand Down

0 comments on commit 5fb6996

Please sign in to comment.