Martim GarciaNIF 2874754255º ano Cartão Municipal 8,73 € Saldo Escola 0,00 €
VG
Vicente GarciaNIF 306140632pré-escolar Cartão Municipal 18,71 € Saldo Escola 0,00 €
Início
+
+
diff --git a/inovar.js.save b/inovar.js.save
new file mode 100644
index 0000000..a16a5ca
--- /dev/null
+++ b/inovar.js.save
@@ -0,0 +1,65 @@
+const { chromium } = require('playwright');
+
+(async () => {
+ const browser = await chromium.launch({
+ headless: true
+ });
+
+ const page = await browser.newPage();
+
+ try {
+ console.log('1. A abrir Inovar Consulta...');
+
+ await page.goto(
+ 'https://aeericeira.inovarmais.com/consulta/app/index.html#/login',
+ {
+ waitUntil: 'domcontentloaded',
+ timeout: 60000
+ }
+ );
+
+ console.log('2. A preencher credenciais...');
+
+ await page.locator('input[type="text"]').fill(
+ process.env.INOVAR_USER
+ );
+
+ await page.locator('input[type="password"]').fill(
+ process.env.INOVAR_PASSWORD
+ );
+
+ console.log('3. A efetuar login...');
+
+ await page.getByRole('button', {
+ name: 'Entrar',
+ exact: true
+ }).click();
+
+ await page.waitForTimeout(8000);
+
+ console.log('\nURL FINAL:');
+ console.log(page.url());
+
+ console.log('\nTÍTULO:');
+ console.log(await page.title());
+
+ console.log('\nTEXTO DA PÁGINA:');
+ console.log(
+ (await page.locator('body').innerText()).slice(0, 4000)
+ );
+
+ await page.screenshot({
+ path: '/app/inovar-dashboard.png',
+ fullPage: true
+ });
+
+ console.log('\nScreenshot guardado: inovar-dashboard.png');
+
+ } catch (erro) {
+ console.error('\nERRO:', erro.message);
+ process.exitCode = 1;
+ } finally {
+ await browser.close();
+ }
+})();
+
diff --git a/login.js b/login.js
new file mode 100644
index 0000000..5793912
--- /dev/null
+++ b/login.js
@@ -0,0 +1,112 @@
+const { chromium } = require('playwright');
+const fs = require('fs');
+
+(async () => {
+
+ const browser = await chromium.launch({
+ headless: true
+ });
+
+ const page = await browser.newPage();
+
+ try {
+
+ console.log('1. A abrir SIGA...');
+
+ await page.goto('https://siga.edubox.pt/', {
+ waitUntil: 'networkidle',
+ timeout: 60000
+ });
+
+ console.log('2. Login...');
+
+ await page.locator('#ion-input-0').fill(process.env.SIGA_USER);
+ await page.locator('#ion-input-1').fill(process.env.SIGA_PASSWORD);
+
+ await page.locator('#ion-input-1').press('Enter');
+
+ console.log('3. A aguardar dashboard...');
+
+ await page.waitForURL('**/webapp/dashboard', {
+ timeout: 60000
+ });
+
+ await page.locator('custom-avatar-card').first().waitFor({
+ state: 'visible',
+ timeout: 30000
+ });
+
+ console.log('4. A obter saldos...');
+
+ const alunos = await page.locator('custom-avatar-card').evaluateAll(cards => {
+
+ return cards.map(card => {
+
+ const nome =
+ card.querySelector('.user-name')
+ ?.textContent
+ ?.trim();
+
+ const saldoTexto =
+ card.querySelector(
+ '.municipio-saldo .saldo-value ion-badge'
+ )
+ ?.textContent
+ ?.trim();
+
+ const saldo = saldoTexto
+ ? parseFloat(
+ saldoTexto
+ .replace('€', '')
+ .replace(/\s/g, '')
+ .replace(',', '.')
+ )
+ : null;
+
+ return {
+ nome,
+ saldo
+ };
+
+ }).filter(a => a.nome);
+
+ });
+
+ const agora = new Date();
+
+ const resultado = {
+ atualizado: agora.toISOString(),
+ alunos
+ };
+
+ fs.writeFileSync(
+ '/app/siga-saldos.json',
+ JSON.stringify(resultado, null, 2),
+ 'utf8'
+ );
+
+ console.log('\n========== SALDOS ==========');
+
+ alunos.forEach(aluno => {
+ console.log(
+ `${aluno.nome}: ${aluno.saldo?.toFixed(2)} €`
+ );
+ });
+
+ console.log('============================');
+
+ console.log('\nJSON criado:');
+ console.log('/app/siga-saldos.json');
+
+ } catch (error) {
+
+ console.error('\nERRO:', error.message);
+ process.exitCode = 1;
+
+ } finally {
+
+ await browser.close();
+
+ }
+
+})();
diff --git a/node_modules/playwright/LICENSE b/node_modules/playwright/LICENSE
new file mode 100644
index 0000000..4ace03d
--- /dev/null
+++ b/node_modules/playwright/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Portions Copyright (c) Microsoft Corporation.
+ Portions Copyright 2017 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/node_modules/playwright/NOTICE b/node_modules/playwright/NOTICE
new file mode 100644
index 0000000..814ec16
--- /dev/null
+++ b/node_modules/playwright/NOTICE
@@ -0,0 +1,5 @@
+Playwright
+Copyright (c) Microsoft Corporation
+
+This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
+available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
diff --git a/node_modules/playwright/README.md b/node_modules/playwright/README.md
new file mode 100644
index 0000000..6705c32
--- /dev/null
+++ b/node_modules/playwright/README.md
@@ -0,0 +1,318 @@
+# 🎭 Playwright
+
+[](https://www.npmjs.com/package/playwright) [](https://www.chromium.org/Home) [](https://www.mozilla.org/en-US/firefox/new/) [](https://webkit.org/) [](https://aka.ms/playwright/discord)
+
+## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright)
+
+Playwright is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents.
+
+## Get Started
+
+Choose the path that fits your workflow:
+
+| | Best for | Install |
+|---|---|---|
+| **[Playwright Test](#playwright-test)** | End-to-end testing | `npm init playwright@latest` |
+| **[Playwright CLI](#playwright-cli)** | Coding agents (Claude Code, Copilot) | `npm i -g @playwright/cli@latest` |
+| **[Playwright MCP](#playwright-mcp)** | AI agents and LLM-driven automation | `npx @playwright/mcp@latest` |
+| **[Playwright Library](#playwright-library)** | Browser automation scripts | `npm i playwright` |
+| **[VS Code Extension](#vs-code-extension)** | Test authoring and debugging in VS Code | [Install from Marketplace](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) |
+
+---
+
+## Playwright Test
+
+Playwright Test is a full-featured test runner built for end-to-end testing. It runs tests across Chromium, Firefox, and WebKit with full browser isolation, auto-waiting, and web-first assertions.
+
+### Install
+
+```bash
+npm init playwright@latest
+```
+
+Or add manually:
+
+```bash
+npm i -D @playwright/test
+npx playwright install
+```
+
+### Write a test
+
+```TypeScript
+import { test, expect } from '@playwright/test';
+
+test('has title', async ({ page }) => {
+ await page.goto('https://playwright.dev/');
+ await expect(page).toHaveTitle(/Playwright/);
+});
+
+test('get started link', async ({ page }) => {
+ await page.goto('https://playwright.dev/');
+ await page.getByRole('link', { name: 'Get started' }).click();
+ await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
+});
+```
+
+### Run tests
+
+```bash
+npx playwright test
+```
+
+Tests run in parallel across all configured browsers, in headless mode by default. Each test gets a fresh browser context — full isolation with near-zero overhead.
+
+### Key capabilities
+
+**Auto-wait and web-first assertions.** No artificial timeouts. Playwright waits for elements to be actionable, and assertions automatically retry until conditions are met.
+
+**Locators.** Find elements with resilient locators that mirror how users see the page:
+
+```TypeScript
+page.getByRole('button', { name: 'Submit' })
+page.getByLabel('Email')
+page.getByPlaceholder('Search...')
+page.getByTestId('login-form')
+```
+
+**Test isolation.** Each test runs in its own browser context — equivalent to a fresh browser profile. Save authentication state once and reuse it across tests:
+
+```TypeScript
+// Save state after login
+await page.context().storageState({ path: 'auth.json' });
+
+// Reuse in other tests
+test.use({ storageState: 'auth.json' });
+```
+
+**Tracing.** Capture execution traces, screenshots, and videos on failure. Inspect every action, DOM snapshot, network request, and console message in the [Trace Viewer](https://playwright.dev/docs/trace-viewer):
+
+```TypeScript
+// playwright.config.ts
+export default defineConfig({
+ use: {
+ trace: 'on-first-retry',
+ },
+});
+```
+
+```bash
+npx playwright show-trace trace.zip
+```
+
+
+
+**Parallelism.** Tests run in parallel by default across all configured browsers.
+
+[Full testing documentation](https://playwright.dev/docs/intro)
+
+---
+
+## Playwright CLI
+
+[Playwright CLI](https://github.com/microsoft/playwright-cli) is a command-line interface for browser automation designed for coding agents. It's more token-efficient than MCP — commands avoid loading large tool schemas and accessibility trees into the model context.
+
+### Install
+
+```bash
+npm install -g @playwright/cli@latest
+```
+
+Optionally install skills for richer agent integration:
+
+```bash
+playwright-cli install --skills
+```
+
+### Usage
+
+Point your coding agent at a task:
+
+```
+Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
+Take screenshots for all successful and failing scenarios.
+```
+
+Or run commands directly:
+
+```bash
+playwright-cli open https://demo.playwright.dev/todomvc/ --headed
+playwright-cli type "Buy groceries"
+playwright-cli press Enter
+playwright-cli screenshot
+```
+
+### Session monitoring
+
+Use `playwright-cli show` to open a visual dashboard with live screencast previews of all running browser sessions. Click any session to zoom in and take remote control.
+
+```bash
+playwright-cli show
+```
+
+
+
+[Full CLI documentation](https://playwright.dev/agent-cli/introduction) | [GitHub](https://github.com/microsoft/playwright-cli)
+
+---
+
+## Playwright MCP
+
+The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) gives AI agents full browser control through the [Model Context Protocol](https://modelcontextprotocol.io). Agents interact with pages using structured accessibility snapshots — no vision models or screenshots required.
+
+### Setup
+
+Add to your MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.):
+
+```json
+{
+ "mcpServers": {
+ "playwright": {
+ "command": "npx",
+ "args": ["@playwright/mcp@latest"]
+ }
+ }
+}
+```
+
+**One-click install for VS Code:**
+
+[](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)
+
+**For Claude Code:**
+
+```bash
+claude mcp add playwright npx @playwright/mcp@latest
+```
+
+### How it works
+
+Ask your AI assistant to interact with any web page:
+
+```
+Navigate to https://demo.playwright.dev/todomvc and add a few todo items.
+```
+
+The agent sees the page as a structured accessibility tree:
+
+```
+- heading "todos" [level=1]
+- textbox "What needs to be done?" [ref=e5]
+- listitem:
+ - checkbox "Toggle Todo" [ref=e10]
+ - text: "Buy groceries"
+```
+
+It uses element refs like `e5` and `e10` to click, type, and interact — deterministically and without visual ambiguity. Tools cover navigation, form filling, screenshots, network mocking, storage management, and more.
+
+[Full MCP documentation](https://playwright.dev/mcp/introduction) | [GitHub](https://github.com/microsoft/playwright-mcp)
+
+---
+
+## Playwright Library
+
+Use `playwright` as a library for browser automation scripts — web scraping, PDF generation, screenshot capture, and any workflow that needs programmatic browser control without a test runner.
+
+### Install
+
+```bash
+npm i playwright
+```
+
+### Examples
+
+**Take a screenshot:**
+
+```TypeScript
+import { chromium } from 'playwright';
+
+const browser = await chromium.launch();
+const page = await browser.newPage();
+await page.goto('https://playwright.dev/');
+await page.screenshot({ path: 'screenshot.png' });
+await browser.close();
+```
+
+**Generate a PDF:**
+
+```TypeScript
+import { chromium } from 'playwright';
+
+const browser = await chromium.launch();
+const page = await browser.newPage();
+await page.goto('https://playwright.dev/');
+await page.pdf({ path: 'page.pdf', format: 'A4' });
+await browser.close();
+```
+
+**Emulate a mobile device:**
+
+```TypeScript
+import { chromium, devices } from 'playwright';
+
+const browser = await chromium.launch();
+const context = await browser.newContext(devices['iPhone 15']);
+const page = await context.newPage();
+await page.goto('https://playwright.dev/');
+await page.screenshot({ path: 'mobile.png' });
+await browser.close();
+```
+
+**Intercept network requests:**
+
+```TypeScript
+import { chromium } from 'playwright';
+
+const browser = await chromium.launch();
+const page = await browser.newPage();
+await page.route('**/*.{png,jpg,jpeg}', route => route.abort());
+await page.goto('https://playwright.dev/');
+await browser.close();
+```
+
+[Library documentation](https://playwright.dev/docs/library) | [API reference](https://playwright.dev/docs/api/class-playwright)
+
+---
+
+## VS Code Extension
+
+The [Playwright VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) brings test running, debugging, and code generation directly into your editor.
+
+
+
+**Run and debug tests** from the editor with a single click. Set breakpoints, inspect variables, and step through test execution with a live browser view.
+
+**Generate tests with CodeGen.** Click "Record new" to open a browser — navigate and interact with your app while Playwright writes the test code for you.
+
+**Pick locators.** Hover over any element in the browser to see the best available locator, then click to copy it to your clipboard.
+
+**Trace Viewer integration.** Enable "Show Trace Viewer" in the sidebar to get a full execution trace after each test run — DOM snapshots, network requests, console logs, and screenshots at every step.
+
+[Install the extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) | [VS Code guide](https://playwright.dev/docs/getting-started-vscode)
+
+---
+
+## Cross-Browser Support
+
+| | Linux | macOS | Windows |
+| :--- | :---: | :---: | :---: |
+| Chromium1 153.0.8010.12 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
+| WebKit 26.6 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
+| Firefox 155.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
+
+Headless and headed execution on all platforms. 1 Uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing) by default.
+
+## Other Languages
+
+Playwright is also available for [Python](https://playwright.dev/python/docs/intro), [.NET](https://playwright.dev/dotnet/docs/intro), and [Java](https://playwright.dev/java/docs/intro).
+
+## Resources
+
+* [Documentation](https://playwright.dev)
+* [API reference](https://playwright.dev/docs/api/class-playwright)
+* [MCP server](https://github.com/microsoft/playwright-mcp)
+* [CLI for coding agents](https://github.com/microsoft/playwright-cli)
+* [VS Code extension](https://github.com/microsoft/playwright-vscode)
+* [Contribution guide](CONTRIBUTING.md)
+* [Changelog](https://github.com/microsoft/playwright/releases)
+* [Discord](https://aka.ms/playwright/discord)
diff --git a/node_modules/playwright/ThirdPartyNotices.txt b/node_modules/playwright/ThirdPartyNotices.txt
new file mode 100644
index 0000000..f9ee0a5
--- /dev/null
+++ b/node_modules/playwright/ThirdPartyNotices.txt
@@ -0,0 +1,14 @@
+microsoft/playwright
+
+THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
+
+This package bundles third-party software inside individual files under
+`lib/`. Each bundled output has a sidecar `.js.LICENSE` file next
+to it listing every npm package whose source was inlined into that
+bundle, together with the full license text for each.
+
+For example:
+- lib/common/index.js.LICENSE
+- lib/matchers/expect.js.LICENSE
+
+This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
diff --git a/node_modules/playwright/index.d.ts b/node_modules/playwright/index.d.ts
new file mode 100644
index 0000000..e2add35
--- /dev/null
+++ b/node_modules/playwright/index.d.ts
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export * from 'playwright-core';
diff --git a/node_modules/playwright/index.js b/node_modules/playwright/index.js
new file mode 100644
index 0000000..e263df6
--- /dev/null
+++ b/node_modules/playwright/index.js
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+module.exports = require('playwright-core');
diff --git a/node_modules/playwright/index.mjs b/node_modules/playwright/index.mjs
new file mode 100644
index 0000000..c736e9d
--- /dev/null
+++ b/node_modules/playwright/index.mjs
@@ -0,0 +1,18 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export * from 'playwright-core';
+import playwright from 'playwright-core';
+export default playwright;
diff --git a/node_modules/playwright/jsx-runtime.js b/node_modules/playwright/jsx-runtime.js
new file mode 100644
index 0000000..ff3d79e
--- /dev/null
+++ b/node_modules/playwright/jsx-runtime.js
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+function jsx(type, props, key) {
+ return {
+ __pw_type: 'jsx',
+ type,
+ props,
+ key,
+ };
+}
+
+function jsxs(type, props, key) {
+ return {
+ __pw_type: 'jsx',
+ type,
+ props,
+ key,
+ };
+}
+
+// this is used in <>> notation
+const Fragment = { __pw_jsx_fragment: true };
+
+module.exports = {
+ Fragment,
+ jsx,
+ jsxs,
+};
diff --git a/node_modules/playwright/jsx-runtime.mjs b/node_modules/playwright/jsx-runtime.mjs
new file mode 100644
index 0000000..1dfd583
--- /dev/null
+++ b/node_modules/playwright/jsx-runtime.mjs
@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import jsxRuntime from './jsx-runtime.js';
+
+export const jsx = jsxRuntime.jsx;
+export const jsxs = jsxRuntime.jsxs;
+export const Fragment = jsxRuntime.Fragment;
diff --git a/node_modules/playwright/lib/cli/reportActions.js b/node_modules/playwright/lib/cli/reportActions.js
new file mode 100644
index 0000000..5c752ba
--- /dev/null
+++ b/node_modules/playwright/lib/cli/reportActions.js
@@ -0,0 +1,78 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var reportActions_exports = {};
+__export(reportActions_exports, {
+ mergeReports: () => mergeReports,
+ showReport: () => showReport
+});
+module.exports = __toCommonJS(reportActions_exports);
+var import_fs = __toESM(require("fs"));
+var import_path = __toESM(require("path"));
+var import_common = require("../common");
+var import_runner = require("../runner");
+const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
+async function showReport(report, host, port) {
+ await import_runner.html.showHTMLReport(report, host, port);
+}
+async function mergeReports(reportDir, opts) {
+ const configFile = opts.config;
+ const config = configFile ? await import_common.configLoader.loadConfigFromFile(configFile) : await import_common.configLoader.loadEmptyConfigForMergeReports();
+ const dir = import_path.default.resolve(process.cwd(), reportDir || "");
+ const dirStat = await import_fs.default.promises.stat(dir).catch((e) => null);
+ if (!dirStat)
+ throw new Error("Directory does not exist: " + dir);
+ if (!dirStat.isDirectory())
+ throw new Error(`"${dir}" is not a directory`);
+ let reporterDescriptions = resolveReporterOption(opts.reporter);
+ if (!reporterDescriptions && configFile)
+ reporterDescriptions = config.config.reporter;
+ if (!reporterDescriptions)
+ reporterDescriptions = [[import_common.config.defaultReporter]];
+ const rootDirOverride = configFile ? config.config.rootDir : void 0;
+ const result = await import_runner.merge.createMergedReport(config, dir, reporterDescriptions, rootDirOverride);
+ gracefullyProcessExitDoNotHang(result === "failed" ? 1 : 0);
+}
+function resolveReporterOption(reporter) {
+ if (!reporter || !reporter.length)
+ return void 0;
+ return reporter.split(",").map((r) => [resolveReporter(r)]);
+}
+function resolveReporter(id) {
+ if (import_common.builtInReporters.includes(id))
+ return id;
+ const localPath = import_path.default.resolve(process.cwd(), id);
+ if (import_fs.default.existsSync(localPath))
+ return localPath;
+ return require.resolve(id, { paths: [process.cwd()] });
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ mergeReports,
+ showReport
+});
diff --git a/node_modules/playwright/lib/cli/testActions.js b/node_modules/playwright/lib/cli/testActions.js
new file mode 100644
index 0000000..1cea8f6
--- /dev/null
+++ b/node_modules/playwright/lib/cli/testActions.js
@@ -0,0 +1,214 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var testActions_exports = {};
+__export(testActions_exports, {
+ clearCache: () => clearCache,
+ runTestServerAction: () => runTestServerAction,
+ runTests: () => runTests
+});
+module.exports = __toCommonJS(testActions_exports);
+var import_fs = __toESM(require("fs"));
+var import_path = __toESM(require("path"));
+var import_common = require("../common");
+var import_runner = require("../runner");
+const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
+const { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundle").utils;
+async function runTests(args, opts) {
+ await startProfiling();
+ const cliOverrides = overridesFromOptions(opts);
+ cliOverrides.argv = process.argv;
+ const config = await import_common.configLoader.loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);
+ const options = {
+ locations: args.length ? args : void 0,
+ grep: opts.grep,
+ grepInvert: opts.grepInvert,
+ onlyChanged: opts.onlyChanged === true ? "HEAD" : opts.onlyChanged,
+ listMode: !!opts.list,
+ projectFilter: opts.project || void 0,
+ passWithNoTests: !!opts.passWithNoTests,
+ lastFailed: !!opts.lastFailed,
+ lastFailedFile: opts.lastFailedFile,
+ testList: opts.testList ? import_path.default.resolve(process.cwd(), opts.testList) : void 0,
+ testListInvert: opts.testListInvert ? import_path.default.resolve(process.cwd(), opts.testListInvert) : void 0,
+ shardWeights: resolveShardWeightsOption()
+ };
+ import_runner.projectUtils.filterProjects(config.projects, options.projectFilter);
+ if (opts.ui || opts.uiHost || opts.uiPort) {
+ if (opts.onlyChanged)
+ throw new Error(`--only-changed is not supported in UI mode. If you'd like that to change, see https://github.com/microsoft/playwright/issues/15075 for more details.`);
+ const status2 = await import_runner.testServer.runUIMode(opts.config, cliOverrides, {
+ host: opts.uiHost,
+ port: opts.uiPort ? +opts.uiPort : void 0,
+ args,
+ grep: opts.grep,
+ grepInvert: opts.grepInvert,
+ project: opts.project || void 0,
+ reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : void 0
+ });
+ await stopProfiling("runner");
+ const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
+ gracefullyProcessExitDoNotHang(exitCode2);
+ return;
+ }
+ if (process.env.PWTEST_WATCH) {
+ if (opts.onlyChanged)
+ throw new Error(`--only-changed is not supported in watch mode. If you'd like that to change, file an issue and let us know about your usecase for it.`);
+ const status2 = await import_runner.watchMode.runWatchModeLoop(
+ import_common.configLoader.resolveConfigLocation(opts.config),
+ {
+ projects: opts.project,
+ files: args,
+ grep: opts.grep
+ }
+ );
+ await stopProfiling("runner");
+ const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
+ gracefullyProcessExitDoNotHang(exitCode2);
+ return;
+ }
+ const status = await import_runner.testRunner.runAllTestsWithConfig(config, options);
+ await stopProfiling("runner");
+ const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
+ gracefullyProcessExitDoNotHang(exitCode);
+}
+async function runTestServerAction(opts) {
+ const host = opts.host;
+ const port = opts.port ? +opts.port : void 0;
+ const status = await import_runner.testServer.runTestServer(opts.config, {}, { host, port });
+ const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
+ gracefullyProcessExitDoNotHang(exitCode);
+}
+async function clearCache(opts) {
+ const runner = new import_runner.testRunner.TestRunner(import_common.configLoader.resolveConfigLocation(opts.config), {});
+ const { status } = await runner.clearCache(import_runner.runnerReporters.createErrorCollectingReporter(import_runner.base.terminalScreen));
+ const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
+ gracefullyProcessExitDoNotHang(exitCode);
+}
+function overridesFromOptions(options) {
+ if (options.ui) {
+ options.debug = void 0;
+ options.trace = void 0;
+ }
+ const overrides = {
+ debug: options.debug,
+ failOnFlakyTests: options.failOnFlakyTests ? true : void 0,
+ forbidOnly: options.forbidOnly ? true : void 0,
+ fullyParallel: options.fullyParallel ? true : void 0,
+ globalTimeout: options.globalTimeout ? parseInt(options.globalTimeout, 10) : void 0,
+ maxFailures: options.x ? 1 : options.maxFailures ? parseInt(options.maxFailures, 10) : void 0,
+ outputDir: options.output ? import_path.default.resolve(process.cwd(), options.output) : void 0,
+ pause: !!process.env.PWPAUSE,
+ quiet: options.quiet ? options.quiet : void 0,
+ repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : void 0,
+ retries: options.retries ? parseInt(options.retries, 10) : void 0,
+ reporter: resolveReporterOption(options.reporter),
+ additionalReporters: resolveReporterOption(options.addReporter),
+ shard: resolveShardOption(options.shard),
+ timeout: options.timeout ? parseInt(options.timeout, 10) : void 0,
+ tsconfig: options.tsconfig ? import_path.default.resolve(process.cwd(), options.tsconfig) : void 0,
+ ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : void 0,
+ updateSnapshots: options.updateSnapshots,
+ updateSourceMethod: options.updateSourceMethod,
+ use: {
+ trace: options.trace
+ },
+ workers: options.workers
+ };
+ if (options.browser) {
+ const browserOpt = options.browser.toLowerCase();
+ if (!["all", "chromium", "firefox", "webkit"].includes(browserOpt))
+ throw new Error(`Unsupported browser "${options.browser}", must be one of "all", "chromium", "firefox" or "webkit"`);
+ const browserNames = browserOpt === "all" ? ["chromium", "firefox", "webkit"] : [browserOpt];
+ overrides.projects = browserNames.map((browserName) => {
+ return {
+ name: browserName,
+ use: { browserName }
+ };
+ });
+ }
+ if (options.headed)
+ overrides.use.headless = false;
+ if (options.debug === "inspector") {
+ overrides.use.headless = false;
+ process.env.PWDEBUG = "1";
+ }
+ if (overrides.tsconfig && !import_fs.default.existsSync(overrides.tsconfig))
+ throw new Error(`--tsconfig "${options.tsconfig}" does not exist`);
+ return overrides;
+}
+function resolveReporterOption(reporter) {
+ if (!reporter || !reporter.length)
+ return void 0;
+ return reporter.split(",").map((r) => [resolveReporter(r)]);
+}
+function resolveShardOption(shard) {
+ if (!shard)
+ return void 0;
+ const shardPair = shard.split("/");
+ if (shardPair.length !== 2) {
+ throw new Error(
+ `--shard "${shard}", expected format is "current/all", 1-based, for example "3/5".`
+ );
+ }
+ const current = parseInt(shardPair[0], 10);
+ const total = parseInt(shardPair[1], 10);
+ if (isNaN(total) || total < 1)
+ throw new Error(`--shard "${shard}" total must be a positive number`);
+ if (isNaN(current) || current < 1 || current > total) {
+ throw new Error(
+ `--shard "${shard}" current must be a positive number, not greater than shard total`
+ );
+ }
+ return { current, total };
+}
+function resolveShardWeightsOption() {
+ const shardWeights = process.env.PWTEST_SHARD_WEIGHTS;
+ if (!shardWeights)
+ return void 0;
+ return shardWeights.split(":").map((w) => {
+ const weight = parseInt(w, 10);
+ if (isNaN(weight) || weight < 0)
+ throw new Error(`PWTEST_SHARD_WEIGHTS="${shardWeights}" weights must be non-negative numbers`);
+ return weight;
+ });
+}
+function resolveReporter(id) {
+ if (import_common.builtInReporters.includes(id))
+ return id;
+ const localPath = import_path.default.resolve(process.cwd(), id);
+ if (import_fs.default.existsSync(localPath))
+ return localPath;
+ return require.resolve(id, { paths: [process.cwd()] });
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ clearCache,
+ runTestServerAction,
+ runTests
+});
diff --git a/node_modules/playwright/lib/globals.js b/node_modules/playwright/lib/globals.js
new file mode 100644
index 0000000..83e7478
--- /dev/null
+++ b/node_modules/playwright/lib/globals.js
@@ -0,0 +1,58 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var globals_exports = {};
+__export(globals_exports, {
+ currentTestInfo: () => currentTestInfo,
+ currentlyLoadingFileSuite: () => currentlyLoadingFileSuite,
+ isWorkerProcess: () => isWorkerProcess,
+ setCurrentTestInfo: () => setCurrentTestInfo,
+ setCurrentlyLoadingFileSuite: () => setCurrentlyLoadingFileSuite,
+ setIsWorkerProcess: () => setIsWorkerProcess
+});
+module.exports = __toCommonJS(globals_exports);
+let currentTestInfoValue = null;
+function setCurrentTestInfo(testInfo) {
+ currentTestInfoValue = testInfo;
+}
+function currentTestInfo() {
+ return currentTestInfoValue;
+}
+let currentFileSuite;
+function setCurrentlyLoadingFileSuite(suite) {
+ currentFileSuite = suite;
+}
+function currentlyLoadingFileSuite() {
+ return currentFileSuite;
+}
+let _isWorkerProcess = false;
+function setIsWorkerProcess() {
+ _isWorkerProcess = true;
+}
+function isWorkerProcess() {
+ return _isWorkerProcess;
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ currentTestInfo,
+ currentlyLoadingFileSuite,
+ isWorkerProcess,
+ setCurrentTestInfo,
+ setCurrentlyLoadingFileSuite,
+ setIsWorkerProcess
+});
diff --git a/node_modules/playwright/lib/index.js b/node_modules/playwright/lib/index.js
new file mode 100644
index 0000000..119806b
--- /dev/null
+++ b/node_modules/playwright/lib/index.js
@@ -0,0 +1,815 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var index_exports = {};
+__export(index_exports, {
+ _baseTest: () => _baseTest,
+ _utilityTest: () => _utilityTest,
+ defineConfig: () => import_common2.defineConfig,
+ expect: () => import_expect.expect,
+ mergeExpects: () => import_expect2.mergeExpects,
+ mergeTests: () => import_common2.mergeTests,
+ test: () => test
+});
+module.exports = __toCommonJS(index_exports);
+var import_fs = __toESM(require("fs"));
+var import_path = __toESM(require("path"));
+var playwrightLibrary = __toESM(require("playwright-core"));
+var import_errorContext = require("./errorContext");
+var import_common = require("./common");
+var globals = __toESM(require("./globals"));
+var import_browserBackend = require("./mcp/test/browserBackend");
+var import_expect = require("./matchers/expect");
+var import_common2 = require("./common");
+var import_expect2 = require("./matchers/expect");
+const { getActionGroup, renderParamsForCall, renderSubtitleForCall, renderTitleForCall, truncateParam } = require("playwright-core/lib/coreBundle").iso;
+const { escapeHTML } = require("playwright-core/lib/coreBundle").iso;
+const { jsonStringifyForceASCII } = require("playwright-core/lib/coreBundle").utils;
+const { createGuid } = require("playwright-core/lib/coreBundle").utils;
+const { debugMode } = require("playwright-core/lib/coreBundle").utils;
+const { debugLogger } = require("playwright-core/lib/coreBundle").utils;
+const { currentZone } = require("playwright-core/lib/coreBundle").utils;
+const _baseTest = import_common.testType.rootTestType.test;
+if (process["__pw_initiator__"]) {
+ const originalStackTraceLimit = Error.stackTraceLimit;
+ Error.stackTraceLimit = 200;
+ try {
+ throw new Error("Requiring @playwright/test second time, \nFirst:\n" + process["__pw_initiator__"] + "\n\nSecond: ");
+ } finally {
+ Error.stackTraceLimit = originalStackTraceLimit;
+ }
+} else {
+ process["__pw_initiator__"] = new Error().stack;
+}
+const utilityFixtures = {
+ playwright: [async ({}, use) => {
+ await use(require("playwright-core"));
+ }, { scope: "worker", box: true }],
+ screenshot: ["off", { scope: "worker", option: true, box: true }],
+ trace: ["off", { scope: "worker", option: true, box: true }],
+ testIdAttribute: ["data-testid", { option: true, box: true }],
+ _combinedContextOptions: [{}, { box: true }],
+ _setupArtifacts: [async ({ playwright, screenshot, _combinedContextOptions }, use, testInfo) => {
+ testInfo.setTimeout(testInfo.project.timeout);
+ const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);
+ await artifactsRecorder.willStartTest(testInfo);
+ const tracingGroupSteps = [];
+ const pausedContexts = /* @__PURE__ */ new Set();
+ const csiListener = {
+ onApiCallBegin: (data, channel) => {
+ const testInfo2 = globals.currentTestInfo();
+ if (!testInfo2)
+ return;
+ if (channel.type === "Tracing" && channel.method === "tracingGroupEnd") {
+ data.userData = (error) => tracingGroupSteps.pop()?.complete({ error });
+ return;
+ }
+ const zone = currentZone().data("stepZone");
+ const isExpectCall = channel.type === "Frame" && channel.method === "expect" || channel.type === "Page" && channel.method === "expectScreenshot";
+ if (zone && zone.category === "expect" && isExpectCall) {
+ data.stepId = zone.stepId;
+ return;
+ }
+ const params = renderParamsForCall({ type: channel.type, method: channel.method, params: channel.params });
+ const step = testInfo2._addStep({
+ location: data.frames[0],
+ category: "pw:api",
+ title: renderTitle(channel.type, channel.method, channel.params, data.title),
+ subtitle: renderSubtitle(channel.type, channel.method, channel.params),
+ params,
+ group: getActionGroup({ type: channel.type, method: channel.method })
+ }, tracingGroupSteps[tracingGroupSteps.length - 1]);
+ data.stepId = step.stepId;
+ if (channel.type === "Tracing" && channel.method === "tracingGroup") {
+ tracingGroupSteps.push(step);
+ } else {
+ data.userData = (error) => step.complete({ error });
+ }
+ },
+ onApiCallEnd: (data) => {
+ const completeStep = data.userData;
+ completeStep?.(data.error);
+ },
+ onWillPause: ({ keepTestTimeout }) => {
+ if (!keepTestTimeout)
+ globals.currentTestInfo()?._setIgnoreTimeouts(true);
+ },
+ runBeforeCreateBrowserContext: async (options) => {
+ for (const [key, value] of Object.entries(_combinedContextOptions)) {
+ if (!(key in options))
+ options[key] = value;
+ }
+ },
+ runBeforeCreateRequestContext: async (options) => {
+ for (const [key, value] of Object.entries(_combinedContextOptions)) {
+ if (!(key in options))
+ options[key] = value;
+ }
+ },
+ runAfterCreateBrowserContext: async (context) => {
+ context.debugger.on("pausedstatechanged", () => {
+ const paused = !!context.debugger.pausedDetails();
+ if (pausedContexts.has(context) && !paused) {
+ pausedContexts.delete(context);
+ testInfo._setIgnoreTimeouts(false);
+ } else if (!pausedContexts.has(context) && paused) {
+ pausedContexts.add(context);
+ testInfo._setIgnoreTimeouts(true);
+ }
+ });
+ await artifactsRecorder.didCreateBrowserContext(context);
+ const currentTestInfo = globals.currentTestInfo();
+ if (currentTestInfo) {
+ attachConnectedHeaderIfNeeded(currentTestInfo, context.browser());
+ currentTestInfo._onCustomMessageCallback = (0, import_browserBackend.createCustomMessageHandler)(currentTestInfo, context);
+ await (0, import_browserBackend.runDaemonForContext)(currentTestInfo, context);
+ }
+ },
+ runAfterCreateRequestContext: async (context) => {
+ await artifactsRecorder.didCreateRequestContext(context);
+ },
+ runBeforeCloseBrowserContext: async (context) => {
+ await artifactsRecorder.willCloseBrowserContext(context);
+ },
+ runBeforeCloseRequestContext: async (context) => {
+ await artifactsRecorder.willCloseRequestContext(context);
+ }
+ };
+ const clientInstrumentation = playwright._instrumentation;
+ clientInstrumentation.addListener(csiListener);
+ await use();
+ clientInstrumentation.removeListener(csiListener);
+ await artifactsRecorder.didFinishTest();
+ }, { auto: "all-hooks-included", title: "trace recording", box: true, timeout: 0 }],
+ request: async ({ playwright }, use) => {
+ const request = await playwright.request.newContext();
+ await use(request);
+ const hook = test.info()._currentHookType();
+ if (hook === "beforeAll") {
+ await request.dispose({ reason: [
+ `Fixture { request } from beforeAll cannot be reused in a test.`,
+ ` - Recommended fix: use a separate { request } in the test.`,
+ ` - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.`,
+ `See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.`
+ ].join("\n") });
+ } else {
+ await request.dispose();
+ }
+ }
+};
+const _utilityTest = _baseTest.extend(utilityFixtures);
+const playwrightFixtures = {
+ defaultBrowserType: ["chromium", { scope: "worker", option: true, box: true }],
+ browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: "worker", option: true, box: true }],
+ headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: "worker", option: true, box: true }],
+ channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: "worker", option: true, box: true }],
+ launchOptions: [{}, { scope: "worker", option: true, box: true }],
+ connectOptions: [async ({ _optionConnectOptions }, use) => {
+ await use(connectOptionsFromEnv() || _optionConnectOptions);
+ }, { scope: "worker", option: true, box: true }],
+ video: ["off", { scope: "worker", option: true, box: true }],
+ _browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {
+ const options = {
+ handleSIGINT: false,
+ ...launchOptions,
+ tracesDir: tracing().tracesDir(),
+ artifactsDir: tracing().artifactsDir()
+ };
+ if (headless !== void 0)
+ options.headless = headless;
+ if (channel !== void 0)
+ options.channel = channel;
+ playwright._defaultLaunchOptions = options;
+ await use(options);
+ playwright._defaultLaunchOptions = void 0;
+ }, { scope: "worker", auto: true, box: true }],
+ browser: [async ({ playwright, browserName, _browserOptions, connectOptions }, use, workerInfo) => {
+ if (!["chromium", "firefox", "webkit"].includes(browserName))
+ throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);
+ if (connectOptions) {
+ const browser2 = await playwright[browserName].connect(connectOptions.wsEndpoint, {
+ ...connectOptions,
+ exposeNetwork: connectOptions.exposeNetwork,
+ headers: {
+ // HTTP headers are ASCII only (not UTF-8).
+ "x-playwright-launch-options": jsonStringifyForceASCII(_browserOptions),
+ ...connectOptions.headers
+ }
+ });
+ await use(browser2);
+ await browser2.close({ reason: "Test ended." });
+ return;
+ }
+ const browser = await playwright[browserName].launch();
+ if (process.env.PLAYWRIGHT_DASHBOARD)
+ await browser.bind(`worker-${workerInfo.parallelIndex}`);
+ await use(browser);
+ await browser.close({ reason: "Test ended." });
+ }, { scope: "worker", timeout: 0 }],
+ acceptDownloads: [({ contextOptions }, use) => use(contextOptions.acceptDownloads ?? true), { option: true, box: true }],
+ bypassCSP: [({ contextOptions }, use) => use(contextOptions.bypassCSP ?? false), { option: true, box: true }],
+ colorScheme: [({ contextOptions }, use) => use(contextOptions.colorScheme === void 0 ? "light" : contextOptions.colorScheme), { option: true, box: true }],
+ contrast: [({ contextOptions }, use) => use(contextOptions.contrast === void 0 ? "no-preference" : contextOptions.contrast), { option: true, box: true }],
+ deviceScaleFactor: [({ contextOptions }, use) => use(contextOptions.deviceScaleFactor), { option: true, box: true }],
+ extraHTTPHeaders: [({ contextOptions }, use) => use(contextOptions.extraHTTPHeaders), { option: true, box: true }],
+ forcedColors: [({ contextOptions }, use) => use(contextOptions.forcedColors === void 0 ? "none" : contextOptions.forcedColors), { option: true, box: true }],
+ geolocation: [({ contextOptions }, use) => use(contextOptions.geolocation), { option: true, box: true }],
+ hasTouch: [({ contextOptions }, use) => use(contextOptions.hasTouch ?? false), { option: true, box: true }],
+ httpCredentials: [({ contextOptions }, use) => use(contextOptions.httpCredentials), { option: true, box: true }],
+ ignoreHTTPSErrors: [({ contextOptions }, use) => use(contextOptions.ignoreHTTPSErrors ?? false), { option: true, box: true }],
+ isMobile: [({ contextOptions }, use) => use(contextOptions.isMobile ?? false), { option: true, box: true }],
+ javaScriptEnabled: [({ contextOptions }, use) => use(contextOptions.javaScriptEnabled ?? true), { option: true, box: true }],
+ locale: [({ contextOptions }, use) => use(contextOptions.locale ?? "en-US"), { option: true, box: true }],
+ offline: [({ contextOptions }, use) => use(contextOptions.offline ?? false), { option: true, box: true }],
+ permissions: [({ contextOptions }, use) => use(contextOptions.permissions), { option: true, box: true }],
+ proxy: [({ contextOptions }, use) => use(contextOptions.proxy), { option: true, box: true }],
+ reducedMotion: [({ contextOptions }, use) => use(contextOptions.reducedMotion === void 0 ? "no-preference" : contextOptions.reducedMotion), { option: true, box: true }],
+ storageState: [({ contextOptions }, use) => use(contextOptions.storageState), { option: true, box: true }],
+ clientCertificates: [({ contextOptions }, use) => use(contextOptions.clientCertificates), { option: true, box: true }],
+ timezoneId: [({ contextOptions }, use) => use(contextOptions.timezoneId), { option: true, box: true }],
+ userAgent: [({ contextOptions }, use) => use(contextOptions.userAgent), { option: true, box: true }],
+ viewport: [({ contextOptions }, use) => use(contextOptions.viewport === void 0 ? { width: 1280, height: 720 } : contextOptions.viewport), { option: true, box: true }],
+ actionTimeout: [0, { option: true, box: true }],
+ navigationTimeout: [0, { option: true, box: true }],
+ baseURL: [async ({}, use) => {
+ await use(process.env.PLAYWRIGHT_TEST_BASE_URL);
+ }, { option: true, box: true }],
+ serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true, box: true }],
+ contextOptions: [{}, { option: true, box: true }],
+ _combinedContextOptions: [async ({
+ acceptDownloads,
+ bypassCSP,
+ clientCertificates,
+ colorScheme,
+ contrast,
+ deviceScaleFactor,
+ extraHTTPHeaders,
+ forcedColors,
+ hasTouch,
+ geolocation,
+ httpCredentials,
+ ignoreHTTPSErrors,
+ isMobile,
+ javaScriptEnabled,
+ locale,
+ offline,
+ permissions,
+ proxy,
+ reducedMotion,
+ storageState,
+ viewport,
+ timezoneId,
+ userAgent,
+ baseURL,
+ contextOptions,
+ serviceWorkers
+ }, use, testInfo) => {
+ const options = {};
+ if (acceptDownloads !== void 0)
+ options.acceptDownloads = acceptDownloads;
+ if (bypassCSP !== void 0)
+ options.bypassCSP = bypassCSP;
+ if (colorScheme !== void 0)
+ options.colorScheme = colorScheme;
+ if (contrast !== void 0)
+ options.contrast = contrast;
+ if (deviceScaleFactor !== void 0)
+ options.deviceScaleFactor = deviceScaleFactor;
+ if (extraHTTPHeaders !== void 0)
+ options.extraHTTPHeaders = extraHTTPHeaders;
+ if (forcedColors !== void 0)
+ options.forcedColors = forcedColors;
+ if (geolocation !== void 0)
+ options.geolocation = geolocation;
+ if (hasTouch !== void 0)
+ options.hasTouch = hasTouch;
+ if (httpCredentials !== void 0)
+ options.httpCredentials = httpCredentials;
+ if (ignoreHTTPSErrors !== void 0)
+ options.ignoreHTTPSErrors = ignoreHTTPSErrors;
+ if (isMobile !== void 0)
+ options.isMobile = isMobile;
+ if (javaScriptEnabled !== void 0)
+ options.javaScriptEnabled = javaScriptEnabled;
+ if (locale !== void 0)
+ options.locale = locale;
+ if (offline !== void 0)
+ options.offline = offline;
+ if (permissions !== void 0)
+ options.permissions = permissions;
+ if (proxy !== void 0)
+ options.proxy = proxy;
+ if (reducedMotion !== void 0)
+ options.reducedMotion = reducedMotion;
+ if (storageState !== void 0)
+ options.storageState = storageState;
+ if (clientCertificates?.length)
+ options.clientCertificates = resolveClientCerticates(clientCertificates);
+ if (timezoneId !== void 0)
+ options.timezoneId = timezoneId;
+ if (userAgent !== void 0)
+ options.userAgent = userAgent;
+ if (viewport !== void 0)
+ options.viewport = viewport;
+ if (baseURL !== void 0)
+ options.baseURL = baseURL;
+ if (serviceWorkers !== void 0)
+ options.serviceWorkers = serviceWorkers;
+ await use({
+ ...contextOptions,
+ ...options
+ });
+ }, { scope: "test", box: true }],
+ _setupContextOptions: [async ({ playwright, actionTimeout, navigationTimeout, testIdAttribute }, use, _testInfo) => {
+ const testInfo = _testInfo;
+ if (testIdAttribute)
+ playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
+ testInfo.snapshotSuffix = process.platform;
+ testInfo._onCustomMessageCallback = () => Promise.reject(new Error("Only tests that use default Playwright context or page fixture support test_debug"));
+ if (debugMode() === "inspector")
+ testInfo._setIgnoreTimeouts(true);
+ playwright._defaultContextTimeout = actionTimeout || 0;
+ playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
+ await use();
+ playwright._defaultContextTimeout = void 0;
+ playwright._defaultContextNavigationTimeout = void 0;
+ }, { auto: "all-hooks-included", title: "context configuration", box: true }],
+ _contextFactory: [async ({
+ browser,
+ video,
+ _reuseContext,
+ _combinedContextOptions
+ /** mitigate dep-via-auto lack of traceability */
+ }, use, testInfo) => {
+ const testInfoImpl = testInfo;
+ const videoMode = normalizeVideoMode(video);
+ const captureVideo = shouldCaptureVideo(videoMode, testInfo) && !_reuseContext;
+ const contexts = /* @__PURE__ */ new Map();
+ let counter = 0;
+ await use(async (options) => {
+ const hook = testInfoImpl._currentHookType();
+ if (hook === "beforeAll" || hook === "afterAll") {
+ throw new Error([
+ `"context" and "page" fixtures are not supported in "${hook}" since they are created on a per-test basis.`,
+ `If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details.`,
+ `If you would like to configure your page before each test, do that in beforeEach hook instead.`
+ ].join("\n"));
+ }
+ const show = typeof video === "string" ? void 0 : video.show;
+ const videoOptions = captureVideo ? {
+ recordVideo: {
+ dir: tracing().artifactsDir(),
+ size: typeof video === "string" ? void 0 : video.size,
+ showActions: show?.actions
+ }
+ } : {};
+ const context = await browser.newContext({ ...videoOptions, ...options });
+ let closed = false;
+ const close = async () => {
+ if (closed)
+ return;
+ closed = true;
+ const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
+ await context.close({ reason: closeReason });
+ const preserveVideo = captureVideo && shouldPreserveVideo(videoMode, testInfo);
+ if (preserveVideo) {
+ const { pagesWithVideo: pagesForVideo } = contexts.get(context);
+ const videos = pagesForVideo.map((p) => p.video()).filter((video2) => !!video2);
+ await Promise.all(videos.map(async (v) => {
+ try {
+ const savedPath = testInfo.outputPath(`video${counter ? "-" + counter : ""}.webm`);
+ ++counter;
+ await v.saveAs(savedPath);
+ testInfo.attachments.push({ name: "video", path: savedPath, contentType: "video/webm" });
+ } catch (e) {
+ }
+ }));
+ }
+ };
+ const contextData = { close, pagesWithVideo: [] };
+ if (captureVideo)
+ context.on("page", (page) => contextData.pagesWithVideo.push(page));
+ contexts.set(context, contextData);
+ return { context, close };
+ });
+ await Promise.all([...contexts.values()].map((data) => data.close()));
+ }, { scope: "test", title: "context", box: true }],
+ _optionContextReuseMode: ["none", { scope: "worker", option: true, box: true }],
+ _optionConnectOptions: [void 0, { scope: "worker", option: true, box: true }],
+ reuseContext: [false, { scope: "worker", option: true, box: true }],
+ _reuseContext: [async ({ video, _optionContextReuseMode, reuseContext }, use) => {
+ let mode = _optionContextReuseMode;
+ if (process.env.PW_TEST_REUSE_CONTEXT || reuseContext)
+ mode = "when-possible";
+ const reuse = mode === "when-possible" && normalizeVideoMode(video) === "off";
+ await use(reuse);
+ }, { scope: "worker", title: "context", box: true }],
+ context: async ({ browser, video, _reuseContext, _contextFactory }, use, testInfoPublic) => {
+ const browserImpl = browser;
+ const testInfo = testInfoPublic;
+ const show = typeof video === "string" ? void 0 : video.show;
+ attachConnectedHeaderIfNeeded(testInfo, browserImpl);
+ if (!_reuseContext) {
+ const { context: context2, close } = await _contextFactory();
+ await installScreencastTitleUpdater(testInfo, context2, show?.test);
+ await use(context2);
+ await close();
+ return;
+ }
+ const context = await browserImpl._wrapApiCall(() => browserImpl._newContextForReuse(), { internal: true });
+ await installScreencastTitleUpdater(testInfo, context, show?.test);
+ await use(context);
+ const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
+ await browserImpl._wrapApiCall(() => browserImpl._disconnectFromReusedContext(closeReason), { internal: true });
+ },
+ page: async ({ context, _reuseContext }, use) => {
+ if (!_reuseContext) {
+ await use(await context.newPage());
+ return;
+ }
+ let [page] = context.pages();
+ if (!page)
+ page = await context.newPage();
+ await use(page);
+ },
+ mount: async ({ page, baseURL }, use) => {
+ const callMount = (params) => page.evaluate(async (p) => {
+ const w = window;
+ if (typeof w.mount !== "function")
+ throw new Error("The gallery page does not define window.mount().");
+ await w.mount(p);
+ }, params, { exposeFunctions: true });
+ await use(async (storyId, props) => {
+ if (!baseURL)
+ throw new Error("mount() requires `baseURL` to point at the component gallery. Set it in your Playwright config.");
+ await page.goto(baseURL);
+ await callMount({ story: storyId, props });
+ return Object.assign(page.locator("#root"), {
+ // update() re-renders the same story with new props without navigating; if the gallery
+ // reuses its root/instance, the framework reconciles and component state is preserved.
+ update: (newProps) => callMount({ story: storyId, props: newProps }),
+ unmount: () => page.evaluate(async () => {
+ await window.unmount?.();
+ })
+ });
+ });
+ }
+};
+function normalizeVideoMode(video) {
+ if (!video)
+ return "off";
+ let videoMode = typeof video === "string" ? video : video.mode;
+ if (videoMode === "retry-with-video")
+ videoMode = "on-first-retry";
+ return videoMode;
+}
+function shouldCaptureVideo(videoMode, testInfo) {
+ return videoMode === "on" || videoMode === "retain-on-failure" || videoMode === "retain-on-failure-and-retries" || videoMode === "on-first-retry" && testInfo.retry === 1 || videoMode === "on-all-retries" && testInfo.retry > 0 || videoMode === "retain-on-first-failure" && testInfo.retry === 0;
+}
+function shouldPreserveVideo(videoMode, testInfo) {
+ const testFailed = testInfo.status !== testInfo.expectedStatus;
+ switch (videoMode) {
+ case "on":
+ case "on-first-retry":
+ case "on-all-retries":
+ return true;
+ case "retain-on-failure":
+ case "retain-on-first-failure":
+ return testFailed;
+ case "retain-on-failure-and-retries":
+ return testFailed || testInfo.retry > 0;
+ default:
+ return false;
+ }
+}
+function normalizeScreenshotMode(screenshot) {
+ if (!screenshot)
+ return "off";
+ return typeof screenshot === "string" ? screenshot : screenshot.mode;
+}
+function attachConnectedHeaderIfNeeded(testInfo, browser) {
+ const connectHeaders = browser?._connection.headers;
+ if (!connectHeaders)
+ return;
+ for (const header of connectHeaders) {
+ if (header.name !== "x-playwright-attachment")
+ continue;
+ const [name, value] = header.value.split("=");
+ if (!name || !value)
+ continue;
+ if (testInfo.attachments.some((attachment) => attachment.name === name))
+ continue;
+ testInfo.attachments.push({ name, contentType: "text/plain", body: Buffer.from(value) });
+ }
+}
+function resolveFileToConfig(file) {
+ const config2 = test.info().config.configFile;
+ if (!config2 || !file)
+ return file;
+ if (import_path.default.isAbsolute(file))
+ return file;
+ return import_path.default.resolve(import_path.default.dirname(config2), file);
+}
+function resolveClientCerticates(clientCertificates) {
+ for (const cert of clientCertificates) {
+ cert.certPath = resolveFileToConfig(cert.certPath);
+ cert.keyPath = resolveFileToConfig(cert.keyPath);
+ cert.pfxPath = resolveFileToConfig(cert.pfxPath);
+ }
+ return clientCertificates;
+}
+const kTracingStarted = /* @__PURE__ */ Symbol("kTracingStarted");
+function connectOptionsFromEnv() {
+ const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;
+ if (!wsEndpoint)
+ return void 0;
+ const headers = process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : void 0;
+ return {
+ wsEndpoint,
+ headers,
+ exposeNetwork: process.env.PW_TEST_CONNECT_EXPOSE_NETWORK
+ };
+}
+class SnapshotRecorder {
+ constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot) {
+ this._artifactsRecorder = _artifactsRecorder;
+ this._mode = _mode;
+ this._name = _name;
+ this._contentType = _contentType;
+ this._extension = _extension;
+ this._doSnapshot = _doSnapshot;
+ this._ordinal = 0;
+ this._temporary = [];
+ }
+ fixOrdinal() {
+ this._ordinal = this.testInfo.attachments.filter((a) => a.name === this._name).length;
+ }
+ shouldCaptureUponFinish() {
+ return this._mode === "on" || this._mode === "only-on-failure" && this.testInfo._isFailure() || this._mode === "on-first-failure" && this.testInfo._isFailure() && this.testInfo.retry === 0;
+ }
+ async maybeCapture() {
+ if (!this.shouldCaptureUponFinish())
+ return;
+ await Promise.all(this._artifactsRecorder._playwright._allPages().map((page) => this._snapshotPage(page, false)));
+ }
+ async persistTemporary() {
+ if (this.shouldCaptureUponFinish()) {
+ await Promise.all(this._temporary.map(async (file) => {
+ try {
+ const path2 = this._createAttachmentPath();
+ await import_fs.default.promises.rename(file, path2);
+ this._attach(path2);
+ } catch {
+ }
+ }));
+ }
+ }
+ async captureTemporary(context) {
+ if (this._mode === "on" || this._mode === "only-on-failure" || this._mode === "on-first-failure" && this.testInfo.retry === 0)
+ await Promise.all(context.pages().map((page) => this._snapshotPage(page, true)));
+ }
+ _attach(screenshotPath) {
+ this.testInfo.attachments.push({ name: this._name, path: screenshotPath, contentType: this._contentType });
+ }
+ _createAttachmentPath() {
+ const testFailed = this.testInfo._isFailure();
+ const index = this._ordinal + 1;
+ ++this._ordinal;
+ const path2 = this.testInfo.outputPath(`test-${testFailed ? "failed" : "finished"}-${index}${this._extension}`);
+ return path2;
+ }
+ _createTemporaryArtifact(...name) {
+ const file = import_path.default.join(this._artifactsRecorder._artifactsDir, ...name);
+ return file;
+ }
+ async _snapshotPage(page, temporary) {
+ if (page[this.testInfo._uniqueSymbol])
+ return;
+ page[this.testInfo._uniqueSymbol] = true;
+ try {
+ const path2 = temporary ? this._createTemporaryArtifact(createGuid() + this._extension) : this._createAttachmentPath();
+ await this._doSnapshot(page, path2);
+ if (temporary)
+ this._temporary.push(path2);
+ else
+ this._attach(path2);
+ } catch {
+ }
+ }
+ get testInfo() {
+ return this._artifactsRecorder._testInfo;
+ }
+}
+class ArtifactsRecorder {
+ constructor(playwright, artifactsDir, screenshot) {
+ this._playwright = playwright;
+ this._artifactsDir = artifactsDir;
+ const screenshotOptions = typeof screenshot === "string" ? void 0 : screenshot;
+ this._startedCollectingArtifacts = /* @__PURE__ */ Symbol("startedCollectingArtifacts");
+ this._screenshotRecorder = new SnapshotRecorder(this, normalizeScreenshotMode(screenshot), "screenshot", "image/png", ".png", async (page, path2) => {
+ await page._wrapApiCall(async () => {
+ await page.screenshot({ ...screenshotOptions, timeout: 5e3, path: path2, caret: "initial" });
+ }, { internal: true });
+ });
+ }
+ async willStartTest(testInfo) {
+ this._testInfo = testInfo;
+ testInfo._onDidFinishTestFunctionCallbacks.add(() => this.didFinishTestFunction());
+ this._screenshotRecorder.fixOrdinal();
+ await Promise.all(this._playwright._allContexts().map((context) => this.didCreateBrowserContext(context)));
+ const existingApiRequests = Array.from(this._playwright.request._contexts);
+ await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
+ }
+ async didCreateBrowserContext(context) {
+ await this._startTraceChunkOnContextCreation(context, context.tracing);
+ await this._startTraceChunkOnContextCreation(context.request, context.request.tracing);
+ }
+ async willCloseBrowserContext(context) {
+ await this._stopTracing(context, context.tracing);
+ await this._screenshotRecorder.captureTemporary(context);
+ await this._takePageSnapshot(context);
+ }
+ async _takePageSnapshot(context) {
+ if (process.env.PLAYWRIGHT_NO_COPY_PROMPT)
+ return;
+ if (this._testInfo.errors.length === 0)
+ return;
+ if (this._testInfo.errors.some((e) => e.errorContext))
+ return;
+ if (this._pageSnapshot)
+ return;
+ const page = context.pages()[0];
+ if (!page)
+ return;
+ try {
+ await page._wrapApiCall(async () => {
+ this._pageSnapshot = await page.ariaSnapshot({ mode: "ai", timeout: 5e3 });
+ }, { internal: true });
+ } catch (error) {
+ debugLogger.log("error", `failed to capture aria snapshot: ${error}`);
+ }
+ }
+ async didCreateRequestContext(context) {
+ await this._startTraceChunkOnContextCreation(context, context.tracing);
+ }
+ async willCloseRequestContext(context) {
+ await this._stopTracing(context, context.tracing);
+ }
+ async didFinishTestFunction() {
+ await this._screenshotRecorder.maybeCapture();
+ }
+ async didFinishTest() {
+ await this.didFinishTestFunction();
+ const leftoverContexts = this._playwright._allContexts();
+ const leftoverApiRequests = Array.from(this._playwright.request._contexts);
+ await Promise.all(leftoverContexts.map(async (context2) => {
+ await this._stopTracing(context2.request, context2.request.tracing);
+ await this._stopTracing(context2, context2.tracing);
+ }).concat(leftoverApiRequests.map(async (context2) => {
+ await this._stopTracing(context2, context2.tracing);
+ })));
+ await this._screenshotRecorder.persistTemporary();
+ const context = leftoverContexts[0];
+ if (context)
+ await this._takePageSnapshot(context);
+ if (this._testInfo.errors.length > 0) {
+ const hasMatcherAriaSnapshot = this._testInfo.errors.some((e) => e.errorContext);
+ const errorContextContent = (0, import_errorContext.buildErrorContext)({
+ titlePath: this._testInfo.titlePath,
+ location: { file: this._testInfo.file, line: this._testInfo.line, column: this._testInfo.column },
+ errors: this._testInfo.errors,
+ pageSnapshot: hasMatcherAriaSnapshot ? void 0 : this._pageSnapshot
+ });
+ if (errorContextContent) {
+ const filePath = this._testInfo.outputPath("error-context.md");
+ await import_fs.default.promises.writeFile(filePath, errorContextContent, "utf8");
+ this._testInfo._attach({
+ name: "error-context",
+ contentType: "text/markdown",
+ path: filePath
+ }, void 0);
+ }
+ }
+ }
+ async _startTraceChunkOnContextCreation(channelOwner, tracing2) {
+ await channelOwner._wrapApiCall(async () => {
+ const options = this._testInfo._tracing.traceOptions();
+ if (options) {
+ const title = this._testInfo._tracing.traceTitle();
+ const name = this._testInfo._tracing.generateNextTraceRecordingName();
+ if (!tracing2[kTracingStarted]) {
+ await tracing2.start({ ...options, title, name });
+ tracing2[kTracingStarted] = true;
+ } else {
+ await tracing2.startChunk({ title, name });
+ }
+ } else {
+ if (tracing2[kTracingStarted]) {
+ tracing2[kTracingStarted] = false;
+ await tracing2.stop();
+ }
+ }
+ }, { internal: true });
+ }
+ async _stopTracing(channelOwner, tracing2) {
+ await channelOwner._wrapApiCall(async () => {
+ if (tracing2[this._startedCollectingArtifacts])
+ return;
+ tracing2[this._startedCollectingArtifacts] = true;
+ if (this._testInfo._tracing.traceOptions() && tracing2[kTracingStarted])
+ await tracing2.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });
+ }, { internal: true });
+ }
+}
+async function installScreencastTitleUpdater(testInfo, context, testAnnotate) {
+ if (!testAnnotate)
+ return;
+ const testTitle = testAnnotate.level === "file" ? [testInfo.titlePath[0]] : testInfo.titlePath;
+ const stepStack = [];
+ const overlays = /* @__PURE__ */ new Map();
+ const position = testAnnotate.position ?? "top-left";
+ const fontSize = testAnnotate.fontSize ?? 14;
+ const level = testAnnotate.level ?? "step";
+ const updateOverlay = async () => {
+ const parts = level === "step" ? [...testTitle, ...stepStack] : testTitle;
+ const html = createTestOverlay(parts, position, fontSize);
+ for (const page of context.pages()) {
+ await overlays.get(page)?.dispose();
+ overlays.delete(page);
+ const disposable = await page.screencast.showOverlay(html);
+ overlays.set(page, disposable);
+ }
+ };
+ testInfo._onUserStepBegin = async (title) => {
+ stepStack.push(title);
+ await updateOverlay();
+ };
+ testInfo._onUserStepEnd = async () => {
+ stepStack.pop();
+ await updateOverlay();
+ };
+ context.on("page", async () => {
+ void updateOverlay();
+ });
+ await updateOverlay();
+}
+function createTestOverlay(parts, position, fontSize) {
+ const positionStyles = {
+ "top-left": "top: 6px; left: 6px;",
+ "top": "top: 6px; left: 50%; transform: translateX(-50%);",
+ "top-right": "top: 6px; right: 6px;",
+ "bottom-left": "bottom: 6px; left: 6px;",
+ "bottom": "bottom: 6px; left: 50%; transform: translateX(-50%);",
+ "bottom-right": "bottom: 6px; right: 6px;"
+ };
+ const posStyle = positionStyles[position] ?? positionStyles["top-left"];
+ return `
+ ${parts.map((p) => `
${escapeHTML(p)}
`).join("")}
+
`;
+}
+function renderTitle(type, method, params, title) {
+ return renderTitleForCall({ title, type, method, params });
+}
+function renderSubtitle(type, method, params) {
+ const subtitle = renderSubtitleForCall({ type, method, params });
+ return subtitle === void 0 ? void 0 : truncateParam(subtitle);
+}
+function tracing() {
+ return test.info()._tracing;
+}
+const test = _utilityTest.extend(playwrightFixtures);
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ _baseTest,
+ _utilityTest,
+ defineConfig,
+ expect,
+ mergeExpects,
+ mergeTests,
+ test
+});
diff --git a/node_modules/playwright/lib/isomorphic.js.txt b/node_modules/playwright/lib/isomorphic.js.txt
new file mode 100644
index 0000000..a23ac2e
--- /dev/null
+++ b/node_modules/playwright/lib/isomorphic.js.txt
@@ -0,0 +1,9 @@
+# packages/playwright/lib/isomorphic.js
+# total: 8.0 KB
+
+## Inlined (3)
+ 1.3 KB packages/playwright/src/isomorphic/events.ts
+ 0.3 KB packages/playwright/src/isomorphic/index.ts
+ 5.3 KB packages/playwright/src/isomorphic/testServerConnection.ts
+
+## External (0)
diff --git a/node_modules/playwright/lib/loader/loaderProcessEntry.js b/node_modules/playwright/lib/loader/loaderProcessEntry.js
new file mode 100644
index 0000000..9a76597
--- /dev/null
+++ b/node_modules/playwright/lib/loader/loaderProcessEntry.js
@@ -0,0 +1,34 @@
+"use strict";
+
+// packages/playwright/src/loader/loaderProcessEntry.ts
+var import_common2 = require("../common");
+
+// packages/playwright/src/loader/loaderMain.ts
+var import_common = require("../common");
+var LoaderMain = class extends import_common.ProcessRunner {
+ constructor(serializedConfig) {
+ super();
+ this._poolBuilder = import_common.poolBuilder.PoolBuilder.createForLoader();
+ this._serializedConfig = serializedConfig;
+ }
+ _config() {
+ if (!this._configPromise)
+ this._configPromise = import_common.configLoader.deserializeConfig(this._serializedConfig);
+ return this._configPromise;
+ }
+ async loadTestFile(params) {
+ const testErrors = [];
+ const config = await this._config();
+ const fileSuite = await import_common.testLoader.loadTestFile(params.file, config, testErrors);
+ this._poolBuilder.buildPools(fileSuite);
+ return { fileSuite: fileSuite._deepSerialize(), testErrors };
+ }
+ async getCompilationCacheFromLoader() {
+ await import_common.transform.incorporateCompilationCache();
+ return import_common.cc.serializeCompilationCache();
+ }
+};
+var create = (config) => new LoaderMain(config);
+
+// packages/playwright/src/loader/loaderProcessEntry.ts
+(0, import_common2.startProcessRunner)(create);
diff --git a/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt b/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt
new file mode 100644
index 0000000..7000ac7
--- /dev/null
+++ b/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt
@@ -0,0 +1,9 @@
+# packages/playwright/lib/loader/loaderProcessEntry.js
+# total: 1.2 KB
+
+## Inlined (2)
+ 1.0 KB packages/playwright/src/loader/loaderMain.ts
+ 0.1 KB packages/playwright/src/loader/loaderProcessEntry.ts
+
+## External (1)
+ ../common
diff --git a/node_modules/playwright/lib/mcp/test/browserBackend.js b/node_modules/playwright/lib/mcp/test/browserBackend.js
new file mode 100644
index 0000000..ca1d3c3
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/browserBackend.js
@@ -0,0 +1,135 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var browserBackend_exports = {};
+__export(browserBackend_exports, {
+ createCustomMessageHandler: () => createCustomMessageHandler,
+ runDaemonForContext: () => runDaemonForContext
+});
+module.exports = __toCommonJS(browserBackend_exports);
+var import_crypto = __toESM(require("crypto"));
+const { stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
+function createCustomMessageHandler(testInfo, context) {
+ let backend;
+ const config = { capabilities: ["testing"] };
+ let tools;
+ context.once("close", () => {
+ void backend?.dispose();
+ backend = void 0;
+ });
+ return async (data) => {
+ if (!tools)
+ ({ tools } = require("playwright-core/lib/coreBundle"));
+ const toolList = tools.filteredTools(config);
+ if (data.initialize) {
+ if (backend)
+ throw new Error("MCP backend is already initialized");
+ backend = new tools.BrowserBackend(config, context, toolList);
+ await backend.initialize(data.initialize.clientInfo);
+ const pausedMessage = await generatePausedMessage(tools, testInfo, context);
+ return { initialize: { pausedMessage } };
+ }
+ if (data.callTool) {
+ if (!backend)
+ throw new Error("MCP backend is not initialized");
+ return { callTool: await backend.callTool(data.callTool.name, data.callTool.arguments) };
+ }
+ if (data.close) {
+ await backend?.dispose();
+ backend = void 0;
+ return { close: {} };
+ }
+ throw new Error("Unknown MCP request");
+ };
+}
+async function generatePausedMessage(tools, testInfo, context) {
+ const lines = [];
+ if (testInfo.errors.length) {
+ lines.push(`### Paused on error:`);
+ for (const error of testInfo.errors)
+ lines.push(stripAnsiEscapes(error.message || ""));
+ } else {
+ lines.push(`### Paused at end of test. ready for interaction`);
+ }
+ for (let i = 0; i < context.pages().length; i++) {
+ const page = context.pages()[i];
+ const stateSuffix = context.pages().length > 1 ? i + 1 + " of " + context.pages().length : "state";
+ lines.push(
+ "",
+ `### Page ${stateSuffix}`,
+ `- Page URL: ${page.url()}`,
+ `- Page Title: ${await page.title()}`.trim()
+ );
+ let console2 = testInfo.errors.length ? await tools.Tab.collectConsoleMessages(page) : [];
+ console2 = console2.filter((msg) => msg.type === "error");
+ if (console2.length) {
+ lines.push("- Console Messages:");
+ for (const message of console2)
+ lines.push(` - ${message.toString()}`);
+ }
+ lines.push(
+ `- Page Snapshot:`,
+ "```yaml",
+ await page.ariaSnapshot({ mode: "ai" }),
+ "```"
+ );
+ }
+ lines.push("");
+ if (testInfo.errors.length)
+ lines.push(`### Task`, `Try recovering from the error prior to continuing`);
+ return lines.join("\n");
+}
+const kDaemonSymbol = /* @__PURE__ */ Symbol("daemon");
+const kSessionNameSymbol = /* @__PURE__ */ Symbol("sessionName");
+async function runDaemonForContext(testInfo, context) {
+ if (testInfo._configInternal.configCLIOverrides.debug !== "cli")
+ return false;
+ const browser = context.browser();
+ let sessionName = browser[kSessionNameSymbol];
+ if (!sessionName) {
+ sessionName = `tw-${import_crypto.default.randomBytes(3).toString("hex")}`;
+ await browser.bind(sessionName, { workspaceDir: testInfo.project.testDir });
+ browser[kSessionNameSymbol] = sessionName;
+ }
+ if (testInfo[kDaemonSymbol])
+ return false;
+ testInfo[kDaemonSymbol] = true;
+ console.log([
+ `### The test is currently paused at the start`,
+ ``,
+ `### Debugging Instructions`,
+ `- Run "playwright-cli attach ${sessionName}" to attach to this test`
+ ].join("\n"));
+ await context.debugger.requestPause();
+ return true;
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ createCustomMessageHandler,
+ runDaemonForContext
+});
diff --git a/node_modules/playwright/lib/mcp/test/generatorTools.js b/node_modules/playwright/lib/mcp/test/generatorTools.js
new file mode 100644
index 0000000..862c36b
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/generatorTools.js
@@ -0,0 +1,122 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var generatorTools_exports = {};
+__export(generatorTools_exports, {
+ generatorReadLog: () => generatorReadLog,
+ generatorWriteTest: () => generatorWriteTest,
+ setupPage: () => setupPage
+});
+module.exports = __toCommonJS(generatorTools_exports);
+var import_fs = __toESM(require("fs"));
+var import_path = __toESM(require("path"));
+var import_testTool = require("./testTool");
+var import_testContext = require("./testContext");
+const z = require("playwright-core/lib/utilsBundle").z;
+const { isPathInside, resolveWithinRoot } = require("playwright-core/lib/coreBundle").utils;
+const setupPage = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "generator_setup_page",
+ title: "Setup generator page",
+ description: "Setup the page for test.",
+ inputSchema: z.object({
+ plan: z.string().describe("The plan for the test. This should be the actual test plan with all the steps."),
+ project: z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
+ seedFile: z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
+ }),
+ type: "readOnly"
+ },
+ handle: async (context, params, signal) => {
+ const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
+ context.generatorJournal = new import_testContext.GeneratorJournal(context.rootPath, params.plan, seed);
+ const { output, status } = await context.runSeedTest(seed.file, seed.projectName, signal);
+ return { content: [{ type: "text", text: output }], isError: status !== "paused" };
+ }
+});
+const generatorReadLog = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "generator_read_log",
+ title: "Retrieve test log",
+ description: "Retrieve the performed test log",
+ inputSchema: z.object({}),
+ type: "readOnly"
+ },
+ handle: async (context) => {
+ if (!context.generatorJournal)
+ throw new Error(`Please setup page using "${setupPage.schema.name}" first.`);
+ const result = context.generatorJournal.journal();
+ return { content: [{
+ type: "text",
+ text: result
+ }] };
+ }
+});
+const generatorWriteTest = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "generator_write_test",
+ title: "Write test",
+ description: "Write the generated test to the test file",
+ inputSchema: z.object({
+ fileName: z.string().describe("The file to write the test to"),
+ code: z.string().describe("The generated test code")
+ }),
+ type: "readOnly"
+ },
+ handle: async (context, params) => {
+ if (!context.generatorJournal)
+ throw new Error(`Please setup page using "${setupPage.schema.name}" first.`);
+ const testRunner = context.existingTestRunner();
+ if (!testRunner)
+ throw new Error("No test runner found, please setup page and perform actions first.");
+ const config = await testRunner.loadConfig();
+ const resolvedFile = resolveWithinRoot(context.rootPath, params.fileName);
+ const dirs = [];
+ for (const project of config.projects) {
+ const projectTestDir = project.project.testDir;
+ if (resolvedFile && isPathInside(projectTestDir, resolvedFile)) {
+ await import_fs.default.promises.mkdir(import_path.default.dirname(resolvedFile), { recursive: true });
+ await import_fs.default.promises.writeFile(resolvedFile, params.code);
+ return {
+ content: [{
+ type: "text",
+ text: `### Result
+Test written to ${params.fileName}`
+ }]
+ };
+ }
+ dirs.push(import_path.default.relative(context.rootPath, projectTestDir).replace(/\\/g, "/"));
+ }
+ throw new Error(`Test file did not match any of the test dirs: ${dirs.join(", ")}`);
+ }
+});
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ generatorReadLog,
+ generatorWriteTest,
+ setupPage
+});
diff --git a/node_modules/playwright/lib/mcp/test/plannerTools.js b/node_modules/playwright/lib/mcp/test/plannerTools.js
new file mode 100644
index 0000000..23ca099
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/plannerTools.js
@@ -0,0 +1,150 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var plannerTools_exports = {};
+__export(plannerTools_exports, {
+ saveTestPlan: () => saveTestPlan,
+ setupPage: () => setupPage,
+ submitTestPlan: () => submitTestPlan
+});
+module.exports = __toCommonJS(plannerTools_exports);
+var import_fs = __toESM(require("fs"));
+var import_path = __toESM(require("path"));
+var import_testTool = require("./testTool");
+const z = require("playwright-core/lib/utilsBundle").z;
+const { resolveWithinRoot } = require("playwright-core/lib/coreBundle").utils;
+const setupPage = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "planner_setup_page",
+ title: "Setup planner page",
+ description: "Setup the page for test planning",
+ inputSchema: z.object({
+ project: z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
+ seedFile: z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
+ }),
+ type: "readOnly"
+ },
+ handle: async (context, params, signal) => {
+ const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
+ const { output, status } = await context.runSeedTest(seed.file, seed.projectName, signal);
+ return { content: [{ type: "text", text: output }], isError: status !== "paused" };
+ }
+});
+const planSchema = z.object({
+ overview: z.string().describe("A brief overview of the application to be tested"),
+ suites: z.array(z.object({
+ name: z.string().describe("The name of the suite"),
+ seedFile: z.string().describe("A seed file that was used to setup the page for testing."),
+ tests: z.array(z.object({
+ name: z.string().describe("The name of the test"),
+ file: z.string().describe('The file the test should be saved to, for example: "tests//.spec.ts".'),
+ steps: z.array(z.object({
+ perform: z.string().optional().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),
+ expect: z.string().array().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`)
+ }))
+ }))
+ }))
+});
+const submitTestPlan = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "planner_submit_plan",
+ title: "Submit test plan",
+ description: "Submit the test plan to the test planner",
+ inputSchema: planSchema,
+ type: "readOnly"
+ },
+ handle: async (context, params) => {
+ return {
+ content: [{
+ type: "text",
+ text: JSON.stringify(params, null, 2)
+ }]
+ };
+ }
+});
+const saveTestPlan = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "planner_save_plan",
+ title: "Save test plan as markdown file",
+ description: "Save the test plan as a markdown file",
+ inputSchema: planSchema.extend({
+ name: z.string().describe('The name of the test plan, for example: "Test Plan".'),
+ fileName: z.string().describe('The file to save the test plan to, for example: "spec/test.plan.md". Relative to the workspace root.')
+ }),
+ type: "readOnly"
+ },
+ handle: async (context, params) => {
+ const lines = [];
+ lines.push(`# ${params.name}`);
+ lines.push(``);
+ lines.push(`## Application Overview`);
+ lines.push(``);
+ lines.push(params.overview);
+ lines.push(``);
+ lines.push(`## Test Scenarios`);
+ for (let i = 0; i < params.suites.length; i++) {
+ lines.push(``);
+ const suite = params.suites[i];
+ lines.push(`### ${i + 1}. ${suite.name}`);
+ lines.push(``);
+ lines.push(`**Seed:** \`${suite.seedFile}\``);
+ for (let j = 0; j < suite.tests.length; j++) {
+ lines.push(``);
+ const test = suite.tests[j];
+ lines.push(`#### ${i + 1}.${j + 1}. ${test.name}`);
+ lines.push(``);
+ lines.push(`**File:** \`${test.file}\``);
+ lines.push(``);
+ lines.push(`**Steps:**`);
+ for (let k = 0; k < test.steps.length; k++) {
+ lines.push(` ${k + 1}. ${test.steps[k].perform ?? "-"}`);
+ for (const expect of test.steps[k].expect)
+ lines.push(` - expect: ${expect}`);
+ }
+ }
+ }
+ lines.push(``);
+ const resolvedFile = resolveWithinRoot(context.rootPath, params.fileName);
+ if (!resolvedFile)
+ throw new Error(`Plan file name must be a relative path inside the workspace: ${params.fileName}`);
+ await import_fs.default.promises.mkdir(import_path.default.dirname(resolvedFile), { recursive: true });
+ await import_fs.default.promises.writeFile(resolvedFile, lines.join("\n"));
+ return {
+ content: [{
+ type: "text",
+ text: `Test plan saved to ${params.fileName}`
+ }]
+ };
+ }
+});
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ saveTestPlan,
+ setupPage,
+ submitTestPlan
+});
diff --git a/node_modules/playwright/lib/mcp/test/streams.js b/node_modules/playwright/lib/mcp/test/streams.js
new file mode 100644
index 0000000..4ab9e37
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/streams.js
@@ -0,0 +1,44 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var streams_exports = {};
+__export(streams_exports, {
+ StringWriteStream: () => StringWriteStream
+});
+module.exports = __toCommonJS(streams_exports);
+var import_stream = require("stream");
+var import_util = require("../../util");
+class StringWriteStream extends import_stream.Writable {
+ constructor(output, stdio) {
+ super();
+ this._output = output;
+ this._prefix = stdio === "stdout" ? "" : "[err] ";
+ }
+ _write(chunk, encoding, callback) {
+ let text = (0, import_util.stripAnsiEscapes)(chunk.toString());
+ if (text.endsWith("\n"))
+ text = text.slice(0, -1);
+ if (text)
+ this._output.push(this._prefix + text);
+ callback();
+ }
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ StringWriteStream
+});
diff --git a/node_modules/playwright/lib/mcp/test/testContext.js b/node_modules/playwright/lib/mcp/test/testContext.js
new file mode 100644
index 0000000..70e17db
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/testContext.js
@@ -0,0 +1,306 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var testContext_exports = {};
+__export(testContext_exports, {
+ GeneratorJournal: () => GeneratorJournal,
+ TestContext: () => TestContext,
+ createScreen: () => createScreen
+});
+module.exports = __toCommonJS(testContext_exports);
+var import_fs = __toESM(require("fs"));
+var import_os = __toESM(require("os"));
+var import_path = __toESM(require("path"));
+var import_coreBundle = require("playwright-core/lib/coreBundle");
+var import_runner = require("../../runner");
+var import_streams = require("./streams");
+var import_util = require("../../util");
+var import_seed = require("./seed");
+var import_common = require("../../common");
+const debug = require("playwright-core/lib/utilsBundle").debug;
+const { noColors } = require("playwright-core/lib/coreBundle").iso;
+const { ManualPromise, signalToPromise } = require("playwright-core/lib/coreBundle").iso;
+const { escapeRegExp } = require("playwright-core/lib/coreBundle").iso;
+const { toPosixPath } = require("playwright-core/lib/coreBundle").utils;
+class GeneratorJournal {
+ constructor(rootPath, plan, seed) {
+ this._rootPath = rootPath;
+ this._plan = plan;
+ this._seed = seed;
+ this._steps = [];
+ }
+ logStep(title, code) {
+ if (title)
+ this._steps.push({ title, code });
+ }
+ journal() {
+ const result = [];
+ result.push(`# Plan`);
+ result.push(this._plan);
+ result.push(`# Seed file: ${toPosixPath(import_path.default.relative(this._rootPath, this._seed.file))}`);
+ result.push("```ts");
+ result.push(this._seed.content);
+ result.push("```");
+ result.push(`# Steps`);
+ result.push(this._steps.map((step) => `### ${step.title}
+\`\`\`ts
+${step.code}
+\`\`\``).join("\n\n"));
+ result.push(bestPracticesMarkdown);
+ return result.join("\n\n");
+ }
+}
+class TestContext {
+ constructor(clientInfo, configPath, options) {
+ this._testOpQueue = Promise.resolve();
+ this._clientInfo = clientInfo;
+ this._configLocation = import_common.configLoader.resolveConfigLocation(configPath || clientInfo.cwd);
+ this.rootPath = clientInfo.cwd || this._configLocation.configDir;
+ if (options?.headless !== void 0)
+ this.computedHeaded = !options.headless;
+ else
+ this.computedHeaded = !process.env.CI && !(import_os.default.platform() === "linux" && !process.env.DISPLAY);
+ }
+ async _enqueue(fn) {
+ const next = this._testOpQueue.then(fn);
+ this._testOpQueue = next.then(() => {
+ }, () => {
+ });
+ return await next;
+ }
+ existingTestRunner() {
+ return this._testRunnerAndScreen?.testRunner;
+ }
+ async _cleanupTestRunner() {
+ if (!this._testRunnerAndScreen)
+ return;
+ await this._testRunnerAndScreen.testRunner.stopTests();
+ this._testRunnerAndScreen.claimStdio();
+ try {
+ await this._testRunnerAndScreen.testRunner.runGlobalTeardown();
+ } finally {
+ this._testRunnerAndScreen.releaseStdio();
+ this._testRunnerAndScreen = void 0;
+ }
+ }
+ async createTestRunner() {
+ await this._cleanupTestRunner();
+ const runner = new import_runner.testRunner.TestRunner(this._configLocation, {});
+ await runner.initialize({});
+ const testPaused = new ManualPromise();
+ const testRunnerAndScreen = {
+ ...createScreen(),
+ testRunner: runner,
+ waitForTestPaused: () => testPaused
+ };
+ this._testRunnerAndScreen = testRunnerAndScreen;
+ runner.on(import_runner.testRunner.TestRunnerEvent.TestPaused, (params) => {
+ testRunnerAndScreen.sendMessageToPausedTest = params.sendMessage;
+ testPaused.resolve();
+ });
+ return testRunnerAndScreen;
+ }
+ async getOrCreateSeedFile(seedFile, projectName) {
+ const configDir = this._configLocation.configDir;
+ const { testRunner: runner } = await this.createTestRunner();
+ const config = await runner.loadConfig();
+ const project = (0, import_seed.seedProject)(config, projectName);
+ if (!seedFile) {
+ seedFile = await (0, import_seed.ensureSeedFile)(project);
+ } else {
+ const candidateFiles = [];
+ const testDir = project.project.testDir;
+ candidateFiles.push(import_path.default.resolve(testDir, seedFile));
+ candidateFiles.push(import_path.default.resolve(configDir, seedFile));
+ candidateFiles.push(import_path.default.resolve(this.rootPath, seedFile));
+ let resolvedSeedFile;
+ for (const candidateFile of candidateFiles) {
+ if (await (0, import_util.fileExistsAsync)(candidateFile)) {
+ resolvedSeedFile = candidateFile;
+ break;
+ }
+ }
+ if (!resolvedSeedFile)
+ throw new Error("seed test not found.");
+ seedFile = resolvedSeedFile;
+ }
+ const seedFileContent = await import_fs.default.promises.readFile(seedFile, "utf8");
+ return {
+ file: seedFile,
+ content: seedFileContent,
+ projectName: project.project.name
+ };
+ }
+ async runSeedTest(seedFile, projectName, signal) {
+ const result = await this.runTestsWithGlobalSetupAndPossiblePause({
+ headed: this.computedHeaded,
+ locations: ["/" + escapeRegExp(seedFile) + "/"],
+ projects: [projectName],
+ timeout: 0,
+ workers: 1,
+ pauseAtEnd: true,
+ disableConfigReporters: true,
+ failOnLoadErrors: true
+ }, signal);
+ if (result.status === "passed")
+ result.output += "\nError: seed test not found.";
+ else if (result.status !== "paused")
+ result.output += "\nError while running the seed test.";
+ return result;
+ }
+ async runTestsWithGlobalSetupAndPossiblePause(params, signal) {
+ return this._enqueue(() => this._runTestsImpl(params, signal));
+ }
+ async _runTestsImpl(params, signal) {
+ const configDir = this._configLocation.configDir;
+ const testRunnerAndScreen = await this.createTestRunner();
+ const { testRunner: runner, screen, claimStdio, releaseStdio } = testRunnerAndScreen;
+ claimStdio();
+ try {
+ const setupReporter = new MCPListReporter({ configDir, screen, includeTestId: true });
+ const { status: status2 } = await runner.runGlobalSetup([setupReporter]);
+ if (status2 !== "passed")
+ return { output: testRunnerAndScreen.output.join("\n"), status: status2 };
+ } finally {
+ releaseStdio();
+ }
+ let status = "passed";
+ const cleanup = async () => {
+ claimStdio();
+ try {
+ const result = await runner.runGlobalTeardown();
+ if (status === "passed")
+ status = result.status;
+ } finally {
+ releaseStdio();
+ }
+ };
+ const abort = signal ? signalToPromise(signal) : void 0;
+ const abortPromise = abort ? abort.promise.then(() => "interrupted") : new Promise(() => {
+ });
+ try {
+ const reporter = new MCPListReporter({ configDir, screen, includeTestId: true });
+ status = await Promise.race([
+ runner.runTests(reporter, params).then((result) => result.status),
+ testRunnerAndScreen.waitForTestPaused().then(() => "paused"),
+ abortPromise
+ ]);
+ if (status === "interrupted") {
+ await runner.stopTests();
+ await cleanup();
+ return { output: testRunnerAndScreen.output.join("\n"), status };
+ }
+ if (status === "paused") {
+ const response = await testRunnerAndScreen.sendMessageToPausedTest({ request: { initialize: { clientInfo: this._clientInfo } } });
+ if (response.error)
+ throw new Error(response.error.message);
+ testRunnerAndScreen.output.push(response.response.initialize.pausedMessage);
+ return { output: testRunnerAndScreen.output.join("\n"), status };
+ }
+ } catch (e) {
+ status = "failed";
+ testRunnerAndScreen.output.push(String(e));
+ await cleanup();
+ return { output: testRunnerAndScreen.output.join("\n"), status };
+ } finally {
+ abort?.dispose();
+ }
+ await cleanup();
+ return { output: testRunnerAndScreen.output.join("\n"), status };
+ }
+ async close() {
+ await this._enqueue(() => this._cleanupTestRunner()).catch((e) => debug("pw:mcp:error")(e));
+ }
+ async sendMessageToPausedTest(request) {
+ const sendMessage = this._testRunnerAndScreen?.sendMessageToPausedTest;
+ if (!sendMessage)
+ throw new Error("Must setup test before interacting with the page");
+ const result = await sendMessage({ request });
+ if (result.error)
+ throw new Error(result.error.message);
+ if (typeof request?.callTool?.arguments?.["intent"] === "string") {
+ const response = import_coreBundle.tools.parseResponse(result.response.callTool);
+ if (response && !response.isError && response.code)
+ this.generatorJournal?.logStep(request.callTool.arguments["intent"], response.code);
+ }
+ return result.response;
+ }
+}
+function createScreen() {
+ const output = [];
+ const stdout = new import_streams.StringWriteStream(output, "stdout");
+ const stderr = new import_streams.StringWriteStream(output, "stderr");
+ const screen = {
+ ...import_runner.base.terminalScreen,
+ isTTY: false,
+ colors: noColors,
+ stdout,
+ stderr
+ };
+ const originalStdoutWrite = process.stdout.write;
+ const originalStderrWrite = process.stderr.write;
+ const claimStdio = () => {
+ process.stdout.write = (chunk) => {
+ stdout.write(chunk);
+ return true;
+ };
+ process.stderr.write = (chunk) => {
+ stderr.write(chunk);
+ return true;
+ };
+ };
+ const releaseStdio = () => {
+ process.stdout.write = originalStdoutWrite;
+ process.stderr.write = originalStderrWrite;
+ };
+ return { screen, claimStdio, releaseStdio, output };
+}
+const bestPracticesMarkdown = `
+# Best practices
+- Do not improvise, do not add directives that were not asked for
+- Use clear, descriptive assertions to validate the expected behavior
+- Use reliable locators from this log
+- Use local variables for locators that are used multiple times
+- Use Playwright waiting assertions and best practices from this log
+- NEVER! use page.waitForLoadState()
+- NEVER! use page.waitForNavigation()
+- NEVER! use page.waitForTimeout()
+- NEVER! use page.evaluate()
+`;
+class MCPListReporter extends import_runner.ListReporter {
+ async onTestPaused() {
+ await new Promise(() => {
+ });
+ }
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ GeneratorJournal,
+ TestContext,
+ createScreen
+});
diff --git a/node_modules/playwright/lib/mcp/test/testTool.js b/node_modules/playwright/lib/mcp/test/testTool.js
new file mode 100644
index 0000000..36f0f25
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/testTool.js
@@ -0,0 +1,30 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var testTool_exports = {};
+__export(testTool_exports, {
+ defineTestTool: () => defineTestTool
+});
+module.exports = __toCommonJS(testTool_exports);
+function defineTestTool(tool) {
+ return tool;
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ defineTestTool
+});
diff --git a/node_modules/playwright/lib/mcp/test/testTools.js b/node_modules/playwright/lib/mcp/test/testTools.js
new file mode 100644
index 0000000..0ed28b7
--- /dev/null
+++ b/node_modules/playwright/lib/mcp/test/testTools.js
@@ -0,0 +1,98 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var testTools_exports = {};
+__export(testTools_exports, {
+ debugTest: () => debugTest,
+ listTests: () => listTests,
+ runTests: () => runTests
+});
+module.exports = __toCommonJS(testTools_exports);
+var import_runner = require("../../runner");
+var import_testTool = require("./testTool");
+const z = require("playwright-core/lib/utilsBundle").z;
+const listTests = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "test_list",
+ title: "List tests",
+ description: "List tests",
+ inputSchema: z.object({}),
+ type: "readOnly"
+ },
+ handle: async (context) => {
+ const { testRunner, screen, output } = await context.createTestRunner();
+ const reporter = new import_runner.ListModeReporter({ screen, includeTestId: true });
+ await testRunner.listTests(reporter, {});
+ return { content: output.map((text) => ({ type: "text", text })) };
+ }
+});
+const runTests = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "test_run",
+ title: "Run tests",
+ description: "Run tests",
+ inputSchema: z.object({
+ locations: z.array(z.string()).optional().describe('Folder, file or location to run: "test/e2e" or "test/e2e/file.spec.ts" or "test/e2e/file.spec.ts:20"'),
+ projects: z.array(z.string()).optional().describe('Projects to run, projects from playwright.config.ts, by default runs all projects. Running with "chromium" is a good start')
+ }),
+ type: "readOnly"
+ },
+ handle: async (context, params, signal) => {
+ const { output } = await context.runTestsWithGlobalSetupAndPossiblePause({
+ locations: params.locations ?? [],
+ projects: params.projects,
+ disableConfigReporters: true
+ }, signal);
+ return { content: [{ type: "text", text: output }] };
+ }
+});
+const debugTest = (0, import_testTool.defineTestTool)({
+ schema: {
+ name: "test_debug",
+ title: "Debug single test",
+ description: "Debug single test",
+ inputSchema: z.object({
+ test: z.object({
+ id: z.string().describe("Test ID to debug."),
+ title: z.string().describe("Human readable test title for granting permission to debug the test.")
+ })
+ }),
+ type: "readOnly"
+ },
+ handle: async (context, params, signal) => {
+ const { output, status } = await context.runTestsWithGlobalSetupAndPossiblePause({
+ headed: context.computedHeaded,
+ locations: [],
+ // we can make this faster by passing the test's location, so we don't need to scan all tests to find the ID
+ testIds: [params.test.id],
+ // For automatic recovery
+ timeout: 0,
+ workers: 1,
+ pauseOnError: true,
+ disableConfigReporters: true,
+ actionTimeout: 5e3
+ }, signal);
+ return { content: [{ type: "text", text: output }], isError: status !== "paused" && status !== "passed" };
+ }
+});
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ debugTest,
+ listTests,
+ runTests
+});
diff --git a/node_modules/playwright/lib/package.js b/node_modules/playwright/lib/package.js
new file mode 100644
index 0000000..890926d
--- /dev/null
+++ b/node_modules/playwright/lib/package.js
@@ -0,0 +1,47 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var package_exports = {};
+__export(package_exports, {
+ libPath: () => libPath,
+ packageJSON: () => packageJSON,
+ packageRoot: () => packageRoot
+});
+module.exports = __toCommonJS(package_exports);
+var import_path = __toESM(require("path"));
+const packageRoot = import_path.default.join(__dirname, "..");
+const packageJSON = require(import_path.default.join(packageRoot, "package.json"));
+function libPath(...parts) {
+ return import_path.default.join(packageRoot, "lib", ...parts);
+}
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ libPath,
+ packageJSON,
+ packageRoot
+});
diff --git a/node_modules/playwright/lib/program.js b/node_modules/playwright/lib/program.js
new file mode 100644
index 0000000..0ee78eb
--- /dev/null
+++ b/node_modules/playwright/lib/program.js
@@ -0,0 +1,241 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var program_exports = {};
+__export(program_exports, {
+ program: () => program
+});
+module.exports = __toCommonJS(program_exports);
+var import_bootstrap = require("playwright-core/lib/bootstrap");
+var import_coreBundle = require("playwright-core/lib/coreBundle");
+var import_common = require("./common");
+var import_testActions = require("./cli/testActions");
+var import_reportActions = require("./cli/reportActions");
+var import_testBackend = require("./mcp/test/testBackend");
+var import_generateAgents = require("./agents/generateAgents");
+var import_package = require("./package");
+const { program } = require("playwright-core/lib/utilsBundle");
+const { setBoxedStackPrefixes } = require("playwright-core/lib/coreBundle").utils;
+const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
+setBoxedStackPrefixes([import_package.packageRoot]);
+import_coreBundle.libCli.decorateProgram(program);
+function addTestCommand(program2) {
+ const command = program2.command("test [test-filter...]");
+ command.description("run tests with Playwright Test");
+ const options = testOptions.sort((a, b) => a[0].replace(/-/g, "").localeCompare(b[0].replace(/-/g, "")));
+ options.forEach(([name, { description, choices, preset }]) => {
+ const option = command.createOption(name, description);
+ if (choices)
+ option.choices(choices);
+ if (preset)
+ option.preset(preset);
+ command.addOption(option);
+ return command;
+ });
+ command.action(async (args, opts) => {
+ const dashDashIndex = process.argv.indexOf("--");
+ const postDashCount = dashDashIndex >= 0 ? process.argv.length - 1 - dashDashIndex : 0;
+ const testFilters = args.slice(0, args.length - postDashCount);
+ try {
+ await (0, import_testActions.runTests)(testFilters, opts);
+ } catch (e) {
+ console.error(e);
+ gracefullyProcessExitDoNotHang(1);
+ }
+ });
+ command.addHelpText("afterAll", `
+Arguments [test-filter...]:
+ Pass arguments to filter test files. Each argument is treated as a regular expression. Matching is performed against the absolute file paths.
+
+Examples:
+ $ npx playwright test my.spec.ts
+ $ npx playwright test some.spec.ts:42
+ $ npx playwright test --headed
+ $ npx playwright test --project=webkit`);
+}
+function addClearCacheCommand(program2) {
+ const command = program2.command("clear-cache");
+ command.description("clears build and test caches");
+ command.option("-c, --config ", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
+ command.action(async (opts) => {
+ await (0, import_testActions.clearCache)(opts);
+ });
+}
+function addTestServerCommand(program2) {
+ const command = program2.command("test-server", { hidden: true });
+ command.description("start test server");
+ command.option("-c, --config ", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
+ command.option("--host ", "Host to start the server on", "localhost");
+ command.option("--port ", "Port to start the server on", "0");
+ command.action(async (opts) => {
+ await (0, import_testActions.runTestServerAction)(opts);
+ });
+}
+function addShowReportCommand(program2) {
+ const command = program2.command("show-report [report]");
+ command.description("show HTML report");
+ command.action(async (report, options) => {
+ await (0, import_reportActions.showReport)(report, options.host, +options.port);
+ });
+ command.option("--host ", "Host to serve report on", "localhost");
+ command.option("--port ", "Port to serve report on", "9323");
+ command.addHelpText("afterAll", `
+Arguments [report]:
+ When specified, opens given report, otherwise opens last generated report.
+ Accepts a directory or a .zip archive whose top-level entry is "index.html" (e.g. one downloaded from a CI artifact).
+
+Examples:
+ $ npx playwright show-report
+ $ npx playwright show-report playwright-report
+ $ npx playwright show-report playwright-report.zip`);
+}
+function addMergeReportsCommand(program2) {
+ const command = program2.command("merge-reports [dir]");
+ command.description("merge multiple blob reports (for sharded tests) into a single report");
+ command.action(async (dir, options) => {
+ try {
+ await (0, import_reportActions.mergeReports)(dir, options);
+ } catch (e) {
+ console.error(e);
+ gracefullyProcessExitDoNotHang(1);
+ }
+ });
+ command.option("-c, --config ", `Configuration file. Can be used to specify additional configuration for the output report.`);
+ command.option("--reporter ", `Reporter to use, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_common.config.defaultReporter}")`);
+ command.addHelpText("afterAll", `
+Arguments [dir]:
+ Directory containing blob reports.
+
+Examples:
+ $ npx playwright merge-reports playwright-report`);
+}
+function addTestMCPServerCommand(program2) {
+ const command = program2.command("run-test-mcp-server", { hidden: true });
+ command.description("Interact with the test runner over MCP");
+ command.option("--headless", "run browser in headless mode, headed by default");
+ command.option("-c, --config ", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
+ command.option("--host ", "host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.");
+ command.option("--port ", "port to listen on for SSE transport.");
+ command.action(async (options) => {
+ import_coreBundle.tools.setupExitWatchdog();
+ const factory = {
+ name: "Playwright Test Runner",
+ nameInConfig: "playwright-test-runner",
+ version: import_package.packageJSON.version,
+ toolSchemas: import_testBackend.testServerBackendTools.map((tool) => tool.schema),
+ create: async () => new import_testBackend.TestServerBackend(options.config, { muteConsole: options.port === void 0, headless: options.headless })
+ };
+ await import_coreBundle.tools.start(factory, { port: options.port === void 0 ? void 0 : +options.port, host: options.host });
+ });
+}
+function addInitAgentsCommand(program2) {
+ const command = program2.command("init-agents");
+ command.description("Initialize repository agents");
+ const option = command.createOption("--loop ", "Agentic loop provider");
+ option.choices(["claude", "codex", "copilot", "opencode", "vscode", "vscode-legacy"]);
+ command.addOption(option);
+ command.option("-c, --config ", `Configuration file to find a project to use for seed test`);
+ command.option("--project ", "Project to use for seed test");
+ command.option("--prompts", "Whether to include prompts in the agent initialization");
+ command.action(async (opts) => {
+ const loadedConfig = await import_common.configLoader.loadConfigFromFile(opts.config);
+ if (opts.loop === "opencode") {
+ await import_generateAgents.OpencodeGenerator.init(loadedConfig, opts.project, opts.prompts);
+ } else if (opts.loop === "vscode-legacy") {
+ await import_generateAgents.VSCodeGenerator.init(loadedConfig, opts.project);
+ } else if (opts.loop === "claude") {
+ await import_generateAgents.ClaudeGenerator.init(loadedConfig, opts.project, opts.prompts);
+ } else if (opts.loop === "codex") {
+ await import_generateAgents.CodexGenerator.init(loadedConfig, opts.project, opts.prompts);
+ } else {
+ await import_generateAgents.CopilotGenerator.init(loadedConfig, opts.project, opts.prompts);
+ return;
+ }
+ });
+}
+function addInitSkillsCommand(program2) {
+ const command = program2.command("init-skills");
+ command.description("Install Playwright agent skills");
+ const option = command.createOption("--loop ", "Agentic loop provider");
+ option.choices(["claude", "agents"]);
+ option.default("claude");
+ command.addOption(option);
+ command.action(async (opts) => {
+ try {
+ await import_coreBundle.tools.installSkills(import_coreBundle.tools.allSkills, opts.loop);
+ } catch (e) {
+ console.error(e);
+ gracefullyProcessExitDoNotHang(1);
+ }
+ });
+}
+const kTraceModes = ["on", "off", "on-first-retry", "on-all-retries", "retain-on-failure", "retain-on-first-failure", "retain-on-failure-and-retries"];
+const testOptions = [
+ ["--add-reporter ", { description: `Reporter to add on top of the configured reporters, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} or a path to a reporter module` }],
+ /* deprecated */
+ ["--browser ", { description: `Browser to use for tests, one of "all", "chromium", "firefox" or "webkit" (default: "chromium")` }],
+ ["-c, --config ", { description: `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"` }],
+ ["--debug [mode]", { description: `Run tests with Playwright Inspector. Shortcut for "PWDEBUG=1" environment variable and "--timeout=0 --max-failures=1 --headed --workers=1" options`, choices: ["inspector", "cli"], preset: "inspector" }],
+ ["--fail-on-flaky-tests", { description: `Fail if any test is flagged as flaky (default: false)` }],
+ ["--forbid-only", { description: `Fail if test.only is called (default: false)` }],
+ ["--fully-parallel", { description: `Run all tests in parallel (default: false)` }],
+ ["--global-timeout ", { description: `Maximum time this test suite can run in milliseconds (default: unlimited)` }],
+ ["-g, --grep ", { description: `Only run tests matching this regular expression (default: ".*")` }],
+ ["-G, --grep-invert ", { description: `Only run tests that do not match this regular expression` }],
+ ["--headed", { description: `Run tests in headed browsers (default: headless)` }],
+ ["--ignore-snapshots", { description: `Ignore screenshot and snapshot expectations` }],
+ ["--last-failed", { description: `Only re-run the failures` }],
+ ["--last-failed-file ", { description: `Override the default path for the last-run JSON file used with --last-failed (default: /.last-run.json). Same as PLAYWRIGHT_LAST_RUN_OUTPUT_FILE environment variable.` }],
+ ["--list", { description: `Collect all the tests and report them, but do not run` }],
+ ["--max-failures ", { description: `Stop after the first N failures` }],
+ ["--no-deps", { description: `Do not run project dependencies` }],
+ ["--output ", { description: `Folder for output artifacts (default: "test-results")` }],
+ ["--only-changed [ref]", { description: `Only run test files that have been changed between 'HEAD' and 'ref'. Defaults to running all uncommitted changes. Only supports Git.` }],
+ ["--pass-with-no-tests", { description: `Makes test run succeed even if no tests were found` }],
+ ["--project ", { description: `Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects)` }],
+ ["--quiet", { description: `Suppress stdio` }],
+ ["--repeat-each ", { description: `Run each test N times (default: 1)` }],
+ ["--reporter ", { description: `Reporter to use, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_common.config.defaultReporter}")` }],
+ ["--retries ", { description: `Maximum retry count for flaky tests, zero for no retries (default: no retries)` }],
+ ["--run-agents ", { description: `Run agents to generate the code for page.perform`, choices: ["missing", "all", "none"], preset: "none" }],
+ ["--shard ", { description: `Shard tests and execute only the selected shard, specify in the form "current/all", 1-based, for example "3/5"` }],
+ ["--test-list ", { description: `Path to a file containing a list of tests to run. See https://playwright.dev/docs/test-cli for more details.` }],
+ ["--test-list-invert ", { description: `Path to a file containing a list of tests to skip. See https://playwright.dev/docs/test-cli for more details.` }],
+ ["--timeout ", { description: `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${import_common.config.defaultTimeout})` }],
+ ["--trace ", { description: `Force tracing mode`, choices: kTraceModes }],
+ ["--tsconfig ", { description: `Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately)` }],
+ ["--ui", { description: `Run tests in interactive UI mode` }],
+ ["--ui-host ", { description: `Host to serve UI on; specifying this option opens UI in a browser tab` }],
+ ["--ui-port ", { description: `Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab` }],
+ ["-u, --update-snapshots [mode]", { description: `Update snapshots with actual results. Running tests without the flag defaults to "missing"`, choices: ["all", "changed", "missing", "none"], preset: "changed" }],
+ ["--update-source-method ", { description: `Chooses the way source is updated (default: "patch")`, choices: ["overwrite", "3way", "patch"] }],
+ ["-j, --workers ", { description: `Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%)` }],
+ ["-x", { description: `Stop after the first failure` }]
+];
+addTestCommand(program);
+addShowReportCommand(program);
+addMergeReportsCommand(program);
+addClearCacheCommand(program);
+addTestMCPServerCommand(program);
+addTestServerCommand(program);
+addInitAgentsCommand(program);
+addInitSkillsCommand(program);
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ program
+});
diff --git a/node_modules/playwright/package.json b/node_modules/playwright/package.json
new file mode 100644
index 0000000..ba8d32d
--- /dev/null
+++ b/node_modules/playwright/package.json
@@ -0,0 +1,55 @@
+{
+ "name": "playwright",
+ "version": "1.63.0",
+ "description": "A high-level API to automate web browsers",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/microsoft/playwright.git"
+ },
+ "homepage": "https://playwright.dev",
+ "engines": {
+ "node": ">=20"
+ },
+ "main": "index.js",
+ "exports": {
+ ".": {
+ "types": "./index.d.ts",
+ "import": "./index.mjs",
+ "require": "./index.js",
+ "default": "./index.js"
+ },
+ "./package.json": "./package.json",
+ "./lib/common": "./lib/common/index.js",
+ "./lib/program": "./lib/program.js",
+ "./lib/runner": "./lib/runner/index.js",
+ "./lib/transform/babelBundle": "./lib/transform/babelBundle.js",
+ "./jsx-runtime": {
+ "import": "./jsx-runtime.mjs",
+ "require": "./jsx-runtime.js",
+ "default": "./jsx-runtime.js"
+ },
+ "./lib/util": "./lib/util.js",
+ "./types/test": {
+ "types": "./types/test.d.ts"
+ },
+ "./types/testReporter": {
+ "types": "./types/testReporter.d.ts"
+ },
+ "./test": {
+ "types": "./test.d.ts",
+ "import": "./test.mjs",
+ "require": "./test.js",
+ "default": "./test.js"
+ }
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "author": {
+ "name": "Microsoft Corporation"
+ },
+ "license": "Apache-2.0",
+ "dependencies": {
+ "playwright-core": "1.63.0"
+ }
+}
diff --git a/node_modules/playwright/test.d.ts b/node_modules/playwright/test.d.ts
new file mode 100644
index 0000000..4369d23
--- /dev/null
+++ b/node_modules/playwright/test.d.ts
@@ -0,0 +1,18 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export * from './types/test';
+export { default } from './types/test';
diff --git a/node_modules/playwright/test.js b/node_modules/playwright/test.js
new file mode 100644
index 0000000..42af955
--- /dev/null
+++ b/node_modules/playwright/test.js
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const pwt = require('./lib/index');
+const playwright = require('./index');
+const combinedExports = {
+ ...playwright,
+ ...pwt,
+};
+
+module.exports = Object.assign(combinedExports.test, combinedExports);
diff --git a/node_modules/playwright/test.mjs b/node_modules/playwright/test.mjs
new file mode 100644
index 0000000..69c5f64
--- /dev/null
+++ b/node_modules/playwright/test.mjs
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import playwright from './test.js';
+
+export const chromium = playwright.chromium;
+export const firefox = playwright.firefox;
+export const webkit = playwright.webkit;
+export const selectors = playwright.selectors;
+export const devices = playwright.devices;
+export const errors = playwright.errors;
+export const request = playwright.request;
+export const _electron = playwright._electron;
+export const _android = playwright._android;
+export const _baseTest = playwright._baseTest;
+export const _utilityTest = playwright._utilityTest;
+export const test = playwright.test;
+export const expect = playwright.expect;
+export const defineConfig = playwright.defineConfig;
+export const mergeTests = playwright.mergeTests;
+export const mergeExpects = playwright.mergeExpects;
+export default playwright.test;
diff --git a/node_modules/playwright/types/test.d.ts b/node_modules/playwright/types/test.d.ts
new file mode 100644
index 0000000..907a6da
--- /dev/null
+++ b/node_modules/playwright/types/test.d.ts
@@ -0,0 +1,11074 @@
+// This file is generated by /utils/generate_types/index.js
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions } from 'playwright-core';
+export * from 'playwright-core';
+
+export type BlobReporterOptions = { outputDir?: string, fileName?: string };
+export type DotReporterOptions = { omitTags?: boolean };
+export type LineReporterOptions = { omitTags?: boolean };
+export type ListReporterOptions = { printSteps?: boolean, printFailuresInline?: boolean, omitTags?: boolean };
+export type GitHubReporterOptions = { omitTags?: boolean };
+export type JUnitReporterOptions = { outputFile?: string, stripANSIControlSequences?: boolean, includeProjectInTestName?: boolean, includeRetries?: boolean, omitTags?: boolean };
+export type JsonReporterOptions = { outputFile?: string };
+export type PerfettoReporterOptions = { outputFile?: string };
+export type HtmlReporterOptions = {
+ outputFolder?: string;
+ open?: 'always' | 'never' | 'on-failure';
+ host?: string;
+ port?: number;
+ attachmentsBaseURL?: string;
+ title?: string;
+ noSnippets?: boolean;
+ noCopyPrompt?: boolean;
+ doNotInlineAssets?: boolean;
+ mergeFiles?: boolean;
+};
+
+export type ReporterDescription = Readonly<
+ ['blob'] | ['blob', BlobReporterOptions] |
+ ['dot'] | ['dot', DotReporterOptions] |
+ ['line'] | ['line', LineReporterOptions] |
+ ['list'] | ['list', ListReporterOptions] |
+ ['github'] | ['github', GitHubReporterOptions] |
+ ['junit'] | ['junit', JUnitReporterOptions] |
+ ['json'] | ['json', JsonReporterOptions] |
+ ['perfetto'] | ['perfetto', PerfettoReporterOptions] |
+ ['html'] | ['html', HtmlReporterOptions] |
+ ['null'] |
+ [string] | [string, any]
+>;
+
+type UseOptions = Partial & Partial;
+
+/**
+ * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in
+ * multiple configurations. For example, consider running tests against multiple browsers. This type describes format
+ * of a project in the configuration file, to access resolved configuration parameters at run time use
+ * [FullProject](https://playwright.dev/docs/api/class-fullproject).
+ *
+ * `TestProject` encapsulates configuration specific to a single project. Projects are configured in
+ * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects) specified in the
+ * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of
+ * [TestProject](https://playwright.dev/docs/api/class-testproject) are available in the top-level
+ * [TestConfig](https://playwright.dev/docs/api/class-testconfig), in which case they are shared between all projects.
+ *
+ * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile
+ * versions.
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig, devices } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * // Options shared for all projects.
+ * timeout: 30000,
+ * use: {
+ * ignoreHTTPSErrors: true,
+ * },
+ *
+ * // Options specific to each project.
+ * projects: [
+ * {
+ * name: 'chromium',
+ * use: devices['Desktop Chrome'],
+ * },
+ * {
+ * name: 'firefox',
+ * use: devices['Desktop Firefox'],
+ * },
+ * {
+ * name: 'webkit',
+ * use: devices['Desktop Safari'],
+ * },
+ * {
+ * name: 'Mobile Chrome',
+ * use: devices['Pixel 5'],
+ * },
+ * {
+ * name: 'Mobile Safari',
+ * use: devices['iPhone 12'],
+ * },
+ * ],
+ * });
+ * ```
+ *
+ */
+interface TestProject {
+ /**
+ * Options for all tests in this project, for example
+ * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more
+ * about [configuration](https://playwright.dev/docs/test-configuration) and see
+ * [available options][TestOptions](https://playwright.dev/docs/api/class-testoptions).
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'Chromium',
+ * use: {
+ * browserName: 'chromium',
+ * },
+ * },
+ * ],
+ * });
+ * ```
+ *
+ * Use [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) to change this option for
+ * all projects.
+ */
+ use?: UseOptions;
+ /**
+ * List of projects that need to run before any test in this project runs. Dependencies can be useful for configuring
+ * the global setup actions in a way that every action is in a form of a test. Passing `--no-deps` argument ignores
+ * the dependencies and behaves as if they were not specified.
+ *
+ * Using dependencies allows global setup to produce traces and other artifacts, see the setup steps in the test
+ * report, etc.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'setup',
+ * testMatch: /global.setup\.ts/,
+ * },
+ * {
+ * name: 'chromium',
+ * use: devices['Desktop Chrome'],
+ * dependencies: ['setup'],
+ * },
+ * {
+ * name: 'firefox',
+ * use: devices['Desktop Firefox'],
+ * dependencies: ['setup'],
+ * },
+ * {
+ * name: 'webkit',
+ * use: devices['Desktop Safari'],
+ * dependencies: ['setup'],
+ * },
+ * ],
+ * });
+ * ```
+ *
+ */
+ dependencies?: Array;
+
+ /**
+ * Configuration for the `expect` assertion library.
+ *
+ * Use [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect) to change this option
+ * for all projects.
+ */
+ expect?: {
+ /**
+ * Default timeout for async expect matchers in milliseconds, defaults to 5000ms.
+ */
+ timeout?: number;
+
+ /**
+ * Configuration for the
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1)
+ * method.
+ */
+ toHaveScreenshot?: {
+ /**
+ * an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and
+ * `1` (lax). `"pixelmatch"` comparator computes color difference in
+ * [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
+ */
+ threshold?: number;
+
+ /**
+ * an acceptable amount of pixels that could be different, unset by default.
+ */
+ maxDiffPixels?: number;
+
+ /**
+ * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
+ */
+ maxDiffPixelRatio?: number;
+
+ /**
+ * See [`animations`](https://playwright.dev/docs/api/class-page#page-screenshot-option-animations) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to `"disabled"`.
+ */
+ animations?: "allow"|"disabled";
+
+ /**
+ * See [`caret`](https://playwright.dev/docs/api/class-page#page-screenshot-option-caret) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to `"hide"`.
+ */
+ caret?: "hide"|"initial";
+
+ /**
+ * See [`scale`](https://playwright.dev/docs/api/class-page#page-screenshot-option-scale) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to `"css"`.
+ */
+ scale?: "css"|"device";
+
+ /**
+ * See [`style`](https://playwright.dev/docs/api/class-page#page-screenshot-option-style) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot).
+ */
+ stylePath?: string|Array;
+
+ /**
+ * A template controlling location of the screenshots. See
+ * [testProject.snapshotPathTemplate](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template)
+ * for details.
+ */
+ pathTemplate?: string;
+
+ /**
+ * Default timeout for
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1)
+ * in milliseconds, defaults to the global expect timeout. Setting to `0` disables the timeout.
+ */
+ timeout?: number;
+ };
+
+ /**
+ * Configuration for the
+ * [expect(locator).toMatchAriaSnapshot([options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot-2)
+ * method.
+ */
+ toMatchAriaSnapshot?: {
+ /**
+ * A template controlling location of the aria snapshots. See
+ * [testProject.snapshotPathTemplate](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template)
+ * for details.
+ */
+ pathTemplate?: string;
+
+ /**
+ * Controls how children of the snapshot root are matched against the actual accessibility tree. This is equivalent to
+ * adding a `/children` property at the top of every aria snapshot template. Individual snapshots can override this by
+ * including an explicit `/children` property.
+ */
+ children?: "contain"|"equal"|"deep-equal";
+ };
+
+ /**
+ * Configuration for the
+ * [expect(value).toMatchSnapshot(name[, options])](https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1)
+ * method.
+ */
+ toMatchSnapshot?: {
+ /**
+ * an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and
+ * `1` (lax). `"pixelmatch"` comparator computes color difference in
+ * [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
+ */
+ threshold?: number;
+
+ /**
+ * an acceptable amount of pixels that could be different, unset by default.
+ */
+ maxDiffPixels?: number;
+
+ /**
+ * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
+ */
+ maxDiffPixelRatio?: number;
+ };
+
+ /**
+ * Configuration for the [expect(value).toPass()](https://playwright.dev/docs/test-assertions) method.
+ */
+ toPass?: {
+ /**
+ * timeout for toPass method in milliseconds.
+ */
+ timeout?: number;
+
+ /**
+ * probe intervals for toPass method in milliseconds.
+ */
+ intervals?: Array;
+ };
+ };
+
+ /**
+ * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the
+ * same time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same
+ * worker process.
+ *
+ * You can configure entire test project to concurrently run all tests in all files using this option.
+ */
+ fullyParallel?: boolean;
+
+ /**
+ * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
+ * run tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g`
+ * option. The regular expression will be tested against the string that consists of the project name, the test file
+ * name, the `test.describe` name (if any), the test name and the test tags divided by spaces, e.g. `chromium
+ * my-test.spec.ts my-suite my-test`.
+ *
+ * `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
+ */
+ grep?: RegExp|Array;
+
+ /**
+ * Filter to only run tests with a title **not** matching any of the patterns. This is the opposite of
+ * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally
+ * and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
+ *
+ * `grepInvert` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
+ */
+ grepInvert?: RegExp|Array;
+
+ /**
+ * Whether to skip snapshot expectations, such as `expect(value).toMatchSnapshot()` and `await
+ * expect(page).toHaveScreenshot()`.
+ *
+ * **Usage**
+ *
+ * The following example will only perform screenshot assertions on Chromium.
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'chromium',
+ * use: devices['Desktop Chrome'],
+ * },
+ * {
+ * name: 'firefox',
+ * use: devices['Desktop Firefox'],
+ * ignoreSnapshots: true,
+ * },
+ * {
+ * name: 'webkit',
+ * use: devices['Desktop Safari'],
+ * ignoreSnapshots: true,
+ * },
+ * ],
+ * });
+ * ```
+ *
+ */
+ ignoreSnapshots?: boolean;
+
+ /**
+ * Metadata that will be put directly to the test report serialized as JSON.
+ */
+ metadata?: Metadata;
+
+ /**
+ * Project name is visible in the report and during test execution.
+ *
+ * **NOTE** Playwright executes the configuration file multiple times. Do not dynamically produce non-stable values in
+ * your configuration.
+ *
+ */
+ name?: string;
+
+ /**
+ * The output directory for files created during test execution. Defaults to `/test-results`.
+ *
+ * This directory is cleaned at the start. When running a test, a unique subdirectory inside the
+ * [testProject.outputDir](https://playwright.dev/docs/api/class-testproject#test-project-output-dir) is created,
+ * guaranteeing that test running in parallel do not conflict. This directory can be accessed by
+ * [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir) and
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path).
+ *
+ * Here is an example that uses
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to
+ * create a temporary file.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ * import fs from 'fs';
+ *
+ * test('example test', async ({}, testInfo) => {
+ * const file = testInfo.outputPath('temporary-file.txt');
+ * await fs.promises.writeFile(file, 'Put some data to the file', 'utf8');
+ * });
+ * ```
+ *
+ * Use [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir) to change this
+ * option for all projects.
+ */
+ outputDir?: string;
+
+ /**
+ * The number of times to repeat each test, useful for debugging flaky tests.
+ *
+ * Use [testConfig.repeatEach](https://playwright.dev/docs/api/class-testconfig#test-config-repeat-each) to change
+ * this option for all projects.
+ */
+ repeatEach?: number;
+
+ /**
+ * Whether to skip entries from `.gitignore` when searching for test files. By default, if neither
+ * [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) nor
+ * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir) are explicitly
+ * specified, Playwright will ignore any test files matching `.gitignore` entries. This option allows to override that
+ * behavior.
+ */
+ respectGitIgnore?: boolean;
+
+ /**
+ * The maximum number of retry attempts given to failed tests. Learn more about
+ * [test retries](https://playwright.dev/docs/test-retries#retries).
+ *
+ * Use [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) to
+ * change the number of retries for a specific file or a group of tests.
+ *
+ * Use [testConfig.retries](https://playwright.dev/docs/api/class-testconfig#test-config-retries) to change this
+ * option for all projects.
+ */
+ retries?: number;
+
+ /**
+ * The base directory, relative to the config file, for snapshot files created with `toMatchSnapshot`. Defaults to
+ * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir).
+ *
+ * The directory for each test can be accessed by
+ * [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir) and
+ * [testInfo.snapshotPath(...name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path).
+ *
+ * This path will serve as the base directory for each test file snapshot directory. Setting `snapshotDir` to
+ * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir)
+ * would resolve to `snapshots/a.spec.js-snapshots`.
+ */
+ snapshotDir?: string;
+
+ /**
+ * This option configures a template controlling location of snapshots generated by
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1),
+ * [expect(locator).toMatchAriaSnapshot([options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot-2)
+ * and
+ * [expect(value).toMatchSnapshot(name[, options])](https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1).
+ *
+ * You can configure templates for each assertion separately in
+ * [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * testDir: './tests',
+ *
+ * // Single template for all assertions
+ * snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}',
+ *
+ * // Assertion-specific templates
+ * expect: {
+ * toHaveScreenshot: {
+ * pathTemplate: '{testDir}/__screenshots__{/projectName}/{testFilePath}/{arg}{ext}',
+ * },
+ * toMatchAriaSnapshot: {
+ * pathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}',
+ * },
+ * },
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * The value might include some "tokens" that will be replaced with actual values during test execution.
+ *
+ * Consider the following file structure:
+ *
+ * ```txt
+ * playwright.config.ts
+ * tests/
+ * └── page/
+ * └── page-click.spec.ts
+ * ```
+ *
+ * And the following `page-click.spec.ts` that uses `toHaveScreenshot()` call:
+ *
+ * ```js
+ * // page-click.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('suite', () => {
+ * test('test should work', async ({ page }) => {
+ * await expect(page).toHaveScreenshot(['foo', 'bar', 'baz.png']);
+ * });
+ * });
+ * ```
+ *
+ * The list of supported tokens:
+ * - `{arg}` - Relative snapshot path **without extension**. This comes from the arguments passed to
+ * `toHaveScreenshot()`, `toMatchAriaSnapshot()` or `toMatchSnapshot()`; if called without arguments, this will be
+ * an auto-generated snapshot name.
+ * - Value: `foo/bar/baz`
+ * - `{ext}` - Snapshot extension (with the leading dot).
+ * - Value: `.png`
+ * - `{platform}` - The value of `process.platform`.
+ * - `{projectName}` - Project's file-system-sanitized name, if any.
+ * - Value: `''` (empty string).
+ * - `{snapshotDir}` - Project's
+ * [testProject.snapshotDir](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-dir).
+ * - Value: `/home/playwright/tests` (since `snapshotDir` is not provided in config, it defaults to `testDir`)
+ * - `{testDir}` - Project's
+ * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir).
+ * - Value: `/home/playwright/tests` (absolute path since `testDir` is resolved relative to directory with
+ * config)
+ * - `{testFileDir}` - Directories in relative path from `testDir` to **test file**.
+ * - Value: `page`
+ * - `{testFileBaseName}` - Test file name without the last extension.
+ * - Value: `page-click.spec`
+ * - `{testFileName}` - Test file name with extension.
+ * - Value: `page-click.spec.ts`
+ * - `{testFilePath}` - Relative path from `testDir` to **test file**.
+ * - Value: `page/page-click.spec.ts`
+ * - `{testName}` - File-system-sanitized test title, including parent describes but excluding file name.
+ * - Value: `suite-test-should-work`
+ *
+ * Each token can be preceded with a single character that will be used **only if** this token has non-empty value.
+ *
+ * Consider the following config:
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * snapshotPathTemplate: '__screenshots__{/projectName}/{testFilePath}/{arg}{ext}',
+ * testMatch: 'example.spec.ts',
+ * projects: [
+ * { use: { browserName: 'firefox' } },
+ * { name: 'chromium', use: { browserName: 'chromium' } },
+ * ],
+ * });
+ * ```
+ *
+ * In this config:
+ * 1. First project **does not** have a name, so its snapshots will be stored in
+ * `/__screenshots__/example.spec.ts/...`.
+ * 1. Second project **does** have a name, so its snapshots will be stored in
+ * `/__screenshots__/chromium/example.spec.ts/..`.
+ * 1. Since `snapshotPathTemplate` resolves to relative path, it will be resolved relative to `configDir`.
+ * 1. Forward slashes `"/"` can be used as path separators on any platform.
+ */
+ snapshotPathTemplate?: string;
+
+ /**
+ * Name of a project that needs to run after this and all dependent projects have finished. Teardown is useful to
+ * cleanup any resources acquired by this project.
+ *
+ * Passing `--no-deps` argument ignores
+ * [testProject.teardown](https://playwright.dev/docs/api/class-testproject#test-project-teardown) and behaves as if
+ * it was not specified.
+ *
+ * **Usage**
+ *
+ * A common pattern is a "setup" dependency that has a corresponding "teardown":
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'setup',
+ * testMatch: /global.setup\.ts/,
+ * teardown: 'teardown',
+ * },
+ * {
+ * name: 'teardown',
+ * testMatch: /global.teardown\.ts/,
+ * },
+ * {
+ * name: 'chromium',
+ * use: devices['Desktop Chrome'],
+ * dependencies: ['setup'],
+ * },
+ * {
+ * name: 'firefox',
+ * use: devices['Desktop Firefox'],
+ * dependencies: ['setup'],
+ * },
+ * {
+ * name: 'webkit',
+ * use: devices['Desktop Safari'],
+ * dependencies: ['setup'],
+ * },
+ * ],
+ * });
+ * ```
+ *
+ */
+ teardown?: string;
+
+ /**
+ * Directory that will be recursively scanned for test files. Defaults to the directory of the configuration file.
+ *
+ * Each project can use a different directory. Here is an example that runs smoke tests in three browsers and all
+ * other tests in stable Chrome browser.
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'Smoke Chromium',
+ * testDir: './smoke-tests',
+ * use: {
+ * browserName: 'chromium',
+ * }
+ * },
+ * {
+ * name: 'Smoke WebKit',
+ * testDir: './smoke-tests',
+ * use: {
+ * browserName: 'webkit',
+ * }
+ * },
+ * {
+ * name: 'Smoke Firefox',
+ * testDir: './smoke-tests',
+ * use: {
+ * browserName: 'firefox',
+ * }
+ * },
+ * {
+ * name: 'Chrome Stable',
+ * testDir: './',
+ * use: {
+ * browserName: 'chromium',
+ * channel: 'chrome',
+ * }
+ * },
+ * ],
+ * });
+ * ```
+ *
+ * Use [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) to change this
+ * option for all projects.
+ */
+ testDir?: string;
+
+ /**
+ * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute
+ * file path. Strings are treated as glob patterns.
+ *
+ * For example, `'**\/test-assets/**'` will ignore any files in the `test-assets` directory.
+ *
+ * Use [testConfig.testIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-test-ignore) to change
+ * this option for all projects.
+ */
+ testIgnore?: string|RegExp|Array;
+
+ /**
+ * Only the files matching one of these patterns are executed as test files. Matching is performed against the
+ * absolute file path. Strings are treated as glob patterns.
+ *
+ * By default, Playwright looks for files matching the following glob pattern: `**\/*.@(spec|test).?(c|m)[jt]s?(x)`.
+ * This means JavaScript or TypeScript files with `".test"` or `".spec"` suffix, for example
+ * `login-screen.wrong-credentials.spec.ts`.
+ *
+ * Use [testConfig.testMatch](https://playwright.dev/docs/api/class-testconfig#test-config-test-match) to change this
+ * option for all projects.
+ */
+ testMatch?: string|RegExp|Array;
+
+ /**
+ * Timeout for each test in milliseconds. Defaults to 30 seconds.
+ *
+ * This is a base timeout for all tests. Each test can configure its own timeout with
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout). Each file or a group of
+ * tests can configure the timeout with
+ * [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure).
+ *
+ * Use [testConfig.timeout](https://playwright.dev/docs/api/class-testconfig#test-config-timeout) to change this
+ * option for all projects.
+ */
+ timeout?: number;
+
+ /**
+ * The maximum number of concurrent worker processes to use for parallelizing tests from this project. Can also be set
+ * as percentage of logical CPU cores, e.g. `'50%'.`
+ *
+ * This could be useful, for example, when all tests from a project share a single resource like a test account, and
+ * therefore cannot be executed in parallel. Limiting workers to one for such a project will prevent simultaneous use
+ * of the shared resource.
+ *
+ * Note that the global [testConfig.workers](https://playwright.dev/docs/api/class-testconfig#test-config-workers)
+ * limit applies to the total number of worker processes. However, Playwright will limit the number of workers used
+ * for this project by the value of
+ * [testProject.workers](https://playwright.dev/docs/api/class-testproject#test-project-workers).
+ *
+ * By default, there is no limit per project. See
+ * [testConfig.workers](https://playwright.dev/docs/api/class-testconfig#test-config-workers) for the default of the
+ * total worker limit.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * workers: 10, // total workers limit
+ *
+ * projects: [
+ * {
+ * name: 'runs in parallel',
+ * },
+ * {
+ * name: 'one at a time',
+ * workers: 1, // workers limit for this project
+ * },
+ * ],
+ * });
+ * ```
+ *
+ */
+ workers?: number|string;
+}
+
+export interface Project extends TestProject {
+}
+
+/**
+ * Runtime representation of the test project configuration. It is accessible in the tests via
+ * [testInfo.project](https://playwright.dev/docs/api/class-testinfo#test-info-project) and
+ * [workerInfo.project](https://playwright.dev/docs/api/class-workerinfo#worker-info-project) and is passed to the
+ * test reporters. To see the format of the project in the Playwright configuration file please see
+ * [TestProject](https://playwright.dev/docs/api/class-testproject) instead.
+ */
+export interface FullProject {
+ /**
+ * See [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
+ */
+ use: UseOptions;
+ /**
+ * See [testProject.dependencies](https://playwright.dev/docs/api/class-testproject#test-project-dependencies).
+ */
+ dependencies: Array;
+
+ /**
+ * See [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep).
+ */
+ grep: RegExp|Array;
+
+ /**
+ * See [testProject.grepInvert](https://playwright.dev/docs/api/class-testproject#test-project-grep-invert).
+ */
+ grepInvert: null|RegExp|Array;
+
+ /**
+ * See [testProject.ignoreSnapshots](https://playwright.dev/docs/api/class-testproject#test-project-ignore-snapshots).
+ */
+ ignoreSnapshots: boolean;
+
+ /**
+ * See [testProject.metadata](https://playwright.dev/docs/api/class-testproject#test-project-metadata).
+ */
+ metadata: Metadata;
+
+ /**
+ * See [testProject.name](https://playwright.dev/docs/api/class-testproject#test-project-name).
+ */
+ name: string;
+
+ /**
+ * See [testProject.outputDir](https://playwright.dev/docs/api/class-testproject#test-project-output-dir).
+ */
+ outputDir: string;
+
+ /**
+ * See [testProject.repeatEach](https://playwright.dev/docs/api/class-testproject#test-project-repeat-each).
+ */
+ repeatEach: number;
+
+ /**
+ * See [testProject.retries](https://playwright.dev/docs/api/class-testproject#test-project-retries).
+ */
+ retries: number;
+
+ /**
+ * See [testProject.snapshotDir](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-dir).
+ */
+ snapshotDir: string;
+
+ /**
+ * See [testProject.teardown](https://playwright.dev/docs/api/class-testproject#test-project-teardown).
+ */
+ teardown?: string;
+
+ /**
+ * See [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir).
+ */
+ testDir: string;
+
+ /**
+ * See [testProject.testIgnore](https://playwright.dev/docs/api/class-testproject#test-project-test-ignore).
+ */
+ testIgnore: string|RegExp|Array;
+
+ /**
+ * See [testProject.testMatch](https://playwright.dev/docs/api/class-testproject#test-project-test-match).
+ */
+ testMatch: string|RegExp|Array;
+
+ /**
+ * See [testProject.timeout](https://playwright.dev/docs/api/class-testproject#test-project-timeout).
+ */
+ timeout: number;
+}
+
+type LiteralUnion = T | (U & { zz_IGNORE_ME?: never });
+
+/**
+ * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout`
+ * or `testDir`. These options are described in the [TestConfig](https://playwright.dev/docs/api/class-testconfig)
+ * object in the [configuration file](https://playwright.dev/docs/test-configuration). This type describes format of the configuration file,
+ * to access resolved configuration parameters at run time use
+ * [FullConfig](https://playwright.dev/docs/api/class-fullconfig).
+ *
+ * Playwright Test supports running multiple test projects at the same time. Project-specific options should be put to
+ * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level
+ * [TestConfig](https://playwright.dev/docs/api/class-testconfig) can also define base options shared between all
+ * projects.
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * timeout: 30000,
+ * globalTimeout: 600000,
+ * reporter: 'list',
+ * testDir: './tests',
+ * });
+ * ```
+ *
+ */
+interface TestConfig {
+ /**
+ * Playwright Test supports running multiple test projects at the same time. See
+ * [TestProject](https://playwright.dev/docs/api/class-testproject) for more information.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig, devices } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * { name: 'chromium', use: devices['Desktop Chrome'] }
+ * ]
+ * });
+ * ```
+ *
+ */
+ projects?: Project[];
+ /**
+ * The list of reporters to use. Each reporter can be:
+ * - A builtin reporter name like `'list'` or `'json'`.
+ * - A module name like `'my-awesome-reporter'`.
+ * - A relative path to the reporter like `'./reporters/my-awesome-reporter.js'`.
+ *
+ * You can pass options to the reporter in a tuple like `['json', { outputFile: './report.json' }]`. If the property
+ * is not specified, Playwright uses the `'dot'` reporter when the CI environment variable is set, and the `'list'`
+ * reporter otherwise.
+ *
+ * Learn more in the [reporters guide](https://playwright.dev/docs/test-reporters).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * reporter: 'line',
+ * });
+ * ```
+ *
+ */
+ reporter?: LiteralUnion<'list'|'dot'|'line'|'github'|'json'|'junit'|'null'|'html'|'perfetto', string> | ReporterDescription[];
+ /**
+ * Global options for all tests, for example
+ * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more
+ * about [configuration](https://playwright.dev/docs/test-configuration) and see
+ * [available options][TestOptions](https://playwright.dev/docs/api/class-testoptions).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * browserName: 'chromium',
+ * },
+ * });
+ * ```
+ *
+ */
+ use?: UseOptions;
+ /**
+ * Launch a development web server (or multiple) during the tests.
+ *
+ * **Details**
+ *
+ * If the port is specified, Playwright Test will wait for it to be available on `127.0.0.1` or `::1`, before running
+ * the tests. If the url is specified, Playwright Test will wait for the URL to return a 2xx, 3xx, 400, 401, 402, or
+ * 403 status code before running the tests.
+ *
+ * For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not
+ * use an existing server on the CI. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable.
+ *
+ * The `port` (but not the `url`) gets passed over to Playwright as a
+ * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). For example port
+ * `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
+ * explicitly configure the `baseURL` (even if it only has one entry).
+ *
+ * **NOTE** It is also recommended to specify
+ * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
+ * that tests could use relative urls.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ * export default defineConfig({
+ * webServer: {
+ * command: 'npm run start',
+ * url: 'http://localhost:3000',
+ * timeout: 120 * 1000,
+ * reuseExistingServer: !process.env.CI,
+ * },
+ * use: {
+ * baseURL: 'http://localhost:3000/',
+ * },
+ * });
+ * ```
+ *
+ * Now you can use a relative path when navigating the page:
+ *
+ * ```js
+ * // test.spec.ts
+ * import { test } from '@playwright/test';
+ *
+ * test('test', async ({ page }) => {
+ * // This will result in http://localhost:3000/foo
+ * await page.goto('/foo');
+ * });
+ * ```
+ *
+ * Multiple web servers (or background processes) can be launched:
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ * export default defineConfig({
+ * webServer: [
+ * {
+ * command: 'npm run start',
+ * url: 'http://localhost:3000',
+ * name: 'Frontend',
+ * timeout: 120 * 1000,
+ * reuseExistingServer: !process.env.CI,
+ * },
+ * {
+ * command: 'npm run backend',
+ * url: 'http://localhost:3333',
+ * name: 'Backend',
+ * timeout: 120 * 1000,
+ * reuseExistingServer: !process.env.CI,
+ * }
+ * ],
+ * use: {
+ * baseURL: 'http://localhost:3000',
+ * },
+ * });
+ * ```
+ *
+ * If your webserver runs on varying ports, use `wait` to capture the port:
+ *
+ * ```js
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * webServer: {
+ * command: 'npm run start',
+ * wait: {
+ * stdout: /Listening on port (?\d+)/
+ * },
+ * },
+ * });
+ * ```
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` });
+ *
+ * test('homepage', async ({ page }) => {
+ * await page.goto('/');
+ * });
+ * ```
+ *
+ */
+ webServer?: TestConfigWebServer | TestConfigWebServer[];
+ /**
+ * Playwright transpiler configuration.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * build: {
+ * external: ['**\/*bundle.js'],
+ * },
+ * });
+ * ```
+ *
+ */
+ build?: {
+ /**
+ * Paths to exclude from the transpilation expressed as a list of glob patterns. Typically heavy JS bundles that your
+ * test uses are listed here.
+ */
+ external?: Array;
+ };
+
+ /**
+ * These settings control whether git information is captured and stored in the config
+ * [testConfig.metadata](https://playwright.dev/docs/api/class-testconfig#test-config-metadata).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * captureGitInfo: { commit: true, diff: true }
+ * });
+ * ```
+ *
+ * **Details**
+ * - Capturing `commit` information is useful when you'd like to see it in your HTML (or a third party) report.
+ * - Capturing `diff` information is useful to enrich the report with the actual source diff. This information can
+ * be used to provide intelligent advice on how to fix the test.
+ *
+ * **NOTE** Default values for these settings depend on the environment. When tests run as a part of CI where it is
+ * safe to obtain git information, the default value is `true`, `false` otherwise.
+ *
+ * **NOTE** The structure of the git commit metadata is subject to change.
+ *
+ */
+ captureGitInfo?: {
+ /**
+ * Whether to capture commit and pull request information such as hash, author, timestamp.
+ */
+ commit?: boolean;
+
+ /**
+ * Whether to capture commit diff.
+ */
+ diff?: boolean;
+ };
+
+ /**
+ * Configuration for the `expect` assertion library. Learn more about [various timeouts](https://playwright.dev/docs/test-timeouts).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * expect: {
+ * timeout: 10000,
+ * toMatchSnapshot: {
+ * maxDiffPixels: 10,
+ * },
+ * },
+ * });
+ * ```
+ *
+ */
+ expect?: {
+ /**
+ * Default timeout for async expect matchers in milliseconds, defaults to 5000ms.
+ */
+ timeout?: number;
+
+ /**
+ * Configuration for the
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1)
+ * method.
+ */
+ toHaveScreenshot?: {
+ /**
+ * See [`animations`](https://playwright.dev/docs/api/class-page#page-screenshot-option-animations) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to `"disabled"`.
+ */
+ animations?: "allow"|"disabled";
+
+ /**
+ * See [`caret`](https://playwright.dev/docs/api/class-page#page-screenshot-option-caret) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to `"hide"`.
+ */
+ caret?: "hide"|"initial";
+
+ /**
+ * An acceptable amount of pixels that could be different, unset by default.
+ */
+ maxDiffPixels?: number;
+
+ /**
+ * An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
+ */
+ maxDiffPixelRatio?: number;
+
+ /**
+ * See [`scale`](https://playwright.dev/docs/api/class-page#page-screenshot-option-scale) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to `"css"`.
+ */
+ scale?: "css"|"device";
+
+ /**
+ * See [`style`](https://playwright.dev/docs/api/class-page#page-screenshot-option-style) in
+ * [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot).
+ */
+ stylePath?: string|Array;
+
+ /**
+ * An acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and
+ * `1` (lax). `"pixelmatch"` comparator computes color difference in
+ * [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
+ */
+ threshold?: number;
+
+ /**
+ * A template controlling location of the screenshots. See
+ * [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
+ * for details.
+ */
+ pathTemplate?: string;
+ };
+
+ /**
+ * Configuration for the
+ * [expect(locator).toMatchAriaSnapshot([options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot-2)
+ * method.
+ */
+ toMatchAriaSnapshot?: {
+ /**
+ * A template controlling location of the aria snapshots. See
+ * [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
+ * for details.
+ */
+ pathTemplate?: string;
+
+ /**
+ * Controls how children of the snapshot root are matched against the actual accessibility tree. This is equivalent to
+ * adding a `/children` property at the top of every aria snapshot template. Individual snapshots can override this by
+ * including an explicit `/children` property.
+ */
+ children?: "contain"|"equal"|"deep-equal";
+ };
+
+ /**
+ * Configuration for the
+ * [expect(value).toMatchSnapshot(name[, options])](https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1)
+ * method.
+ */
+ toMatchSnapshot?: {
+ /**
+ * An acceptable amount of pixels that could be different, unset by default.
+ */
+ maxDiffPixels?: number;
+
+ /**
+ * An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
+ */
+ maxDiffPixelRatio?: number;
+
+ /**
+ * An acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and
+ * `1` (lax). `"pixelmatch"` comparator computes color difference in
+ * [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
+ */
+ threshold?: number;
+ };
+
+ /**
+ * Configuration for the [expect(value).toPass()](https://playwright.dev/docs/test-assertions#expecttopass) method.
+ */
+ toPass?: {
+ /**
+ * Probe intervals for toPass method in milliseconds.
+ */
+ intervals?: Array;
+
+ /**
+ * Timeout for toPass method in milliseconds.
+ */
+ timeout?: number;
+ };
+ };
+
+ /**
+ * Whether to exit with an error if any tests are marked as flaky. Useful on CI.
+ *
+ * Also available in the [command line](https://playwright.dev/docs/test-cli) with the `--fail-on-flaky-tests` option.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * failOnFlakyTests: !!process.env.CI,
+ * });
+ * ```
+ *
+ */
+ failOnFlakyTests?: boolean;
+
+ /**
+ * Whether to exit with an error if any tests or groups are marked as
+ * [test.only(title[, details, body])](https://playwright.dev/docs/api/class-test#test-only) or
+ * [test.describe.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-only).
+ * Useful on CI.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * forbidOnly: !!process.env.CI,
+ * });
+ * ```
+ *
+ */
+ forbidOnly?: boolean;
+
+ /**
+ * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the
+ * same time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same
+ * worker process.
+ *
+ * You can configure entire test run to concurrently execute all tests in all files using this option.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * fullyParallel: true,
+ * });
+ * ```
+ *
+ */
+ fullyParallel?: boolean;
+
+ /**
+ * Path to the global setup file. This file will be required and run before all the tests. It must export a single
+ * function that takes a [FullConfig](https://playwright.dev/docs/api/class-fullconfig) argument. Pass an array of
+ * paths to specify multiple global setup files.
+ *
+ * Learn more about [global setup and teardown](https://playwright.dev/docs/test-global-setup-teardown).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * globalSetup: './global-setup',
+ * });
+ * ```
+ *
+ */
+ globalSetup?: string|Array;
+
+ /**
+ * Path to the global teardown file. This file will be required and run after all the tests. It must export a single
+ * function. See also
+ * [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup). Pass an array
+ * of paths to specify multiple global teardown files.
+ *
+ * Learn more about [global setup and teardown](https://playwright.dev/docs/test-global-setup-teardown).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * globalTeardown: './global-teardown',
+ * });
+ * ```
+ *
+ */
+ globalTeardown?: string|Array;
+
+ /**
+ * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on
+ * CI to prevent broken setup from running too long and wasting resources. Learn more about
+ * [various timeouts](https://playwright.dev/docs/test-timeouts).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
+ * });
+ * ```
+ *
+ */
+ globalTimeout?: number;
+
+ /**
+ * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
+ * run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option. The
+ * regular expression will be tested against the string that consists of the project name, the test file name, the
+ * `test.describe` name (if any), the test name and the test tags divided by spaces, e.g. `chromium my-test.spec.ts
+ * my-suite my-test`.
+ *
+ * `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * grep: /smoke/,
+ * });
+ * ```
+ *
+ */
+ grep?: RegExp|Array;
+
+ /**
+ * Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of
+ * [testConfig.grep](https://playwright.dev/docs/api/class-testconfig#test-config-grep). Also available in the
+ * [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
+ *
+ * `grepInvert` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * grepInvert: /manual/,
+ * });
+ * ```
+ *
+ */
+ grepInvert?: RegExp|Array;
+
+ /**
+ * Whether to skip snapshot expectations, such as `expect(value).toMatchSnapshot()` and `await
+ * expect(page).toHaveScreenshot()`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * ignoreSnapshots: !process.env.CI,
+ * });
+ * ```
+ *
+ */
+ ignoreSnapshots?: boolean;
+
+ /**
+ * The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and
+ * exit with an error. Setting to zero (default) disables this behavior.
+ *
+ * Also available in the [command line](https://playwright.dev/docs/test-cli) with the `--max-failures` and `-x` options.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * maxFailures: process.env.CI ? 1 : 0,
+ * });
+ * ```
+ *
+ */
+ maxFailures?: number;
+
+ /**
+ * Metadata contains key-value pairs to be included in the report. For example, the JSON report will include metadata
+ * serialized as JSON.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * metadata: { title: 'acceptance tests' },
+ * });
+ * ```
+ *
+ */
+ metadata?: Metadata;
+
+ /**
+ * Config name is visible in the report and during test execution, unless overridden by
+ * [testProject.name](https://playwright.dev/docs/api/class-testproject#test-project-name).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * name: 'acceptance tests',
+ * });
+ * ```
+ *
+ */
+ name?: string;
+
+ /**
+ * The output directory for files created during test execution. Defaults to `/test-results`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * outputDir: './test-results',
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * This directory is cleaned at the start. When running a test, a unique subdirectory inside the
+ * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir) is created,
+ * guaranteeing that test running in parallel do not conflict. This directory can be accessed by
+ * [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir) and
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path).
+ *
+ * Here is an example that uses
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to
+ * create a temporary file.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ * import fs from 'fs';
+ *
+ * test('example test', async ({}, testInfo) => {
+ * const file = testInfo.outputPath('temporary-file.txt');
+ * await fs.promises.writeFile(file, 'Put some data to the file', 'utf8');
+ * });
+ * ```
+ *
+ */
+ outputDir?: string;
+
+ /**
+ * Whether to preserve test output in the
+ * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir). Defaults to
+ * `'always'`.
+ * - `'always'` - preserve output for all tests;
+ * - `'never'` - do not preserve output for any tests;
+ * - `'failures-only'` - only preserve output for failed tests.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * preserveOutput: 'always',
+ * });
+ * ```
+ *
+ */
+ preserveOutput?: "always"|"never"|"failures-only";
+
+ /**
+ * Whether to suppress stdio and stderr output from the tests.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * quiet: !!process.env.CI,
+ * });
+ * ```
+ *
+ */
+ quiet?: boolean;
+
+ /**
+ * The number of times to repeat each test, useful for debugging flaky tests.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * repeatEach: 3,
+ * });
+ * ```
+ *
+ */
+ repeatEach?: number;
+
+ /**
+ * Whether to report slow test files. Pass `null` to disable this feature.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * reportSlowTests: null,
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * Test files that took more than `threshold` milliseconds are considered slow, and the slowest ones are reported, no
+ * more than `max` number of them. Passing zero as `max` reports all test files that exceed the threshold.
+ */
+ reportSlowTests?: null|{
+ /**
+ * The maximum number of slow test files to report. Defaults to `5`.
+ */
+ max: number;
+
+ /**
+ * Test file duration in milliseconds that is considered slow. Defaults to 5 minutes.
+ */
+ threshold: number;
+ };
+
+ /**
+ * Whether to skip entries from `.gitignore` when searching for test files. By default, if neither
+ * [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) nor
+ * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir) are explicitly
+ * specified, Playwright will ignore any test files matching `.gitignore` entries.
+ */
+ respectGitIgnore?: boolean;
+
+ /**
+ * The maximum number of retry attempts given to failed tests. By default failing tests are not retried. Learn more
+ * about [test retries](https://playwright.dev/docs/test-retries#retries).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * retries: 2,
+ * });
+ * ```
+ *
+ */
+ retries?: number;
+
+ /**
+ * Controls when failed tests are retried. Defaults to `'immediate'`.
+ * - `'immediate'` - A failed test is retried as soon as a worker is available, interleaved with the rest of the
+ * run. This is the default.
+ * - `'isolated'` - Retries are run at the end, after all other tests have finished, one by one in a single worker.
+ * This minimizes the interference between retried tests and the rest of the suite, at the expense of the total
+ * run time.
+ *
+ * Learn more about [test retries](https://playwright.dev/docs/test-retries#retries).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * retries: 2,
+ * retryStrategy: 'isolated',
+ * });
+ * ```
+ *
+ */
+ retryStrategy?: "immediate"|"isolated";
+
+ /**
+ * Shard tests and execute only the selected shard. Specify in the one-based form like `{ total: 5, current: 2 }`.
+ *
+ * Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * shard: { total: 10, current: 3 },
+ * });
+ * ```
+ *
+ */
+ shard?: null|{
+ /**
+ * The index of the shard to execute, one-based.
+ */
+ current: number;
+
+ /**
+ * The total number of shards.
+ */
+ total: number;
+ };
+
+ /**
+ * **NOTE** Use
+ * [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
+ * to configure snapshot paths.
+ *
+ * The base directory, relative to the config file, for snapshot files created with `toMatchSnapshot`. Defaults to
+ * [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * snapshotDir: './snapshots',
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * The directory for each test can be accessed by
+ * [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir) and
+ * [testInfo.snapshotPath(...name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path).
+ *
+ * This path will serve as the base directory for each test file snapshot directory. Setting `snapshotDir` to
+ * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir)
+ * would resolve to `snapshots/a.spec.js-snapshots`.
+ */
+ snapshotDir?: string;
+
+ /**
+ * This option configures a template controlling location of snapshots generated by
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1),
+ * [expect(locator).toMatchAriaSnapshot([options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot-2)
+ * and
+ * [expect(value).toMatchSnapshot(name[, options])](https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1).
+ *
+ * You can configure templates for each assertion separately in
+ * [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * testDir: './tests',
+ *
+ * // Single template for all assertions
+ * snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}',
+ *
+ * // Assertion-specific templates
+ * expect: {
+ * toHaveScreenshot: {
+ * pathTemplate: '{testDir}/__screenshots__{/projectName}/{testFilePath}/{arg}{ext}',
+ * },
+ * toMatchAriaSnapshot: {
+ * pathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}',
+ * },
+ * },
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * The value might include some "tokens" that will be replaced with actual values during test execution.
+ *
+ * Consider the following file structure:
+ *
+ * ```txt
+ * playwright.config.ts
+ * tests/
+ * └── page/
+ * └── page-click.spec.ts
+ * ```
+ *
+ * And the following `page-click.spec.ts` that uses `toHaveScreenshot()` call:
+ *
+ * ```js
+ * // page-click.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('suite', () => {
+ * test('test should work', async ({ page }) => {
+ * await expect(page).toHaveScreenshot(['foo', 'bar', 'baz.png']);
+ * });
+ * });
+ * ```
+ *
+ * The list of supported tokens:
+ * - `{arg}` - Relative snapshot path **without extension**. This comes from the arguments passed to
+ * `toHaveScreenshot()`, `toMatchAriaSnapshot()` or `toMatchSnapshot()`; if called without arguments, this will be
+ * an auto-generated snapshot name.
+ * - Value: `foo/bar/baz`
+ * - `{ext}` - Snapshot extension (with the leading dot).
+ * - Value: `.png`
+ * - `{platform}` - The value of `process.platform`.
+ * - `{projectName}` - Project's file-system-sanitized name, if any.
+ * - Value: `''` (empty string).
+ * - `{snapshotDir}` - Project's
+ * [testProject.snapshotDir](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-dir).
+ * - Value: `/home/playwright/tests` (since `snapshotDir` is not provided in config, it defaults to `testDir`)
+ * - `{testDir}` - Project's
+ * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir).
+ * - Value: `/home/playwright/tests` (absolute path since `testDir` is resolved relative to directory with
+ * config)
+ * - `{testFileDir}` - Directories in relative path from `testDir` to **test file**.
+ * - Value: `page`
+ * - `{testFileBaseName}` - Test file name without the last extension.
+ * - Value: `page-click.spec`
+ * - `{testFileName}` - Test file name with extension.
+ * - Value: `page-click.spec.ts`
+ * - `{testFilePath}` - Relative path from `testDir` to **test file**.
+ * - Value: `page/page-click.spec.ts`
+ * - `{testName}` - File-system-sanitized test title, including parent describes but excluding file name.
+ * - Value: `suite-test-should-work`
+ *
+ * Each token can be preceded with a single character that will be used **only if** this token has non-empty value.
+ *
+ * Consider the following config:
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * snapshotPathTemplate: '__screenshots__{/projectName}/{testFilePath}/{arg}{ext}',
+ * testMatch: 'example.spec.ts',
+ * projects: [
+ * { use: { browserName: 'firefox' } },
+ * { name: 'chromium', use: { browserName: 'chromium' } },
+ * ],
+ * });
+ * ```
+ *
+ * In this config:
+ * 1. First project **does not** have a name, so its snapshots will be stored in
+ * `/__screenshots__/example.spec.ts/...`.
+ * 1. Second project **does** have a name, so its snapshots will be stored in
+ * `/__screenshots__/chromium/example.spec.ts/..`.
+ * 1. Since `snapshotPathTemplate` resolves to relative path, it will be resolved relative to `configDir`.
+ * 1. Forward slashes `"/"` can be used as path separators on any platform.
+ */
+ snapshotPathTemplate?: string;
+
+ /**
+ * Tag or tags prepended to each test in the report. Useful for tagging your test run to differentiate between
+ * [CI environments](https://playwright.dev/docs/test-sharding#merging-reports-from-multiple-environments).
+ *
+ * Note that each tag must start with `@` symbol. Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * tag: process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2"
+ * });
+ * ```
+ *
+ */
+ tag?: string|Array;
+
+ /**
+ * Directory that will be recursively scanned for test files. Defaults to the directory of the configuration file.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * testDir: './tests/playwright',
+ * });
+ * ```
+ *
+ */
+ testDir?: string;
+
+ /**
+ * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute
+ * file path. Strings are treated as glob patterns.
+ *
+ * For example, `'**\/test-assets/**'` will ignore any files in the `test-assets` directory.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * testIgnore: '**\/test-assets/**',
+ * });
+ * ```
+ *
+ */
+ testIgnore?: string|RegExp|Array;
+
+ /**
+ * Only the files matching one of these patterns are executed as test files. Matching is performed against the
+ * absolute file path. Strings are treated as glob patterns.
+ *
+ * By default, Playwright looks for files matching the following glob pattern: `**\/*.@(spec|test).?(c|m)[jt]s?(x)`.
+ * This means JavaScript or TypeScript files with `".test"` or `".spec"` suffix, for example
+ * `login-screen.wrong-credentials.spec.ts`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * testMatch: /.*\.e2e\.js/,
+ * });
+ * ```
+ *
+ */
+ testMatch?: string|RegExp|Array;
+
+ /**
+ * Timeout for each test in milliseconds. Defaults to 30 seconds.
+ *
+ * This is a base timeout for all tests. In addition, each test can configure its own timeout with
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout). Learn more about
+ * [various timeouts](https://playwright.dev/docs/test-timeouts).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * timeout: 5 * 60 * 1000,
+ * });
+ * ```
+ *
+ */
+ timeout?: number;
+
+ /**
+ * Path to a single `tsconfig` applicable to all imported files. By default, `tsconfig` for each imported file is
+ * looked up separately. Note that `tsconfig` property has no effect while the configuration file or any of its
+ * dependencies are loaded. Ignored when `--tsconfig` command line option is specified.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * tsconfig: './tsconfig.test.json',
+ * });
+ * ```
+ *
+ */
+ tsconfig?: string;
+
+ /**
+ * Whether to update expected snapshots with the actual results produced by the test run. Defaults to `'missing'`.
+ * - `'all'` - All tests that are executed will update snapshots.
+ * - `'changed'` - All tests that are executed will update snapshots that did not match. Matching snapshots will not
+ * be updated. Also creates missing snapshots.
+ * - `'missing'` - Missing snapshots are created, for example when authoring a new test and running it for the first
+ * time. This is the default.
+ * - `'none'` - No snapshots are updated.
+ *
+ * Learn more about [snapshots](https://playwright.dev/docs/test-snapshots).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * updateSnapshots: 'missing',
+ * });
+ * ```
+ *
+ */
+ updateSnapshots?: "all"|"changed"|"missing"|"none";
+
+ /**
+ * Defines how to update snapshots in the source code.
+ * - `'patch'` - Create a unified diff file that can be used to update the source code later. This is the default.
+ * - `'3way'` - Generate merge conflict markers in source code. This allows user to manually pick relevant changes,
+ * as if they are resolving a merge conflict in the IDE.
+ * - `'overwrite'` - Overwrite the source code with the new snapshot values.
+ */
+ updateSourceMethod?: "overwrite"|"3way"|"patch";
+
+ /**
+ * The maximum number of concurrent worker processes to use for parallelizing tests. Can also be set as percentage of
+ * logical CPU cores, e.g. `'50%'.`
+ *
+ * Playwright Test uses worker processes to run tests. There is always at least one worker process, but more can be
+ * used to speed up test execution.
+ *
+ * Defaults to half of the number of logical CPU cores. Learn more about
+ * [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * workers: 3,
+ * });
+ * ```
+ *
+ */
+ workers?: number|string;
+}
+
+export interface Config extends TestConfig {
+}
+
+export type Metadata = { [key: string]: any };
+
+/**
+ * Resolved configuration which is accessible via
+ * [testInfo.config](https://playwright.dev/docs/api/class-testinfo#test-info-config) and is passed to the test
+ * reporters. To see the format of Playwright configuration file, please see
+ * [TestConfig](https://playwright.dev/docs/api/class-testconfig) instead.
+ */
+export interface FullConfig {
+ /**
+ * List of resolved projects.
+ */
+ projects: FullProject[];
+ /**
+ * See [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter).
+ */
+ reporter: ReporterDescription[];
+ /**
+ * See [testConfig.webServer](https://playwright.dev/docs/api/class-testconfig#test-config-web-server).
+ */
+ webServer: TestConfigWebServer | null;
+ /**
+ * Snapshot of [`process.argv`](https://nodejs.org/api/process.html#processargv) captured in the runner process.
+ * Useful for reading custom command-line arguments — for example, args supplied after the `--` separator (`npx
+ * playwright test -- --build-path=./out`). Playwright does not parse these; consumers are responsible for slicing and
+ * interpreting them with any argument-parsing library.
+ */
+ argv: Array;
+
+ /**
+ * Path to the configuration file used to run the tests. The value is an empty string if no config file was used.
+ */
+ configFile?: string;
+
+ /**
+ * See
+ * [testConfig.failOnFlakyTests](https://playwright.dev/docs/api/class-testconfig#test-config-fail-on-flaky-tests).
+ */
+ failOnFlakyTests: boolean;
+
+ /**
+ * See [testConfig.forbidOnly](https://playwright.dev/docs/api/class-testconfig#test-config-forbid-only).
+ */
+ forbidOnly: boolean;
+
+ /**
+ * See [testConfig.fullyParallel](https://playwright.dev/docs/api/class-testconfig#test-config-fully-parallel).
+ */
+ fullyParallel: boolean;
+
+ /**
+ * See [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup).
+ */
+ globalSetup: null|string;
+
+ /**
+ * See [testConfig.globalTeardown](https://playwright.dev/docs/api/class-testconfig#test-config-global-teardown).
+ */
+ globalTeardown: null|string;
+
+ /**
+ * See [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout).
+ */
+ globalTimeout: number;
+
+ /**
+ * See [testConfig.grep](https://playwright.dev/docs/api/class-testconfig#test-config-grep).
+ */
+ grep: RegExp|Array;
+
+ /**
+ * See [testConfig.grepInvert](https://playwright.dev/docs/api/class-testconfig#test-config-grep-invert).
+ */
+ grepInvert: null|RegExp|Array;
+
+ /**
+ * See [testConfig.maxFailures](https://playwright.dev/docs/api/class-testconfig#test-config-max-failures).
+ */
+ maxFailures: number;
+
+ /**
+ * See [testConfig.metadata](https://playwright.dev/docs/api/class-testconfig#test-config-metadata).
+ */
+ metadata: Metadata;
+
+ /**
+ * See [testConfig.preserveOutput](https://playwright.dev/docs/api/class-testconfig#test-config-preserve-output).
+ */
+ preserveOutput: "always"|"never"|"failures-only";
+
+ /**
+ * See [testConfig.quiet](https://playwright.dev/docs/api/class-testconfig#test-config-quiet).
+ */
+ quiet: boolean;
+
+ /**
+ * See [testConfig.reportSlowTests](https://playwright.dev/docs/api/class-testconfig#test-config-report-slow-tests).
+ */
+ reportSlowTests: null|{
+ /**
+ * The maximum number of slow test files to report.
+ */
+ max: number;
+
+ /**
+ * Test file duration in milliseconds that is considered slow.
+ */
+ threshold: number;
+ };
+
+ /**
+ * Base directory for all relative paths used in the reporters.
+ */
+ rootDir: string;
+
+ /**
+ * See [testConfig.shard](https://playwright.dev/docs/api/class-testconfig#test-config-shard).
+ */
+ shard: null|{
+ /**
+ * The total number of shards.
+ */
+ total: number;
+
+ /**
+ * The index of the shard to execute, one-based.
+ */
+ current: number;
+ };
+
+ /**
+ * Resolved global tags. See [testConfig.tag](https://playwright.dev/docs/api/class-testconfig#test-config-tag).
+ */
+ tags: Array;
+
+ /**
+ * See [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots).
+ */
+ updateSnapshots: "all"|"changed"|"missing"|"none";
+
+ /**
+ * See
+ * [testConfig.updateSourceMethod](https://playwright.dev/docs/api/class-testconfig#test-config-update-source-method).
+ */
+ updateSourceMethod: "overwrite"|"3way"|"patch";
+
+ /**
+ * Playwright version.
+ */
+ version: string;
+
+ /**
+ * See [testConfig.workers](https://playwright.dev/docs/api/class-testconfig#test-config-workers).
+ */
+ workers: number;
+}
+
+/**
+ * `TestInfo` contains information about currently running test. It is available to test functions,
+ * [test.beforeEach([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-before-each),
+ * [test.afterEach([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-each),
+ * [test.beforeAll([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-before-all) and
+ * [test.afterAll([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-all) hooks, and
+ * test-scoped fixtures. `TestInfo` provides utilities to control test execution: attach files, update test timeout,
+ * determine which test is currently running and whether it was retried, etc.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }, testInfo) => {
+ * expect(testInfo.title).toBe('basic test');
+ * await page.screenshot(testInfo.outputPath('screenshot.png'));
+ * });
+ * ```
+ *
+ */
+export interface TestInfo {
+ /**
+ * Returns a path to a snapshot file with the given `name`. Pass
+ * [`kind`](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path-option-kind) to obtain a specific
+ * path:
+ * - `kind: 'screenshot'` for
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1);
+ * - `kind: 'aria'` for
+ * [expect(locator).toMatchAriaSnapshot(expected[, options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot);
+ * - `kind: 'snapshot'` for
+ * [expect(value).toMatchSnapshot(name[, options])](https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1).
+ *
+ * **Usage**
+ *
+ * ```js
+ * await expect(page).toHaveScreenshot('header.png');
+ * // Screenshot assertion above expects screenshot at this path:
+ * const screenshotPath = test.info().snapshotPath('header.png', { kind: 'screenshot' });
+ *
+ * await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.aria.yml' });
+ * // Aria snapshot assertion above expects snapshot at this path:
+ * const ariaSnapshotPath = test.info().snapshotPath('main.aria.yml', { kind: 'aria' });
+ *
+ * expect('some text').toMatchSnapshot('snapshot.txt');
+ * // Snapshot assertion above expects snapshot at this path:
+ * const snapshotPath = test.info().snapshotPath('snapshot.txt');
+ *
+ * expect('some text').toMatchSnapshot(['dir', 'subdir', 'snapshot.txt']);
+ * // Snapshot assertion above expects snapshot at this path:
+ * const nestedPath = test.info().snapshotPath('dir', 'subdir', 'snapshot.txt');
+ * ```
+ *
+ * @param name The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the
+ * same test file are expected to be the same.
+ *
+ * When passing [`kind`](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path-option-kind), multiple
+ * name segments are not supported.
+ * @param options
+ */
+ snapshotPath(...name: ReadonlyArray): string;
+ /**
+ * Returns a path to a snapshot file with the given `name`. Pass
+ * [`kind`](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path-option-kind) to obtain a specific
+ * path:
+ * - `kind: 'screenshot'` for
+ * [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1);
+ * - `kind: 'aria'` for
+ * [expect(locator).toMatchAriaSnapshot(expected[, options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot);
+ * - `kind: 'snapshot'` for
+ * [expect(value).toMatchSnapshot(name[, options])](https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1).
+ *
+ * **Usage**
+ *
+ * ```js
+ * await expect(page).toHaveScreenshot('header.png');
+ * // Screenshot assertion above expects screenshot at this path:
+ * const screenshotPath = test.info().snapshotPath('header.png', { kind: 'screenshot' });
+ *
+ * await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.aria.yml' });
+ * // Aria snapshot assertion above expects snapshot at this path:
+ * const ariaSnapshotPath = test.info().snapshotPath('main.aria.yml', { kind: 'aria' });
+ *
+ * expect('some text').toMatchSnapshot('snapshot.txt');
+ * // Snapshot assertion above expects snapshot at this path:
+ * const snapshotPath = test.info().snapshotPath('snapshot.txt');
+ *
+ * expect('some text').toMatchSnapshot(['dir', 'subdir', 'snapshot.txt']);
+ * // Snapshot assertion above expects snapshot at this path:
+ * const nestedPath = test.info().snapshotPath('dir', 'subdir', 'snapshot.txt');
+ * ```
+ *
+ * @param name The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the
+ * same test file are expected to be the same.
+ *
+ * When passing [`kind`](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path-option-kind), multiple
+ * name segments are not supported.
+ * @param options
+ */
+ snapshotPath(name: string, options: { kind: 'snapshot' | 'screenshot' | 'aria' }): string;
+ /**
+ * Attach a value or a file from disk to the current test. Some reporters show test attachments. Either
+ * [`path`](https://playwright.dev/docs/api/class-testinfo#test-info-attach-option-path) or
+ * [`body`](https://playwright.dev/docs/api/class-testinfo#test-info-attach-option-body) must be specified, but not
+ * both.
+ *
+ * For example, you can attach a screenshot to the test:
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }, testInfo) => {
+ * await page.goto('https://playwright.dev');
+ * const screenshot = await page.screenshot();
+ * await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' });
+ * });
+ * ```
+ *
+ * Or you can attach files returned by your APIs:
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ * import { download } from './my-custom-helpers';
+ *
+ * test('basic test', async ({}, testInfo) => {
+ * const tmpPath = await download('a');
+ * await testInfo.attach('downloaded', { path: tmpPath });
+ * });
+ * ```
+ *
+ * **NOTE** [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach)
+ * automatically takes care of copying attached files to a location that is accessible to reporters. You can safely
+ * remove the attachment after awaiting the attach call.
+ *
+ * @param name Attachment name. The name will also be sanitized and used as the prefix of file name when saving to disk.
+ * @param options
+ */
+ attach(name: string, options?: {
+ /**
+ * Attachment body. Mutually exclusive with
+ * [`path`](https://playwright.dev/docs/api/class-testinfo#test-info-attach-option-path).
+ */
+ body?: string|Buffer;
+
+ /**
+ * Content type of this attachment to properly present in the report, for example `'application/json'` or
+ * `'image/png'`. If omitted, content type is inferred based on the
+ * [`path`](https://playwright.dev/docs/api/class-testinfo#test-info-attach-option-path), or defaults to `text/plain`
+ * for [string] attachments and `application/octet-stream` for [Buffer] attachments.
+ */
+ contentType?: string;
+
+ /**
+ * Path on the filesystem to the attached file. Mutually exclusive with
+ * [`body`](https://playwright.dev/docs/api/class-testinfo#test-info-attach-option-body).
+ */
+ path?: string;
+ }): Promise;
+
+ /**
+ * Marks the currently running test as "should fail". Playwright Test runs this test and ensures that it is actually
+ * failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is
+ * fixed. This is similar to
+ * [test.fail([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fail).
+ */
+ fail(): void;
+
+ /**
+ * Conditionally mark the currently running test as "should fail" with an optional description. This is similar to
+ * [test.fail([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fail).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fail(condition: boolean, description?: string): void;
+
+ /**
+ * Mark a test as "fixme", with the intention to fix it. Test is immediately aborted. This is similar to
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme).
+ */
+ fixme(): void;
+
+ /**
+ * Conditionally mark the currently running test as "fixme" with an optional description. This is similar to
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme).
+ * @param condition Test is marked as "fixme" when the condition is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fixme(condition: boolean, description?: string): void;
+
+ /**
+ * Returns a path inside the [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir)
+ * where the test can safely put a temporary file. Guarantees that tests running in parallel will not interfere with
+ * each other.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ * import fs from 'fs';
+ *
+ * test('example test', async ({}, testInfo) => {
+ * const file = testInfo.outputPath('dir', 'temporary-file.txt');
+ * await fs.promises.writeFile(file, 'Put some data to the dir/temporary-file.txt', 'utf8');
+ * });
+ * ```
+ *
+ * > Note that `pathSegments` accepts path segments to the test output directory such as
+ * `testInfo.outputPath('relative', 'path', 'to', 'output')`.
+ * > However, this path must stay within the
+ * [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir) directory for each test
+ * (i.e. `test-results/a-test-title`), otherwise it will throw.
+ * @param pathSegments Path segments to append at the end of the resulting path.
+ */
+ outputPath(...pathSegments: ReadonlyArray): string;
+
+ /**
+ * Changes the timeout for the currently running test. Zero means no timeout. Learn more about
+ * [various timeouts](https://playwright.dev/docs/test-timeouts).
+ *
+ * Timeout is usually specified in the [configuration file](https://playwright.dev/docs/test-configuration), but it could be useful to
+ * change the timeout in certain scenarios:
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeEach(async ({ page }, testInfo) => {
+ * // Extend timeout for all tests running this hook by 30 seconds.
+ * testInfo.setTimeout(testInfo.timeout + 30000);
+ * });
+ * ```
+ *
+ * @param timeout Timeout in milliseconds.
+ */
+ setTimeout(timeout: number): void;
+
+ /**
+ * Unconditionally skip the currently running test. Test is immediately aborted. This is similar to
+ * [test.skip([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-skip).
+ */
+ skip(): void;
+
+ /**
+ * Conditionally skips the currently running test with an optional description. This is similar to
+ * [test.skip([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-skip).
+ * @param condition A skip condition. Test is skipped when the condition is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ skip(condition: boolean, description?: string): void;
+
+ /**
+ * Marks the currently running test as "slow", giving it triple the default timeout. This is similar to
+ * [test.slow([condition, callback, description])](https://playwright.dev/docs/api/class-test#test-slow).
+ */
+ slow(): void;
+
+ /**
+ * Conditionally mark the currently running test as "slow" with an optional description, giving it triple the default
+ * timeout. This is similar to
+ * [test.slow([condition, callback, description])](https://playwright.dev/docs/api/class-test#test-slow).
+ * @param condition Test is marked as "slow" when the condition is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ slow(condition: boolean, description?: string): void;
+
+ /**
+ * The list of annotations applicable to the current test. Includes annotations from the test, annotations from all
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) groups the
+ * test belongs to and file-level annotations for the test file.
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ */
+ annotations: Array<{
+ /**
+ * Annotation type, for example `'skip'` or `'fail'`.
+ */
+ type: string;
+
+ /**
+ * Optional description.
+ */
+ description?: string;
+
+ /**
+ * Optional location in the source where the annotation is added.
+ */
+ location?: Location;
+ }>;
+
+ /**
+ * The list of files or buffers attached to the current test. Some reporters show test attachments.
+ *
+ * To add an attachment, use
+ * [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach) instead of
+ * directly pushing onto this array.
+ */
+ attachments: Array<{
+ /**
+ * Attachment name.
+ */
+ name: string;
+
+ /**
+ * Content type of this attachment to properly present in the report, for example `'application/json'` or
+ * `'image/png'`.
+ */
+ contentType: string;
+
+ /**
+ * Optional path on the filesystem to the attached file.
+ */
+ path?: string;
+
+ /**
+ * Optional attachment body used instead of a file.
+ */
+ body?: Buffer;
+ }>;
+
+ /**
+ * Column number where the currently running test is declared.
+ */
+ column: number;
+
+ /**
+ * Processed configuration from the [configuration file](https://playwright.dev/docs/test-configuration).
+ */
+ config: FullConfig;
+
+ /**
+ * The number of milliseconds the test took to finish. Always zero before the test finishes, either successfully or
+ * not. Can be used in
+ * [test.afterEach([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-each) hook.
+ */
+ duration: number;
+
+ /**
+ * First error thrown during test execution, if any. This is equal to the first element in
+ * [testInfo.errors](https://playwright.dev/docs/api/class-testinfo#test-info-errors).
+ */
+ error?: TestInfoError;
+
+ /**
+ * Errors thrown during test execution, if any.
+ */
+ errors: Array;
+
+ /**
+ * Expected status for the currently running test. This is usually `'passed'`, except for a few cases:
+ * - `'skipped'` for skipped tests, e.g. with
+ * [test.skip([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-skip);
+ * - `'failed'` for tests marked as failed with
+ * [test.fail([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fail).
+ *
+ * Expected status is usually compared with the actual
+ * [testInfo.status](https://playwright.dev/docs/api/class-testinfo#test-info-status):
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.afterEach(async ({}, testInfo) => {
+ * if (testInfo.status !== testInfo.expectedStatus)
+ * console.log(`${testInfo.title} did not run as expected!`);
+ * });
+ * ```
+ *
+ */
+ expectedStatus: "passed"|"failed"|"timedOut"|"skipped"|"interrupted";
+
+ /**
+ * Absolute path to a file where the currently running test is declared.
+ */
+ file: string;
+
+ /**
+ * Test function as passed to `test(title, testFunction)`.
+ */
+ fn: Function;
+
+ /**
+ * Line number where the currently running test is declared.
+ */
+ line: number;
+
+ /**
+ * Absolute path to the output directory for this specific test run. Each test run gets its own directory so they
+ * cannot conflict.
+ */
+ outputDir: string;
+
+ /**
+ * The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have
+ * a different `parallelIndex`. When a worker is restarted, for example after a failure, the new worker process has
+ * the same `parallelIndex`.
+ *
+ * Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about
+ * [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
+ */
+ parallelIndex: number;
+
+ /**
+ * Processed project configuration from the [configuration file](https://playwright.dev/docs/test-configuration).
+ */
+ project: FullProject;
+
+ /**
+ * Specifies a unique repeat index when running in "repeat each" mode. This mode is enabled by passing `--repeat-each`
+ * to the [command line](https://playwright.dev/docs/test-cli).
+ */
+ repeatEachIndex: number;
+
+ /**
+ * Specifies the retry number when the test is retried after a failure. The first test run has
+ * [testInfo.retry](https://playwright.dev/docs/api/class-testinfo#test-info-retry) equal to zero, the first retry has
+ * it equal to one, and so on. Learn more about [retries](https://playwright.dev/docs/test-retries#retries).
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeEach(async ({}, testInfo) => {
+ * // You can access testInfo.retry in any hook or fixture.
+ * if (testInfo.retry > 0)
+ * console.log(`Retrying!`);
+ * });
+ *
+ * test('my test', async ({ page }, testInfo) => {
+ * // Here we clear some server-side state when retrying.
+ * if (testInfo.retry)
+ * await cleanSomeCachesOnTheServer();
+ * // ...
+ * });
+ * ```
+ *
+ */
+ retry: number;
+
+ /**
+ * Absolute path to the snapshot output directory for this specific test. Each test suite gets its own directory so
+ * they cannot conflict.
+ *
+ * This property does not account for the
+ * [testProject.snapshotPathTemplate](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template)
+ * configuration.
+ */
+ snapshotDir: string;
+
+ /**
+ * **NOTE** Use of [testInfo.snapshotSuffix](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-suffix)
+ * is discouraged. Please use
+ * [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
+ * to configure snapshot paths.
+ *
+ * Suffix used to differentiate snapshots between multiple test configurations. For example, if snapshots depend on
+ * the platform, you can set `testInfo.snapshotSuffix` equal to `process.platform`. In this case
+ * `expect(value).toMatchSnapshot(snapshotName)` will use different snapshots depending on the platform. Learn more
+ * about [snapshots](https://playwright.dev/docs/test-snapshots).
+ */
+ snapshotSuffix: string;
+
+ /**
+ * Actual status for the currently running test. Available after the test has finished in
+ * [test.afterEach([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-each) hook and
+ * fixtures.
+ *
+ * Status is usually compared with the
+ * [testInfo.expectedStatus](https://playwright.dev/docs/api/class-testinfo#test-info-expected-status):
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.afterEach(async ({}, testInfo) => {
+ * if (testInfo.status !== testInfo.expectedStatus)
+ * console.log(`${testInfo.title} did not run as expected!`);
+ * });
+ * ```
+ *
+ */
+ status?: "passed"|"failed"|"timedOut"|"skipped"|"interrupted";
+
+ /**
+ * Tags that apply to the test. Learn more about [tags](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **NOTE** Any changes made to this list while the test is running will not be visible to test reporters.
+ *
+ */
+ tags: Array;
+
+ /**
+ * Test id matching the test case id in the reporter API.
+ */
+ testId: string;
+
+ /**
+ * Timeout in milliseconds for the currently running test. Zero means no timeout. Learn more about
+ * [various timeouts](https://playwright.dev/docs/test-timeouts).
+ *
+ * Timeout is usually specified in the [configuration file](https://playwright.dev/docs/test-configuration)
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeEach(async ({ page }, testInfo) => {
+ * // Extend timeout for all tests running this hook by 30 seconds.
+ * testInfo.setTimeout(testInfo.timeout + 30000);
+ * });
+ * ```
+ *
+ */
+ timeout: number;
+
+ /**
+ * The title of the currently running test as passed to `test(title, testFunction)`.
+ */
+ title: string;
+
+ /**
+ * The full title path starting with the test file name.
+ */
+ titlePath: Array;
+
+ /**
+ * The unique index of the worker process that is running the test. When a worker is restarted, for example after a
+ * failure, the new worker process gets a new unique `workerIndex`.
+ *
+ * Also available as `process.env.TEST_WORKER_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
+ * with Playwright Test.
+ */
+ workerIndex: number;
+}
+
+export type TestStatus = 'passed' | 'failed' | 'timedOut' | 'skipped' | 'interrupted';
+
+export type TestDetailsAnnotation = {
+ type: string;
+ description?: string;
+};
+
+export type TestAnnotation = TestDetailsAnnotation & {
+ location?: Location;
+};
+
+export type TestDetails = {
+ tag?: string | string[];
+ annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
+ lock?: string | string[];
+}
+
+type TestBody = (args: TestArgs, testInfo: TestInfo) => Promise | unknown;
+type ConditionBody = (args: TestArgs) => boolean;
+
+/**
+ * Playwright Test provides a `test` function to declare tests and `expect` function to write assertions.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * const name = await page.innerText('.navbar__title');
+ * expect(name).toBe('Playwright');
+ * });
+ * ```
+ *
+ */
+export interface TestType {
+ /**
+ * Declares a test.
+ * - `test(title, body)`
+ * - `test(title, details, body)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ * ```
+ *
+ * **Tags**
+ *
+ * You can tag tests by providing additional test details. Alternatively, you can include tags in the test title. Note
+ * that each tag must start with `@` symbol.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', {
+ * tag: '@smoke',
+ * }, async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ *
+ * test('another test @smoke', async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ * ```
+ *
+ * Test tags are displayed in the test report, and are available to a custom reporter via `TestCase.tags` property.
+ *
+ * You can also filter tests by their tags during test execution:
+ * - in the [command line](https://playwright.dev/docs/test-cli#all-options);
+ * - in the config with [testConfig.grep](https://playwright.dev/docs/api/class-testconfig#test-config-grep) and
+ * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep);
+ *
+ * Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Annotations**
+ *
+ * You can annotate tests by providing additional test details.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', {
+ * annotation: {
+ * type: 'issue',
+ * description: 'https://github.com/microsoft/playwright/issues/23180',
+ * },
+ * }, async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ * ```
+ *
+ * Test annotations are displayed in the test report, and are available to a custom reporter via
+ * `TestCase.annotations` property.
+ *
+ * You can also add annotations during runtime by manipulating
+ * [testInfo.annotations](https://playwright.dev/docs/api/class-testinfo#test-info-annotations).
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ *
+ * **Locks**
+ *
+ * You can declare named locks to prevent specific tests from running at the same time, while all other tests continue
+ * to run in parallel. Tests that share a lock name never run concurrently, even when they are declared in different
+ * files or belong to different [projects](https://playwright.dev/docs/test-projects). This is useful when a few tests access a shared
+ * resource that does not support concurrent access.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('update user settings', {
+ * lock: 'user-settings',
+ * }, async ({ page }) => {
+ * // This test never runs concurrently with other tests
+ * // that declare the 'user-settings' lock.
+ * });
+ * ```
+ *
+ * Learn more about [test locks](https://playwright.dev/docs/test-parallel#test-locks).
+ * @param title Test title.
+ * @param details Additional test details.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ (title: string, body: TestBody): void;
+ /**
+ * Declares a test.
+ * - `test(title, body)`
+ * - `test(title, details, body)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ * ```
+ *
+ * **Tags**
+ *
+ * You can tag tests by providing additional test details. Alternatively, you can include tags in the test title. Note
+ * that each tag must start with `@` symbol.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', {
+ * tag: '@smoke',
+ * }, async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ *
+ * test('another test @smoke', async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ * ```
+ *
+ * Test tags are displayed in the test report, and are available to a custom reporter via `TestCase.tags` property.
+ *
+ * You can also filter tests by their tags during test execution:
+ * - in the [command line](https://playwright.dev/docs/test-cli#all-options);
+ * - in the config with [testConfig.grep](https://playwright.dev/docs/api/class-testconfig#test-config-grep) and
+ * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep);
+ *
+ * Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Annotations**
+ *
+ * You can annotate tests by providing additional test details.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', {
+ * annotation: {
+ * type: 'issue',
+ * description: 'https://github.com/microsoft/playwright/issues/23180',
+ * },
+ * }, async ({ page }) => {
+ * await page.goto('https://playwright.dev/');
+ * // ...
+ * });
+ * ```
+ *
+ * Test annotations are displayed in the test report, and are available to a custom reporter via
+ * `TestCase.annotations` property.
+ *
+ * You can also add annotations during runtime by manipulating
+ * [testInfo.annotations](https://playwright.dev/docs/api/class-testinfo#test-info-annotations).
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ *
+ * **Locks**
+ *
+ * You can declare named locks to prevent specific tests from running at the same time, while all other tests continue
+ * to run in parallel. Tests that share a lock name never run concurrently, even when they are declared in different
+ * files or belong to different [projects](https://playwright.dev/docs/test-projects). This is useful when a few tests access a shared
+ * resource that does not support concurrent access.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('update user settings', {
+ * lock: 'user-settings',
+ * }, async ({ page }) => {
+ * // This test never runs concurrently with other tests
+ * // that declare the 'user-settings' lock.
+ * });
+ * ```
+ *
+ * Learn more about [test locks](https://playwright.dev/docs/test-parallel#test-locks).
+ * @param title Test title.
+ * @param details Additional test details.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ (title: string, details: TestDetails, body: TestBody): void;
+
+ /**
+ * Declares a focused test. If there are some focused tests or suites, all of them will be run but nothing else.
+ * - `test.only(title, body)`
+ * - `test.only(title, details, body)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.only('focus this test', async ({ page }) => {
+ * // Run only focused tests in the entire project.
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ only(title: string, body: TestBody): void;
+ /**
+ * Declares a focused test. If there are some focused tests or suites, all of them will be run but nothing else.
+ * - `test.only(title, body)`
+ * - `test.only(title, details, body)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.only('focus this test', async ({ page }) => {
+ * // Run only focused tests in the entire project.
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ only(title: string, details: TestDetails, body: TestBody): void;
+
+ /**
+ * Declares a group of tests.
+ * - `test.describe(title, callback)`
+ * - `test.describe(callback)`
+ * - `test.describe(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * You can declare a group of tests with a title. The title will be visible in the test report as a part of each
+ * test's title.
+ *
+ * ```js
+ * test.describe('two tests', () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Anonymous group**
+ *
+ * You can also declare a test group without a title. This is convenient to give a group of tests a common option with
+ * [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
+ *
+ * ```js
+ * test.describe(() => {
+ * test.use({ colorScheme: 'dark' });
+ *
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Tags**
+ *
+ * You can tag all tests in a group by providing additional details. Note that each tag must start with `@` symbol.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tagged tests', {
+ * tag: '@smoke',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Annotations**
+ *
+ * You can annotate all tests in a group by providing additional details.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two annotated tests', {
+ * annotation: {
+ * type: 'issue',
+ * description: 'https://github.com/microsoft/playwright/issues/23180',
+ * },
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ *
+ * **Locks**
+ *
+ * You can declare named locks for all tests in a group by providing additional details. Tests that share a lock name
+ * never run concurrently. Learn more about [test locks](https://playwright.dev/docs/test-parallel#test-locks).
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tests with a lock', {
+ * lock: 'user-settings',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details Additional details for all tests in the group.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Any tests
+ * declared in this callback will belong to the group.
+ */
+ describe: {
+ /**
+ * Declares a group of tests.
+ * - `test.describe(title, callback)`
+ * - `test.describe(callback)`
+ * - `test.describe(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * You can declare a group of tests with a title. The title will be visible in the test report as a part of each
+ * test's title.
+ *
+ * ```js
+ * test.describe('two tests', () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Anonymous group**
+ *
+ * You can also declare a test group without a title. This is convenient to give a group of tests a common option with
+ * [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
+ *
+ * ```js
+ * test.describe(() => {
+ * test.use({ colorScheme: 'dark' });
+ *
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Tags**
+ *
+ * You can tag all tests in a group by providing additional details. Note that each tag must start with `@` symbol.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tagged tests', {
+ * tag: '@smoke',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Annotations**
+ *
+ * You can annotate all tests in a group by providing additional details.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two annotated tests', {
+ * annotation: {
+ * type: 'issue',
+ * description: 'https://github.com/microsoft/playwright/issues/23180',
+ * },
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ *
+ * **Locks**
+ *
+ * You can declare named locks for all tests in a group by providing additional details. Tests that share a lock name
+ * never run concurrently. Learn more about [test locks](https://playwright.dev/docs/test-parallel#test-locks).
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tests with a lock', {
+ * lock: 'user-settings',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details Additional details for all tests in the group.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Any tests
+ * declared in this callback will belong to the group.
+ */
+ (title: string, callback: () => void): void;
+ /**
+ * Declares a group of tests.
+ * - `test.describe(title, callback)`
+ * - `test.describe(callback)`
+ * - `test.describe(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * You can declare a group of tests with a title. The title will be visible in the test report as a part of each
+ * test's title.
+ *
+ * ```js
+ * test.describe('two tests', () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Anonymous group**
+ *
+ * You can also declare a test group without a title. This is convenient to give a group of tests a common option with
+ * [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
+ *
+ * ```js
+ * test.describe(() => {
+ * test.use({ colorScheme: 'dark' });
+ *
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Tags**
+ *
+ * You can tag all tests in a group by providing additional details. Note that each tag must start with `@` symbol.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tagged tests', {
+ * tag: '@smoke',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Annotations**
+ *
+ * You can annotate all tests in a group by providing additional details.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two annotated tests', {
+ * annotation: {
+ * type: 'issue',
+ * description: 'https://github.com/microsoft/playwright/issues/23180',
+ * },
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ *
+ * **Locks**
+ *
+ * You can declare named locks for all tests in a group by providing additional details. Tests that share a lock name
+ * never run concurrently. Learn more about [test locks](https://playwright.dev/docs/test-parallel#test-locks).
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tests with a lock', {
+ * lock: 'user-settings',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details Additional details for all tests in the group.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Any tests
+ * declared in this callback will belong to the group.
+ */
+ (callback: () => void): void;
+ /**
+ * Declares a group of tests.
+ * - `test.describe(title, callback)`
+ * - `test.describe(callback)`
+ * - `test.describe(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * You can declare a group of tests with a title. The title will be visible in the test report as a part of each
+ * test's title.
+ *
+ * ```js
+ * test.describe('two tests', () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Anonymous group**
+ *
+ * You can also declare a test group without a title. This is convenient to give a group of tests a common option with
+ * [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
+ *
+ * ```js
+ * test.describe(() => {
+ * test.use({ colorScheme: 'dark' });
+ *
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * **Tags**
+ *
+ * You can tag all tests in a group by providing additional details. Note that each tag must start with `@` symbol.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tagged tests', {
+ * tag: '@smoke',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [tagging](https://playwright.dev/docs/test-annotations#tag-tests).
+ *
+ * **Annotations**
+ *
+ * You can annotate all tests in a group by providing additional details.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two annotated tests', {
+ * annotation: {
+ * type: 'issue',
+ * description: 'https://github.com/microsoft/playwright/issues/23180',
+ * },
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
+ *
+ * **Locks**
+ *
+ * You can declare named locks for all tests in a group by providing additional details. Tests that share a lock name
+ * never run concurrently. Learn more about [test locks](https://playwright.dev/docs/test-parallel#test-locks).
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.describe('two tests with a lock', {
+ * lock: 'user-settings',
+ * }, () => {
+ * test('one', async ({ page }) => {
+ * // ...
+ * });
+ *
+ * test('two', async ({ page }) => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details Additional details for all tests in the group.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Any tests
+ * declared in this callback will belong to the group.
+ */
+ (title: string, details: TestDetails, callback: () => void): void;
+
+ /**
+ * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
+ * else.
+ * - `test.describe.only(title, callback)`
+ * - `test.describe.only(callback)`
+ * - `test.describe.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.only('focused group', () => {
+ * test('in the focused group', async ({ page }) => {
+ * // This test will run
+ * });
+ * });
+ * test('not in the focused group', async ({ page }) => {
+ * // This test will not run
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(title: string, callback: () => void): void;
+ /**
+ * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
+ * else.
+ * - `test.describe.only(title, callback)`
+ * - `test.describe.only(callback)`
+ * - `test.describe.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.only('focused group', () => {
+ * test('in the focused group', async ({ page }) => {
+ * // This test will run
+ * });
+ * });
+ * test('not in the focused group', async ({ page }) => {
+ * // This test will not run
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(callback: () => void): void;
+ /**
+ * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
+ * else.
+ * - `test.describe.only(title, callback)`
+ * - `test.describe.only(callback)`
+ * - `test.describe.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.only('focused group', () => {
+ * test('in the focused group', async ({ page }) => {
+ * // This test will run
+ * });
+ * });
+ * test('not in the focused group', async ({ page }) => {
+ * // This test will not run
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(title: string, details: TestDetails, callback: () => void): void;
+
+ /**
+ * Declares a skipped test group, similarly to
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Tests in the
+ * skipped group are never run.
+ * - `test.describe.skip(title, callback)`
+ * - `test.describe.skip(title)`
+ * - `test.describe.skip(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.skip('skipped group', () => {
+ * test('example', async ({ page }) => {
+ * // This test will not run
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.skip(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.skip(title[, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-skip).
+ * Any tests added in this callback will belong to the group, and will not be run.
+ */
+ skip(title: string, callback: () => void): void;
+ /**
+ * Declares a skipped test group, similarly to
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Tests in the
+ * skipped group are never run.
+ * - `test.describe.skip(title, callback)`
+ * - `test.describe.skip(title)`
+ * - `test.describe.skip(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.skip('skipped group', () => {
+ * test('example', async ({ page }) => {
+ * // This test will not run
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.skip(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.skip(title[, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-skip).
+ * Any tests added in this callback will belong to the group, and will not be run.
+ */
+ skip(callback: () => void): void;
+ /**
+ * Declares a skipped test group, similarly to
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Tests in the
+ * skipped group are never run.
+ * - `test.describe.skip(title, callback)`
+ * - `test.describe.skip(title)`
+ * - `test.describe.skip(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.skip('skipped group', () => {
+ * test('example', async ({ page }) => {
+ * // This test will not run
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.skip(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.skip(title[, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-skip).
+ * Any tests added in this callback will belong to the group, and will not be run.
+ */
+ skip(title: string, details: TestDetails, callback: () => void): void;
+
+ /**
+ * Declares a test group similarly to
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Tests in
+ * this group are marked as "fixme" and will not be executed.
+ * - `test.describe.fixme(title, callback)`
+ * - `test.describe.fixme(callback)`
+ * - `test.describe.fixme(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.fixme('broken tests that should be fixed', () => {
+ * test('example', async ({ page }) => {
+ * // This test will not run
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.fixme(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.fixme([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-fixme).
+ * Any tests added in this callback will belong to the group, and will not be run.
+ */
+ fixme(title: string, callback: () => void): void;
+ /**
+ * Declares a test group similarly to
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Tests in
+ * this group are marked as "fixme" and will not be executed.
+ * - `test.describe.fixme(title, callback)`
+ * - `test.describe.fixme(callback)`
+ * - `test.describe.fixme(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.fixme('broken tests that should be fixed', () => {
+ * test('example', async ({ page }) => {
+ * // This test will not run
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.fixme(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.fixme([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-fixme).
+ * Any tests added in this callback will belong to the group, and will not be run.
+ */
+ fixme(callback: () => void): void;
+ /**
+ * Declares a test group similarly to
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe). Tests in
+ * this group are marked as "fixme" and will not be executed.
+ * - `test.describe.fixme(title, callback)`
+ * - `test.describe.fixme(callback)`
+ * - `test.describe.fixme(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.fixme('broken tests that should be fixed', () => {
+ * test('example', async ({ page }) => {
+ * // This test will not run
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.fixme(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.fixme([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-fixme).
+ * Any tests added in this callback will belong to the group, and will not be run.
+ */
+ fixme(title: string, details: TestDetails, callback: () => void): void;
+
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
+ * skipped. All tests in a group are retried together.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial(title, callback)`
+ * - `test.describe.serial(title)`
+ * - `test.describe.serial(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial('group', () => {
+ * test('runs first', async ({ page }) => {});
+ * test('runs second', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial).
+ * Any tests added in this callback will belong to the group.
+ */
+ serial: {
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
+ * skipped. All tests in a group are retried together.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial(title, callback)`
+ * - `test.describe.serial(title)`
+ * - `test.describe.serial(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial('group', () => {
+ * test('runs first', async ({ page }) => {});
+ * test('runs second', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial).
+ * Any tests added in this callback will belong to the group.
+ */
+ (title: string, callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
+ * skipped. All tests in a group are retried together.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial(title, callback)`
+ * - `test.describe.serial(title)`
+ * - `test.describe.serial(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial('group', () => {
+ * test('runs first', async ({ page }) => {});
+ * test('runs second', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial).
+ * Any tests added in this callback will belong to the group.
+ */
+ (callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
+ * skipped. All tests in a group are retried together.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial(title, callback)`
+ * - `test.describe.serial(title)`
+ * - `test.describe.serial(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial('group', () => {
+ * test('runs first', async ({ page }) => {});
+ * test('runs second', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial).
+ * Any tests added in this callback will belong to the group.
+ */
+ (title: string, details: TestDetails, callback: () => void): void;
+
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
+ * tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
+ * them will be run but nothing else.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial.only(title, callback)`
+ * - `test.describe.serial.only(title)`
+ * - `test.describe.serial.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial.only('group', () => {
+ * test('runs first', async ({ page }) => {
+ * });
+ * test('runs second', async ({ page }) => {
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial.only(title[, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(title: string, callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
+ * tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
+ * them will be run but nothing else.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial.only(title, callback)`
+ * - `test.describe.serial.only(title)`
+ * - `test.describe.serial.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial.only('group', () => {
+ * test('runs first', async ({ page }) => {
+ * });
+ * test('runs second', async ({ page }) => {
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial.only(title[, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
+ * tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
+ * them will be run but nothing else.
+ *
+ * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
+ * independently.
+ *
+ * - `test.describe.serial.only(title, callback)`
+ * - `test.describe.serial.only(title)`
+ * - `test.describe.serial.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.serial.only('group', () => {
+ * test('runs first', async ({ page }) => {
+ * });
+ * test('runs second', async ({ page }) => {
+ * });
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.serial.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.serial.only(title[, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(title: string, details: TestDetails, callback: () => void): void;
+ };
+
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
+ * another, but using
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel)
+ * allows them to run in parallel.
+ * - `test.describe.parallel(title, callback)`
+ * - `test.describe.parallel(callback)`
+ * - `test.describe.parallel(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
+ * the parallel tests executes all relevant hooks.
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel).
+ * Any tests added in this callback will belong to the group.
+ */
+ parallel: {
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
+ * another, but using
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel)
+ * allows them to run in parallel.
+ * - `test.describe.parallel(title, callback)`
+ * - `test.describe.parallel(callback)`
+ * - `test.describe.parallel(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
+ * the parallel tests executes all relevant hooks.
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel).
+ * Any tests added in this callback will belong to the group.
+ */
+ (title: string, callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
+ * another, but using
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel)
+ * allows them to run in parallel.
+ * - `test.describe.parallel(title, callback)`
+ * - `test.describe.parallel(callback)`
+ * - `test.describe.parallel(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
+ * the parallel tests executes all relevant hooks.
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel).
+ * Any tests added in this callback will belong to the group.
+ */
+ (callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
+ * another, but using
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel)
+ * allows them to run in parallel.
+ * - `test.describe.parallel(title, callback)`
+ * - `test.describe.parallel(callback)`
+ * - `test.describe.parallel(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
+ * the parallel tests executes all relevant hooks.
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel).
+ * Any tests added in this callback will belong to the group.
+ */
+ (title: string, details: TestDetails, callback: () => void): void;
+
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a focused group of tests that could be run in parallel. This is similar to
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel),
+ * but focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
+ * - `test.describe.parallel.only(title, callback)`
+ * - `test.describe.parallel.only(callback)`
+ * - `test.describe.parallel.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel.only('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(title: string, callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a focused group of tests that could be run in parallel. This is similar to
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel),
+ * but focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
+ * - `test.describe.parallel.only(title, callback)`
+ * - `test.describe.parallel.only(callback)`
+ * - `test.describe.parallel.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel.only('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(callback: () => void): void;
+ /**
+ * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
+ * the preferred way of configuring the execution mode.
+ *
+ * Declares a focused group of tests that could be run in parallel. This is similar to
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel),
+ * but focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
+ * - `test.describe.parallel.only(title, callback)`
+ * - `test.describe.parallel.only(callback)`
+ * - `test.describe.parallel.only(title, details, callback)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.describe.parallel.only('group', () => {
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * You can also omit the title.
+ *
+ * ```js
+ * test.describe.parallel.only(() => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Group title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for
+ * details description.
+ * @param callback A callback that is run immediately when calling
+ * [test.describe.parallel.only([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
+ * Any tests added in this callback will belong to the group.
+ */
+ only(title: string, details: TestDetails, callback: () => void): void;
+ };
+
+ /**
+ * Configures the enclosing scope. Can be executed either on the top level or inside a describe. Configuration applies
+ * to the entire scope, regardless of whether it run before or after the test declaration.
+ *
+ * Learn more about the execution modes [here](https://playwright.dev/docs/test-parallel).
+ *
+ * **Usage**
+ * - Running tests in parallel.
+ *
+ * ```js
+ * // Run all the tests in the file concurrently using parallel workers.
+ * test.describe.configure({ mode: 'parallel' });
+ * test('runs in parallel 1', async ({ page }) => {});
+ * test('runs in parallel 2', async ({ page }) => {});
+ * ```
+ *
+ * - Running tests in order, retrying each failed test independently.
+ *
+ * This is the default mode. It can be useful to set it explicitly to override project configuration that uses
+ * `fullyParallel`.
+ *
+ * ```js
+ * // Tests in this file run in order. Retries, if any, run independently.
+ * test.describe.configure({ mode: 'default' });
+ * test('runs first', async ({ page }) => {});
+ * test('runs second', async ({ page }) => {});
+ * ```
+ *
+ * - Running tests serially, retrying from the start. If one of the serial tests fails, all subsequent tests are
+ * skipped.
+ *
+ * **NOTE** Running serially is not recommended. It is usually better to make your tests isolated, so they can be
+ * run independently.
+ *
+ * ```js
+ * // Annotate tests as inter-dependent.
+ * test.describe.configure({ mode: 'serial' });
+ * test('runs first', async ({ page }) => {});
+ * test('runs second', async ({ page }) => {});
+ * ```
+ *
+ * - Configuring retries and timeout for each test.
+ *
+ * ```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 }) => {});
+ * ```
+ *
+ * - Run multiple describes in parallel, but tests inside each describe in order.
+ *
+ * ```js
+ * test.describe.configure({ mode: 'parallel' });
+ *
+ * test.describe('A, runs in parallel with B', () => {
+ * test.describe.configure({ mode: 'default' });
+ * test('in order A1', async ({ page }) => {});
+ * test('in order A2', async ({ page }) => {});
+ * });
+ *
+ * test.describe('B, runs in parallel with A', () => {
+ * test.describe.configure({ mode: 'default' });
+ * test('in order B1', async ({ page }) => {});
+ * test('in order B2', async ({ page }) => {});
+ * });
+ * ```
+ *
+ * @param options
+ */
+ configure: (options: { mode?: 'default' | 'parallel' | 'serial', retries?: number, timeout?: number }) => void;
+ };
+
+ /**
+ * Skip a test. Playwright will not run the test past the `test.skip()` call.
+ *
+ * Skipped tests are not supposed to be ever run. If you intend to fix the test, use
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme)
+ * instead.
+ *
+ * To declare a skipped test:
+ * - `test.skip(title, body)`
+ * - `test.skip(title, details, body)`
+ *
+ * To skip a test at runtime:
+ * - `test.skip(condition, description)`
+ * - `test.skip(callback, description)`
+ * - `test.skip()`
+ *
+ * **Usage**
+ *
+ * You can declare a skipped test, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip('never run', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be skipped in some configurations, but not all, you can skip the test inside the test body
+ * based on some condition. We recommend passing a `description` argument in this case. Playwright will run the test,
+ * but abort it immediately after the `test.skip` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('Safari-only test', async ({ page, browserName }) => {
+ * test.skip(browserName !== 'webkit', 'This feature is Safari-only');
+ * // ...
+ * });
+ * ```
+ *
+ * You can skip all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group based
+ * on some condition with a single `test.skip(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip(({ browserName }) => browserName !== 'webkit', 'Safari-only');
+ *
+ * test('Safari-only test 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('Safari-only test 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
+ * recommend using `test.skip(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.skip();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "skipped" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ skip(title: string, body: TestBody): void;
+ /**
+ * Skip a test. Playwright will not run the test past the `test.skip()` call.
+ *
+ * Skipped tests are not supposed to be ever run. If you intend to fix the test, use
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme)
+ * instead.
+ *
+ * To declare a skipped test:
+ * - `test.skip(title, body)`
+ * - `test.skip(title, details, body)`
+ *
+ * To skip a test at runtime:
+ * - `test.skip(condition, description)`
+ * - `test.skip(callback, description)`
+ * - `test.skip()`
+ *
+ * **Usage**
+ *
+ * You can declare a skipped test, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip('never run', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be skipped in some configurations, but not all, you can skip the test inside the test body
+ * based on some condition. We recommend passing a `description` argument in this case. Playwright will run the test,
+ * but abort it immediately after the `test.skip` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('Safari-only test', async ({ page, browserName }) => {
+ * test.skip(browserName !== 'webkit', 'This feature is Safari-only');
+ * // ...
+ * });
+ * ```
+ *
+ * You can skip all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group based
+ * on some condition with a single `test.skip(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip(({ browserName }) => browserName !== 'webkit', 'Safari-only');
+ *
+ * test('Safari-only test 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('Safari-only test 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
+ * recommend using `test.skip(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.skip();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "skipped" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ skip(title: string, details: TestDetails, body: TestBody): void;
+ /**
+ * Skip a test. Playwright will not run the test past the `test.skip()` call.
+ *
+ * Skipped tests are not supposed to be ever run. If you intend to fix the test, use
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme)
+ * instead.
+ *
+ * To declare a skipped test:
+ * - `test.skip(title, body)`
+ * - `test.skip(title, details, body)`
+ *
+ * To skip a test at runtime:
+ * - `test.skip(condition, description)`
+ * - `test.skip(callback, description)`
+ * - `test.skip()`
+ *
+ * **Usage**
+ *
+ * You can declare a skipped test, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip('never run', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be skipped in some configurations, but not all, you can skip the test inside the test body
+ * based on some condition. We recommend passing a `description` argument in this case. Playwright will run the test,
+ * but abort it immediately after the `test.skip` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('Safari-only test', async ({ page, browserName }) => {
+ * test.skip(browserName !== 'webkit', 'This feature is Safari-only');
+ * // ...
+ * });
+ * ```
+ *
+ * You can skip all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group based
+ * on some condition with a single `test.skip(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip(({ browserName }) => browserName !== 'webkit', 'Safari-only');
+ *
+ * test('Safari-only test 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('Safari-only test 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
+ * recommend using `test.skip(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.skip();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "skipped" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ skip(): void;
+ /**
+ * Skip a test. Playwright will not run the test past the `test.skip()` call.
+ *
+ * Skipped tests are not supposed to be ever run. If you intend to fix the test, use
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme)
+ * instead.
+ *
+ * To declare a skipped test:
+ * - `test.skip(title, body)`
+ * - `test.skip(title, details, body)`
+ *
+ * To skip a test at runtime:
+ * - `test.skip(condition, description)`
+ * - `test.skip(callback, description)`
+ * - `test.skip()`
+ *
+ * **Usage**
+ *
+ * You can declare a skipped test, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip('never run', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be skipped in some configurations, but not all, you can skip the test inside the test body
+ * based on some condition. We recommend passing a `description` argument in this case. Playwright will run the test,
+ * but abort it immediately after the `test.skip` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('Safari-only test', async ({ page, browserName }) => {
+ * test.skip(browserName !== 'webkit', 'This feature is Safari-only');
+ * // ...
+ * });
+ * ```
+ *
+ * You can skip all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group based
+ * on some condition with a single `test.skip(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip(({ browserName }) => browserName !== 'webkit', 'Safari-only');
+ *
+ * test('Safari-only test 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('Safari-only test 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
+ * recommend using `test.skip(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.skip();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "skipped" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ skip(condition: boolean, description?: string): void;
+ /**
+ * Skip a test. Playwright will not run the test past the `test.skip()` call.
+ *
+ * Skipped tests are not supposed to be ever run. If you intend to fix the test, use
+ * [test.fixme([title, details, body, condition, callback, description])](https://playwright.dev/docs/api/class-test#test-fixme)
+ * instead.
+ *
+ * To declare a skipped test:
+ * - `test.skip(title, body)`
+ * - `test.skip(title, details, body)`
+ *
+ * To skip a test at runtime:
+ * - `test.skip(condition, description)`
+ * - `test.skip(callback, description)`
+ * - `test.skip()`
+ *
+ * **Usage**
+ *
+ * You can declare a skipped test, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip('never run', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be skipped in some configurations, but not all, you can skip the test inside the test body
+ * based on some condition. We recommend passing a `description` argument in this case. Playwright will run the test,
+ * but abort it immediately after the `test.skip` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('Safari-only test', async ({ page, browserName }) => {
+ * test.skip(browserName !== 'webkit', 'This feature is Safari-only');
+ * // ...
+ * });
+ * ```
+ *
+ * You can skip all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group based
+ * on some condition with a single `test.skip(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.skip(({ browserName }) => browserName !== 'webkit', 'Safari-only');
+ *
+ * test('Safari-only test 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('Safari-only test 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
+ * recommend using `test.skip(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.skip();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "skipped" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ skip(callback: ConditionBody, description?: string): void;
+
+ /**
+ * Mark a test as "fixme", with the intention to fix it. Playwright will not run the test past the `test.fixme()`
+ * call.
+ *
+ * To declare a "fixme" test:
+ * - `test.fixme(title, body)`
+ * - `test.fixme(title, details, body)`
+ *
+ * To annotate test as "fixme" at runtime:
+ * - `test.fixme(condition, description)`
+ * - `test.fixme(callback, description)`
+ * - `test.fixme()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as to be fixed, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme('to be fixed', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be fixed in some configurations, but not all, you can mark the test as "fixme" inside the test
+ * body based on some condition. We recommend passing a `description` argument in this case. Playwright will run the
+ * test, but abort it immediately after the `test.fixme` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('to be fixed in Safari', async ({ page, browserName }) => {
+ * test.fixme(browserName === 'webkit', 'This feature breaks in Safari for some reason');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "fixme" based on some condition with a single `test.fixme(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme(({ browserName }) => browserName === 'webkit', 'Should figure out the issue');
+ *
+ * test('to be fixed in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('to be fixed in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fixme()` without arguments inside the test body to always mark the test as failed. We
+ * recommend using `test.fixme(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fixme();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "fixme" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fixme(title: string, body: TestBody): void;
+ /**
+ * Mark a test as "fixme", with the intention to fix it. Playwright will not run the test past the `test.fixme()`
+ * call.
+ *
+ * To declare a "fixme" test:
+ * - `test.fixme(title, body)`
+ * - `test.fixme(title, details, body)`
+ *
+ * To annotate test as "fixme" at runtime:
+ * - `test.fixme(condition, description)`
+ * - `test.fixme(callback, description)`
+ * - `test.fixme()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as to be fixed, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme('to be fixed', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be fixed in some configurations, but not all, you can mark the test as "fixme" inside the test
+ * body based on some condition. We recommend passing a `description` argument in this case. Playwright will run the
+ * test, but abort it immediately after the `test.fixme` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('to be fixed in Safari', async ({ page, browserName }) => {
+ * test.fixme(browserName === 'webkit', 'This feature breaks in Safari for some reason');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "fixme" based on some condition with a single `test.fixme(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme(({ browserName }) => browserName === 'webkit', 'Should figure out the issue');
+ *
+ * test('to be fixed in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('to be fixed in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fixme()` without arguments inside the test body to always mark the test as failed. We
+ * recommend using `test.fixme(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fixme();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "fixme" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fixme(title: string, details: TestDetails, body: TestBody): void;
+ /**
+ * Mark a test as "fixme", with the intention to fix it. Playwright will not run the test past the `test.fixme()`
+ * call.
+ *
+ * To declare a "fixme" test:
+ * - `test.fixme(title, body)`
+ * - `test.fixme(title, details, body)`
+ *
+ * To annotate test as "fixme" at runtime:
+ * - `test.fixme(condition, description)`
+ * - `test.fixme(callback, description)`
+ * - `test.fixme()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as to be fixed, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme('to be fixed', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be fixed in some configurations, but not all, you can mark the test as "fixme" inside the test
+ * body based on some condition. We recommend passing a `description` argument in this case. Playwright will run the
+ * test, but abort it immediately after the `test.fixme` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('to be fixed in Safari', async ({ page, browserName }) => {
+ * test.fixme(browserName === 'webkit', 'This feature breaks in Safari for some reason');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "fixme" based on some condition with a single `test.fixme(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme(({ browserName }) => browserName === 'webkit', 'Should figure out the issue');
+ *
+ * test('to be fixed in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('to be fixed in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fixme()` without arguments inside the test body to always mark the test as failed. We
+ * recommend using `test.fixme(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fixme();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "fixme" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fixme(): void;
+ /**
+ * Mark a test as "fixme", with the intention to fix it. Playwright will not run the test past the `test.fixme()`
+ * call.
+ *
+ * To declare a "fixme" test:
+ * - `test.fixme(title, body)`
+ * - `test.fixme(title, details, body)`
+ *
+ * To annotate test as "fixme" at runtime:
+ * - `test.fixme(condition, description)`
+ * - `test.fixme(callback, description)`
+ * - `test.fixme()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as to be fixed, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme('to be fixed', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be fixed in some configurations, but not all, you can mark the test as "fixme" inside the test
+ * body based on some condition. We recommend passing a `description` argument in this case. Playwright will run the
+ * test, but abort it immediately after the `test.fixme` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('to be fixed in Safari', async ({ page, browserName }) => {
+ * test.fixme(browserName === 'webkit', 'This feature breaks in Safari for some reason');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "fixme" based on some condition with a single `test.fixme(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme(({ browserName }) => browserName === 'webkit', 'Should figure out the issue');
+ *
+ * test('to be fixed in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('to be fixed in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fixme()` without arguments inside the test body to always mark the test as failed. We
+ * recommend using `test.fixme(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fixme();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "fixme" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fixme(condition: boolean, description?: string): void;
+ /**
+ * Mark a test as "fixme", with the intention to fix it. Playwright will not run the test past the `test.fixme()`
+ * call.
+ *
+ * To declare a "fixme" test:
+ * - `test.fixme(title, body)`
+ * - `test.fixme(title, details, body)`
+ *
+ * To annotate test as "fixme" at runtime:
+ * - `test.fixme(condition, description)`
+ * - `test.fixme(callback, description)`
+ * - `test.fixme()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as to be fixed, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme('to be fixed', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test should be fixed in some configurations, but not all, you can mark the test as "fixme" inside the test
+ * body based on some condition. We recommend passing a `description` argument in this case. Playwright will run the
+ * test, but abort it immediately after the `test.fixme` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('to be fixed in Safari', async ({ page, browserName }) => {
+ * test.fixme(browserName === 'webkit', 'This feature breaks in Safari for some reason');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "fixme" based on some condition with a single `test.fixme(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fixme(({ browserName }) => browserName === 'webkit', 'Should figure out the issue');
+ *
+ * test('to be fixed in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('to be fixed in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fixme()` without arguments inside the test body to always mark the test as failed. We
+ * recommend using `test.fixme(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fixme();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "fixme" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
+ * when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fixme(callback: ConditionBody, description?: string): void;
+
+ /**
+ * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful
+ * for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ *
+ * To declare a "failing" test:
+ * - `test.fail(title, body)`
+ * - `test.fail(title, details, body)`
+ *
+ * To annotate test as "failing" at runtime:
+ * - `test.fail(condition, description)`
+ * - `test.fail(callback, description)`
+ * - `test.fail()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as failing, so that Playwright ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail('not yet ready', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based
+ * on some condition. We recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('fail in WebKit', async ({ page, browserName }) => {
+ * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "should fail" based on some condition with a single `test.fail(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet');
+ *
+ * test('fail in WebKit 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in WebKit 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We
+ * recommend declaring a failing test with `test.fail(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fail();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
+ * "should fail" when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ fail: {
+ /**
+ * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful
+ * for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ *
+ * To declare a "failing" test:
+ * - `test.fail(title, body)`
+ * - `test.fail(title, details, body)`
+ *
+ * To annotate test as "failing" at runtime:
+ * - `test.fail(condition, description)`
+ * - `test.fail(callback, description)`
+ * - `test.fail()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as failing, so that Playwright ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail('not yet ready', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based
+ * on some condition. We recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('fail in WebKit', async ({ page, browserName }) => {
+ * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "should fail" based on some condition with a single `test.fail(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet');
+ *
+ * test('fail in WebKit 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in WebKit 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We
+ * recommend declaring a failing test with `test.fail(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fail();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
+ * "should fail" when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ (title: string, body: TestBody): void;
+ /**
+ * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful
+ * for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ *
+ * To declare a "failing" test:
+ * - `test.fail(title, body)`
+ * - `test.fail(title, details, body)`
+ *
+ * To annotate test as "failing" at runtime:
+ * - `test.fail(condition, description)`
+ * - `test.fail(callback, description)`
+ * - `test.fail()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as failing, so that Playwright ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail('not yet ready', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based
+ * on some condition. We recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('fail in WebKit', async ({ page, browserName }) => {
+ * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "should fail" based on some condition with a single `test.fail(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet');
+ *
+ * test('fail in WebKit 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in WebKit 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We
+ * recommend declaring a failing test with `test.fail(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fail();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
+ * "should fail" when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ (title: string, details: TestDetails, body: TestBody): void;
+ /**
+ * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful
+ * for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ *
+ * To declare a "failing" test:
+ * - `test.fail(title, body)`
+ * - `test.fail(title, details, body)`
+ *
+ * To annotate test as "failing" at runtime:
+ * - `test.fail(condition, description)`
+ * - `test.fail(callback, description)`
+ * - `test.fail()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as failing, so that Playwright ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail('not yet ready', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based
+ * on some condition. We recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('fail in WebKit', async ({ page, browserName }) => {
+ * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "should fail" based on some condition with a single `test.fail(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet');
+ *
+ * test('fail in WebKit 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in WebKit 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We
+ * recommend declaring a failing test with `test.fail(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fail();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
+ * "should fail" when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ (condition: boolean, description?: string): void;
+ /**
+ * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful
+ * for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ *
+ * To declare a "failing" test:
+ * - `test.fail(title, body)`
+ * - `test.fail(title, details, body)`
+ *
+ * To annotate test as "failing" at runtime:
+ * - `test.fail(condition, description)`
+ * - `test.fail(callback, description)`
+ * - `test.fail()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as failing, so that Playwright ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail('not yet ready', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based
+ * on some condition. We recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('fail in WebKit', async ({ page, browserName }) => {
+ * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "should fail" based on some condition with a single `test.fail(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet');
+ *
+ * test('fail in WebKit 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in WebKit 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We
+ * recommend declaring a failing test with `test.fail(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fail();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
+ * "should fail" when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ (callback: ConditionBody, description?: string): void;
+ /**
+ * Marks a test as "should fail". Playwright runs this test and ensures that it is actually failing. This is useful
+ * for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ *
+ * To declare a "failing" test:
+ * - `test.fail(title, body)`
+ * - `test.fail(title, details, body)`
+ *
+ * To annotate test as "failing" at runtime:
+ * - `test.fail(condition, description)`
+ * - `test.fail(callback, description)`
+ * - `test.fail()`
+ *
+ * **Usage**
+ *
+ * You can declare a test as failing, so that Playwright ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail('not yet ready', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * If your test fails in some configurations, but not all, you can mark the test as failing inside the test body based
+ * on some condition. We recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('fail in WebKit', async ({ page, browserName }) => {
+ * test.fail(browserName === 'webkit', 'This feature is not implemented for Mac yet');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "should fail" based on some condition with a single `test.fail(callback, description)` call.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail(({ browserName }) => browserName === 'webkit', 'not implemented yet');
+ *
+ * test('fail in WebKit 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in WebKit 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * You can also call `test.fail()` without arguments inside the test body to always mark the test as failed. We
+ * recommend declaring a failing test with `test.fail(title, body)` instead.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('less readable', async ({ page }) => {
+ * test.fail();
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.(call)(title[, details, body])](https://playwright.dev/docs/api/class-test#test-call) for test details
+ * description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ * @param condition Test is marked as "should fail" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
+ * "should fail" when the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ (): void;
+
+ /**
+ * You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when
+ * debugging a failing test or working on a specific issue.
+ *
+ * To declare a focused "failing" test:
+ * - `test.fail.only(title, body)`
+ * - `test.fail.only(title, details, body)`
+ *
+ * **Usage**
+ *
+ * You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail.only('focused failing test', async ({ page }) => {
+ * // This test is expected to fail
+ * });
+ * test('not in the focused group', async ({ page }) => {
+ * // This test will not run
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
+ * details description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ only(title: string, body: TestBody): void;
+ /**
+ * You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when
+ * debugging a failing test or working on a specific issue.
+ *
+ * To declare a focused "failing" test:
+ * - `test.fail.only(title, body)`
+ * - `test.fail.only(title, details, body)`
+ *
+ * **Usage**
+ *
+ * You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.fail.only('focused failing test', async ({ page }) => {
+ * // This test is expected to fail
+ * });
+ * test('not in the focused group', async ({ page }) => {
+ * // This test will not run
+ * });
+ * ```
+ *
+ * @param title Test title.
+ * @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
+ * details description.
+ * @param body Test body that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ only(title: string, details: TestDetails, body: TestBody): void;
+ }
+
+ /**
+ * Aborts the currently running test by throwing an error. The test is immediately marked as failed and execution
+ * stops. This is useful from inside a fixture or a route handler when you have detected an unrecoverable misuse and
+ * want to fail the test right away.
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('does not publish to shared page', async ({ page }) => {
+ * await page.route('**\/publish', route => {
+ * test.abort('Tests must not publish to the shared page. Use the `clone` option.');
+ * return route.abort();
+ * });
+ * // ...
+ * });
+ * ```
+ *
+ * @param message Optional message describing the reason for the abort. It will be included in the failure error.
+ */
+ abort(message?: string): never;
+
+ /**
+ * Marks a test as "slow". Slow test will be given triple the default timeout.
+ *
+ * Note that [test.slow([condition, callback, description])](https://playwright.dev/docs/api/class-test#test-slow)
+ * cannot be used in a `beforeAll` or `afterAll` hook. Use
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout) instead.
+ * - `test.slow()`
+ * - `test.slow(condition, description)`
+ * - `test.slow(callback, description)`
+ *
+ * **Usage**
+ *
+ * You can mark a test as slow by calling `test.slow()` inside the test body.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('slow test', async ({ page }) => {
+ * test.slow();
+ * // ...
+ * });
+ * ```
+ *
+ * If your test is slow in some configurations, but not all, you can mark it as slow based on a condition. We
+ * recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('slow in Safari', async ({ page, browserName }) => {
+ * test.slow(browserName === 'webkit', 'This feature is slow in Safari');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "slow" based on some condition by passing a callback.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.slow(({ browserName }) => browserName === 'webkit', 'all tests are slow in Safari');
+ *
+ * test('slow in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param condition Test is marked as "slow" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "slow", based on test fixtures. Test or tests are marked as "slow" when
+ * the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ slow(): void;
+ /**
+ * Marks a test as "slow". Slow test will be given triple the default timeout.
+ *
+ * Note that [test.slow([condition, callback, description])](https://playwright.dev/docs/api/class-test#test-slow)
+ * cannot be used in a `beforeAll` or `afterAll` hook. Use
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout) instead.
+ * - `test.slow()`
+ * - `test.slow(condition, description)`
+ * - `test.slow(callback, description)`
+ *
+ * **Usage**
+ *
+ * You can mark a test as slow by calling `test.slow()` inside the test body.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('slow test', async ({ page }) => {
+ * test.slow();
+ * // ...
+ * });
+ * ```
+ *
+ * If your test is slow in some configurations, but not all, you can mark it as slow based on a condition. We
+ * recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('slow in Safari', async ({ page, browserName }) => {
+ * test.slow(browserName === 'webkit', 'This feature is slow in Safari');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "slow" based on some condition by passing a callback.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.slow(({ browserName }) => browserName === 'webkit', 'all tests are slow in Safari');
+ *
+ * test('slow in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param condition Test is marked as "slow" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "slow", based on test fixtures. Test or tests are marked as "slow" when
+ * the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ slow(condition: boolean, description?: string): void;
+ /**
+ * Marks a test as "slow". Slow test will be given triple the default timeout.
+ *
+ * Note that [test.slow([condition, callback, description])](https://playwright.dev/docs/api/class-test#test-slow)
+ * cannot be used in a `beforeAll` or `afterAll` hook. Use
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout) instead.
+ * - `test.slow()`
+ * - `test.slow(condition, description)`
+ * - `test.slow(callback, description)`
+ *
+ * **Usage**
+ *
+ * You can mark a test as slow by calling `test.slow()` inside the test body.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('slow test', async ({ page }) => {
+ * test.slow();
+ * // ...
+ * });
+ * ```
+ *
+ * If your test is slow in some configurations, but not all, you can mark it as slow based on a condition. We
+ * recommend passing a `description` argument in this case.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('slow in Safari', async ({ page, browserName }) => {
+ * test.slow(browserName === 'webkit', 'This feature is slow in Safari');
+ * // ...
+ * });
+ * ```
+ *
+ * You can mark all tests in a file or
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
+ * "slow" based on some condition by passing a callback.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.slow(({ browserName }) => browserName === 'webkit', 'all tests are slow in Safari');
+ *
+ * test('slow in Safari 1', async ({ page }) => {
+ * // ...
+ * });
+ * test('fail in Safari 2', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * @param condition Test is marked as "slow" when the condition is `true`.
+ * @param callback A function that returns whether to mark as "slow", based on test fixtures. Test or tests are marked as "slow" when
+ * the return value is `true`.
+ * @param description Optional description that will be reflected in a test report.
+ */
+ slow(callback: ConditionBody, description?: string): void;
+
+ /**
+ * Changes the timeout for the test. Zero means no timeout. Learn more about [various timeouts](https://playwright.dev/docs/test-timeouts).
+ *
+ * Timeout for the currently running test is available through
+ * [testInfo.timeout](https://playwright.dev/docs/api/class-testinfo#test-info-timeout).
+ *
+ * **Usage**
+ * - Changing test timeout.
+ *
+ * ```js
+ * test('very slow test', async ({ page }) => {
+ * test.setTimeout(120000);
+ * // ...
+ * });
+ * ```
+ *
+ * - Changing timeout from a slow `beforeEach` hook. Note that this affects the test timeout that is shared with
+ * `beforeEach` hooks.
+ *
+ * ```js
+ * test.beforeEach(async ({ page }, testInfo) => {
+ * // Extend timeout for all tests running this hook by 30 seconds.
+ * test.setTimeout(testInfo.timeout + 30000);
+ * });
+ * ```
+ *
+ * - Changing timeout for a `beforeAll` or `afterAll` hook. Note this affects the hook's timeout, not the test
+ * timeout.
+ *
+ * ```js
+ * test.beforeAll(async () => {
+ * // Set timeout for this hook.
+ * test.setTimeout(60000);
+ * });
+ * ```
+ *
+ * - Changing timeout for all tests in a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group.
+ *
+ * ```js
+ * test.describe('group', () => {
+ * // Applies to all tests in this group.
+ * test.describe.configure({ timeout: 60000 });
+ *
+ * test('test one', async () => { /* ... *\/ });
+ * test('test two', async () => { /* ... *\/ });
+ * test('test three', async () => { /* ... *\/ });
+ * });
+ * ```
+ *
+ * @param timeout Timeout in milliseconds.
+ */
+ setTimeout(timeout: number): void;
+ /**
+ * Declares a `beforeEach` hook that is executed before each test.
+ *
+ * When called in the scope of a test file, runs before each test in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * before each test in the group.
+ *
+ * You can access all the same [Fixtures](https://playwright.dev/docs/api/class-fixtures) as the test body itself, and
+ * also the [TestInfo](https://playwright.dev/docs/api/class-testinfo) object that gives a lot of useful information.
+ * For example, you can navigate the page before starting the test.
+ *
+ * You can use [test.afterEach([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-each) to
+ * teardown any resources set up in `beforeEach`.
+ * - `test.beforeEach(hookFunction)`
+ * - `test.beforeEach(title, hookFunction)`
+ *
+ * **Details**
+ *
+ * When multiple `beforeEach` hooks are added, they will run in the order of their registration.
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeEach(async ({ page }) => {
+ * console.log(`Running ${test.info().title}`);
+ * await page.goto('https://my.start.url/');
+ * });
+ *
+ * test('my test', async ({ page }) => {
+ * expect(page.url()).toBe('https://my.start.url/');
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * // example.spec.ts
+ * test.beforeEach('Open start URL', async ({ page }) => {
+ * console.log(`Running ${test.info().title}`);
+ * await page.goto('https://my.start.url/');
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ beforeEach(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares a `beforeEach` hook that is executed before each test.
+ *
+ * When called in the scope of a test file, runs before each test in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * before each test in the group.
+ *
+ * You can access all the same [Fixtures](https://playwright.dev/docs/api/class-fixtures) as the test body itself, and
+ * also the [TestInfo](https://playwright.dev/docs/api/class-testinfo) object that gives a lot of useful information.
+ * For example, you can navigate the page before starting the test.
+ *
+ * You can use [test.afterEach([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-each) to
+ * teardown any resources set up in `beforeEach`.
+ * - `test.beforeEach(hookFunction)`
+ * - `test.beforeEach(title, hookFunction)`
+ *
+ * **Details**
+ *
+ * When multiple `beforeEach` hooks are added, they will run in the order of their registration.
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeEach(async ({ page }) => {
+ * console.log(`Running ${test.info().title}`);
+ * await page.goto('https://my.start.url/');
+ * });
+ *
+ * test('my test', async ({ page }) => {
+ * expect(page.url()).toBe('https://my.start.url/');
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * // example.spec.ts
+ * test.beforeEach('Open start URL', async ({ page }) => {
+ * console.log(`Running ${test.info().title}`);
+ * await page.goto('https://my.start.url/');
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ beforeEach(title: string, inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares an `afterEach` hook that is executed after each test.
+ *
+ * When called in the scope of a test file, runs after each test in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * after each test in the group.
+ *
+ * You can access all the same [Fixtures](https://playwright.dev/docs/api/class-fixtures) as the test body itself, and
+ * also the [TestInfo](https://playwright.dev/docs/api/class-testinfo) object that gives a lot of useful information.
+ * For example, you can check whether the test succeeded or failed.
+ * - `test.afterEach(hookFunction)`
+ * - `test.afterEach(title, hookFunction)`
+ *
+ * **Details**
+ *
+ * When multiple `afterEach` hooks are added, they will run in the order of their registration.
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.afterEach(async ({ page }) => {
+ * console.log(`Finished ${test.info().title} with status ${test.info().status}`);
+ *
+ * if (test.info().status !== test.info().expectedStatus)
+ * console.log(`Did not run as expected, ended up at ${page.url()}`);
+ * });
+ *
+ * test('my test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * // example.spec.ts
+ * test.afterEach('Status check', async ({ page }) => {
+ * if (test.info().status !== test.info().expectedStatus)
+ * console.log(`Did not run as expected, ended up at ${page.url()}`);
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ afterEach(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares an `afterEach` hook that is executed after each test.
+ *
+ * When called in the scope of a test file, runs after each test in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * after each test in the group.
+ *
+ * You can access all the same [Fixtures](https://playwright.dev/docs/api/class-fixtures) as the test body itself, and
+ * also the [TestInfo](https://playwright.dev/docs/api/class-testinfo) object that gives a lot of useful information.
+ * For example, you can check whether the test succeeded or failed.
+ * - `test.afterEach(hookFunction)`
+ * - `test.afterEach(title, hookFunction)`
+ *
+ * **Details**
+ *
+ * When multiple `afterEach` hooks are added, they will run in the order of their registration.
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.afterEach(async ({ page }) => {
+ * console.log(`Finished ${test.info().title} with status ${test.info().status}`);
+ *
+ * if (test.info().status !== test.info().expectedStatus)
+ * console.log(`Did not run as expected, ended up at ${page.url()}`);
+ * });
+ *
+ * test('my test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * // example.spec.ts
+ * test.afterEach('Status check', async ({ page }) => {
+ * if (test.info().status !== test.info().expectedStatus)
+ * console.log(`Did not run as expected, ended up at ${page.url()}`);
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ afterEach(title: string, inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares a `beforeAll` hook that is executed once per worker process before all tests.
+ *
+ * When called in the scope of a test file, runs before all tests in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * before all tests in the group.
+ *
+ * You can use [test.afterAll([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-all) to
+ * teardown any resources set up in `beforeAll`.
+ * - `test.beforeAll(hookFunction)`
+ * - `test.beforeAll(title, hookFunction)`
+ *
+ * **Details**
+ *
+ * When multiple `beforeAll` hooks are added, they will run in the order of their registration.
+ *
+ * Note that worker process is restarted on test failures, and `beforeAll` hook runs again in the new worker. Learn
+ * more about [workers and failures](https://playwright.dev/docs/test-retries).
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeAll(async () => {
+ * console.log('Before tests');
+ * });
+ *
+ * test.afterAll(async () => {
+ * console.log('After tests');
+ * });
+ *
+ * test('my test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * // example.spec.ts
+ * test.beforeAll('Setup', async () => {
+ * console.log('Before tests');
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with worker fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ beforeAll(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares a `beforeAll` hook that is executed once per worker process before all tests.
+ *
+ * When called in the scope of a test file, runs before all tests in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * before all tests in the group.
+ *
+ * You can use [test.afterAll([title, hookFunction])](https://playwright.dev/docs/api/class-test#test-after-all) to
+ * teardown any resources set up in `beforeAll`.
+ * - `test.beforeAll(hookFunction)`
+ * - `test.beforeAll(title, hookFunction)`
+ *
+ * **Details**
+ *
+ * When multiple `beforeAll` hooks are added, they will run in the order of their registration.
+ *
+ * Note that worker process is restarted on test failures, and `beforeAll` hook runs again in the new worker. Learn
+ * more about [workers and failures](https://playwright.dev/docs/test-retries).
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.beforeAll(async () => {
+ * console.log('Before tests');
+ * });
+ *
+ * test.afterAll(async () => {
+ * console.log('After tests');
+ * });
+ *
+ * test('my test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * // example.spec.ts
+ * test.beforeAll('Setup', async () => {
+ * console.log('Before tests');
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with worker fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ beforeAll(title: string, inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares an `afterAll` hook that is executed once per worker after all tests.
+ *
+ * When called in the scope of a test file, runs after all tests in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * after all tests in the group.
+ *
+ * **Details**
+ *
+ * When multiple `afterAll` hooks are added, they will run in the order of their registration.
+ *
+ * Note that worker process is restarted on test failures, and `afterAll` hook runs again in the new worker. Learn
+ * more about [workers and failures](https://playwright.dev/docs/test-retries).
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ * - `test.afterAll(hookFunction)`
+ * - `test.afterAll(title, hookFunction)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.afterAll(async () => {
+ * console.log('Done with tests');
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * test.afterAll('Teardown', async () => {
+ * console.log('Done with tests');
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with worker fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ afterAll(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Declares an `afterAll` hook that is executed once per worker after all tests.
+ *
+ * When called in the scope of a test file, runs after all tests in the file. When called inside a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group, runs
+ * after all tests in the group.
+ *
+ * **Details**
+ *
+ * When multiple `afterAll` hooks are added, they will run in the order of their registration.
+ *
+ * Note that worker process is restarted on test failures, and `afterAll` hook runs again in the new worker. Learn
+ * more about [workers and failures](https://playwright.dev/docs/test-retries).
+ *
+ * Playwright will continue running all applicable hooks even if some of them have failed.
+ * - `test.afterAll(hookFunction)`
+ * - `test.afterAll(title, hookFunction)`
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.afterAll(async () => {
+ * console.log('Done with tests');
+ * // ...
+ * });
+ * ```
+ *
+ * Alternatively, you can declare a hook **with a title**.
+ *
+ * ```js
+ * test.afterAll('Teardown', async () => {
+ * console.log('Done with tests');
+ * // ...
+ * });
+ * ```
+ *
+ * @param title Hook title.
+ * @param hookFunction Hook function that takes one or two arguments: an object with worker fixtures and optional
+ * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
+ */
+ afterAll(title: string, inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | any): void;
+ /**
+ * Specifies options or fixtures to use in a single test file or a
+ * [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group. Most
+ * useful to set an option, for example set `locale` to configure `context` fixture.
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.use({ locale: 'en-US' });
+ *
+ * test('test with locale', async ({ page }) => {
+ * // Default context and page have locale as specified
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * `test.use` can be called either in the global scope or inside `test.describe`. It is an error to call it within
+ * `beforeEach` or `beforeAll`.
+ *
+ * It is also possible to override a fixture by providing a function.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test.use({
+ * locale: async ({}, use) => {
+ * // Read locale from some configuration file.
+ * const locale = await fs.promises.readFile('test-locale', 'utf-8');
+ * await use(locale);
+ * },
+ * });
+ *
+ * test('test with locale', async ({ page }) => {
+ * // Default context and page have locale as specified
+ * });
+ * ```
+ *
+ * @param options An object with local options.
+ */
+ use(fixtures: Fixtures<{}, {}, TestArgs, WorkerArgs>): void;
+ /**
+ * Declares a test step that is shown in the report.
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('test', async ({ page }) => {
+ * await test.step('Log in', async () => {
+ * // ...
+ * });
+ *
+ * await test.step('Outer step', async () => {
+ * // ...
+ * // You can nest steps inside each other.
+ * await test.step('Inner step', async () => {
+ * // ...
+ * });
+ * });
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * The method returns the value returned by the step callback.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('test', async ({ page }) => {
+ * const user = await test.step('Log in', async () => {
+ * // ...
+ * return 'john';
+ * });
+ * expect(user).toBe('john');
+ * });
+ * ```
+ *
+ * **Decorator**
+ *
+ * You can use TypeScript method decorators to turn a method into a step. Each call to the decorated method will show
+ * up as a step in the report.
+ *
+ * ```js
+ * function step(target: Function, context: ClassMethodDecoratorContext) {
+ * return function replacementMethod(...args: any) {
+ * const name = this.constructor.name + '.' + (context.name as string);
+ * return test.step(name, async () => {
+ * return await target.call(this, ...args);
+ * }, { box: true });
+ * };
+ * }
+ *
+ * class LoginPage {
+ * constructor(readonly page: Page) {}
+ *
+ * @step
+ * async login() {
+ * const account = { username: 'Alice', password: 's3cr3t' };
+ * await this.page.getByLabel('Username or email address').fill(account.username);
+ * await this.page.getByLabel('Password').fill(account.password);
+ * await this.page.getByRole('button', { name: 'Sign in' }).click();
+ * await expect(this.page.getByRole('button', { name: 'View profile and more' })).toBeVisible();
+ * }
+ * }
+ *
+ * test('example', async ({ page }) => {
+ * const loginPage = new LoginPage(page);
+ * await loginPage.login();
+ * });
+ * ```
+ *
+ * **Boxing**
+ *
+ * When something inside a step fails, you would usually see the error pointing to the exact action that failed. For
+ * example, consider the following login step:
+ *
+ * ```js
+ * async function login(page) {
+ * await test.step('login', async () => {
+ * const account = { username: 'Alice', password: 's3cr3t' };
+ * await page.getByLabel('Username or email address').fill(account.username);
+ * await page.getByLabel('Password').fill(account.password);
+ * await page.getByRole('button', { name: 'Sign in' }).click();
+ * await expect(page.getByRole('button', { name: 'View profile and more' })).toBeVisible();
+ * });
+ * }
+ *
+ * test('example', async ({ page }) => {
+ * await page.goto('https://github.com/login');
+ * await login(page);
+ * });
+ * ```
+ *
+ * ```txt
+ * Error: Timed out 5000ms waiting for expect(locator).toBeVisible()
+ * ... error details omitted ...
+ *
+ * 8 | await page.getByRole('button', { name: 'Sign in' }).click();
+ * > 9 | await expect(page.getByRole('button', { name: 'View profile and more' })).toBeVisible();
+ * | ^
+ * 10 | });
+ * ```
+ *
+ * As we see above, the test may fail with an error pointing inside the step. If you would like the error to highlight
+ * the "login" step instead of its internals, use the `box` option. An error inside a boxed step points to the step
+ * call site.
+ *
+ * ```js
+ * async function login(page) {
+ * await test.step('login', async () => {
+ * // ...
+ * }, { box: true }); // Note the "box" option here.
+ * }
+ * ```
+ *
+ * ```txt
+ * Error: Timed out 5000ms waiting for expect(locator).toBeVisible()
+ * ... error details omitted ...
+ *
+ * 14 | await page.goto('https://github.com/login');
+ * > 15 | await login(page);
+ * | ^
+ * 16 | });
+ * ```
+ *
+ * You can also create a TypeScript decorator for a boxed step, similar to a regular step decorator above:
+ *
+ * ```js
+ * function boxedStep(target: Function, context: ClassMethodDecoratorContext) {
+ * return function replacementMethod(...args: any) {
+ * const name = this.constructor.name + '.' + (context.name as string);
+ * return test.step(name, async () => {
+ * return await target.call(this, ...args);
+ * }, { box: true }); // Note the "box" option here.
+ * };
+ * }
+ *
+ * class LoginPage {
+ * constructor(readonly page: Page) {}
+ *
+ * @boxedStep
+ * async login() {
+ * // ....
+ * }
+ * }
+ *
+ * test('example', async ({ page }) => {
+ * const loginPage = new LoginPage(page);
+ * await loginPage.login(); // <-- Error will be reported on this line.
+ * });
+ * ```
+ *
+ * @param title Step name.
+ * @param body Step body.
+ * @param options
+ */
+ step: {
+ /**
+ * Declares a test step that is shown in the report.
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('test', async ({ page }) => {
+ * await test.step('Log in', async () => {
+ * // ...
+ * });
+ *
+ * await test.step('Outer step', async () => {
+ * // ...
+ * // You can nest steps inside each other.
+ * await test.step('Inner step', async () => {
+ * // ...
+ * });
+ * });
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * The method returns the value returned by the step callback.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('test', async ({ page }) => {
+ * const user = await test.step('Log in', async () => {
+ * // ...
+ * return 'john';
+ * });
+ * expect(user).toBe('john');
+ * });
+ * ```
+ *
+ * **Decorator**
+ *
+ * You can use TypeScript method decorators to turn a method into a step. Each call to the decorated method will show
+ * up as a step in the report.
+ *
+ * ```js
+ * function step(target: Function, context: ClassMethodDecoratorContext) {
+ * return function replacementMethod(...args: any) {
+ * const name = this.constructor.name + '.' + (context.name as string);
+ * return test.step(name, async () => {
+ * return await target.call(this, ...args);
+ * }, { box: true });
+ * };
+ * }
+ *
+ * class LoginPage {
+ * constructor(readonly page: Page) {}
+ *
+ * @step
+ * async login() {
+ * const account = { username: 'Alice', password: 's3cr3t' };
+ * await this.page.getByLabel('Username or email address').fill(account.username);
+ * await this.page.getByLabel('Password').fill(account.password);
+ * await this.page.getByRole('button', { name: 'Sign in' }).click();
+ * await expect(this.page.getByRole('button', { name: 'View profile and more' })).toBeVisible();
+ * }
+ * }
+ *
+ * test('example', async ({ page }) => {
+ * const loginPage = new LoginPage(page);
+ * await loginPage.login();
+ * });
+ * ```
+ *
+ * **Boxing**
+ *
+ * When something inside a step fails, you would usually see the error pointing to the exact action that failed. For
+ * example, consider the following login step:
+ *
+ * ```js
+ * async function login(page) {
+ * await test.step('login', async () => {
+ * const account = { username: 'Alice', password: 's3cr3t' };
+ * await page.getByLabel('Username or email address').fill(account.username);
+ * await page.getByLabel('Password').fill(account.password);
+ * await page.getByRole('button', { name: 'Sign in' }).click();
+ * await expect(page.getByRole('button', { name: 'View profile and more' })).toBeVisible();
+ * });
+ * }
+ *
+ * test('example', async ({ page }) => {
+ * await page.goto('https://github.com/login');
+ * await login(page);
+ * });
+ * ```
+ *
+ * ```txt
+ * Error: Timed out 5000ms waiting for expect(locator).toBeVisible()
+ * ... error details omitted ...
+ *
+ * 8 | await page.getByRole('button', { name: 'Sign in' }).click();
+ * > 9 | await expect(page.getByRole('button', { name: 'View profile and more' })).toBeVisible();
+ * | ^
+ * 10 | });
+ * ```
+ *
+ * As we see above, the test may fail with an error pointing inside the step. If you would like the error to highlight
+ * the "login" step instead of its internals, use the `box` option. An error inside a boxed step points to the step
+ * call site.
+ *
+ * ```js
+ * async function login(page) {
+ * await test.step('login', async () => {
+ * // ...
+ * }, { box: true }); // Note the "box" option here.
+ * }
+ * ```
+ *
+ * ```txt
+ * Error: Timed out 5000ms waiting for expect(locator).toBeVisible()
+ * ... error details omitted ...
+ *
+ * 14 | await page.goto('https://github.com/login');
+ * > 15 | await login(page);
+ * | ^
+ * 16 | });
+ * ```
+ *
+ * You can also create a TypeScript decorator for a boxed step, similar to a regular step decorator above:
+ *
+ * ```js
+ * function boxedStep(target: Function, context: ClassMethodDecoratorContext) {
+ * return function replacementMethod(...args: any) {
+ * const name = this.constructor.name + '.' + (context.name as string);
+ * return test.step(name, async () => {
+ * return await target.call(this, ...args);
+ * }, { box: true }); // Note the "box" option here.
+ * };
+ * }
+ *
+ * class LoginPage {
+ * constructor(readonly page: Page) {}
+ *
+ * @boxedStep
+ * async login() {
+ * // ....
+ * }
+ * }
+ *
+ * test('example', async ({ page }) => {
+ * const loginPage = new LoginPage(page);
+ * await loginPage.login(); // <-- Error will be reported on this line.
+ * });
+ * ```
+ *
+ * @param title Step name.
+ * @param body Step body.
+ * @param options
+ */
+ (title: string, body: (step: TestStepInfo) => T | Promise, options?: { box?: boolean, location?: Location, timeout?: number, params?: { [key: string]: any }, subtitle?: string }): Promise;
+ /**
+ * Mark a test step as "skip" to temporarily disable its execution, useful for steps that are currently failing and
+ * planned for a near-term fix. Playwright will not run the step. See also
+ * [testStepInfo.skip(condition[, description])](https://playwright.dev/docs/api/class-teststepinfo#test-step-info-skip-2).
+ *
+ * We recommend [testStepInfo.skip()](https://playwright.dev/docs/api/class-teststepinfo#test-step-info-skip-1)
+ * instead.
+ *
+ * **Usage**
+ *
+ * You can declare a skipped step, and Playwright will not run it.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('my test', async ({ page }) => {
+ * // ...
+ * await test.step.skip('not yet ready', async () => {
+ * // ...
+ * });
+ * });
+ * ```
+ *
+ * @param title Step name.
+ * @param body Step body.
+ * @param options
+ */
+ skip(title: string, body: (step: TestStepInfo) => any | Promise, options?: { box?: boolean, location?: Location, timeout?: number, params?: { [key: string]: any }, subtitle?: string }): Promise;
+ }
+ /**
+ * `expect` function can be used to create test assertions. Read more about [test assertions](https://playwright.dev/docs/test-assertions).
+ *
+ * **Usage**
+ *
+ * ```js
+ * test('example', async ({ page }) => {
+ * await test.expect(page).toHaveTitle('Title');
+ * });
+ * ```
+ *
+ */
+ expect: Expect<{}>;
+ /**
+ * Extends the `test` object by defining fixtures and/or options that can be used in the tests.
+ *
+ * **Usage**
+ *
+ * First define a fixture and/or an option.
+ *
+ * ```js
+ * import { test as base } from '@playwright/test';
+ * import { TodoPage } from './todo-page';
+ *
+ * export type Options = { defaultItem: string };
+ *
+ * // Extend basic test by providing a "defaultItem" option and a "todoPage" fixture.
+ * export const test = base.extend({
+ * // Define an option and provide a default value.
+ * // We can later override it in the config.
+ * defaultItem: ['Do stuff', { option: true }],
+ *
+ * // Define a fixture. Note that it can use built-in fixture "page"
+ * // and a new option "defaultItem".
+ * todoPage: async ({ page, defaultItem }, use) => {
+ * const todoPage = new TodoPage(page);
+ * await todoPage.goto();
+ * await todoPage.addToDo(defaultItem);
+ * await use(todoPage);
+ * await todoPage.removeAll();
+ * },
+ * });
+ * ```
+ *
+ * Then use the fixture in the test.
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test } from './my-test';
+ *
+ * test('test 1', async ({ todoPage }) => {
+ * await todoPage.addToDo('my todo');
+ * // ...
+ * });
+ * ```
+ *
+ * Configure the option in config file.
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ * import type { Options } from './my-test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'shopping',
+ * use: { defaultItem: 'Buy milk' },
+ * },
+ * {
+ * name: 'wellbeing',
+ * use: { defaultItem: 'Exercise!' },
+ * },
+ * ]
+ * });
+ * ```
+ *
+ * Learn more about [fixtures](https://playwright.dev/docs/test-fixtures) and [parametrizing tests](https://playwright.dev/docs/test-parameterize).
+ * @param fixtures An object containing fixtures and/or options. Learn more about [fixtures format](https://playwright.dev/docs/test-fixtures).
+ */
+ extend(fixtures: Fixtures): TestType;
+ /**
+ * Returns information about the currently running test. This method can only be called during the test execution,
+ * otherwise it throws.
+ *
+ * **Usage**
+ *
+ * ```js
+ * test('example test', async ({ page }) => {
+ * // ...
+ * await test.info().attach('screenshot', {
+ * body: await page.screenshot(),
+ * contentType: 'image/png',
+ * });
+ * });
+ * ```
+ *
+ */
+ info(): TestInfo;
+}
+
+export type TestFixture = (args: Args, use: (r: R) => Promise, testInfo: TestInfo) => any;
+export type WorkerFixture = (args: Args, use: (r: R) => Promise, workerInfo: WorkerInfo) => any;
+type TestFixtureValue = Exclude | TestFixture;
+type WorkerFixtureValue = Exclude | WorkerFixture;
+export type Fixtures = {
+ [K in keyof PW]?: WorkerFixtureValue | [WorkerFixtureValue, { scope: 'worker', timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
+} & {
+ [K in keyof PT]?: TestFixtureValue | [TestFixtureValue, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
+} & {
+ [K in Exclude]?: [WorkerFixtureValue, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
+} & {
+ [K in Exclude]?: TestFixtureValue | [TestFixtureValue, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
+};
+
+type BrowserName = 'chromium' | 'firefox' | 'webkit';
+type BrowserChannel = Exclude;
+type ColorScheme = Exclude;
+type Contrast = Exclude;
+type ForcedColors = Exclude;
+type ReducedMotion = Exclude;
+type ClientCertificate = Exclude[0];
+type ExtraHTTPHeaders = Exclude;
+type Proxy = Exclude;
+type StorageState = Exclude;
+type ServiceWorkerPolicy = Exclude;
+type ConnectOptions = {
+ /**
+ * A browser websocket endpoint to connect to.
+ */
+ wsEndpoint: string;
+
+ /**
+ * Additional HTTP headers to be sent with web socket connect request.
+ */
+ headers?: { [key: string]: string; };
+
+ /**
+ * This option exposes network available on the connecting client to the browser being connected to.
+ * Consists of a list of rules separated by comma.
+ *
+ * Available rules:
+ * - Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.
+ * - IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.
+ * - `` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.
+
+ * Some common examples:
+ * - `"*"` to expose all network.
+ * - `""` to expose localhost network.
+ * - `"*.test.internal-domain,*.staging.internal-domain,"` to expose test/staging deployments and localhost.
+ */
+ exposeNetwork?: string;
+
+ /**
+ * Timeout in milliseconds for the connection to be established. Optional, defaults to no timeout.
+ */
+ timeout?: number;
+};
+
+/**
+ * Playwright Test provides many options to configure test environment,
+ * [Browser](https://playwright.dev/docs/api/class-browser),
+ * [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) and more.
+ *
+ * These options are usually provided in the [configuration file](https://playwright.dev/docs/test-configuration) through
+ * [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) and
+ * [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ * export default defineConfig({
+ * use: {
+ * headless: false,
+ * viewport: { width: 1280, height: 720 },
+ * ignoreHTTPSErrors: true,
+ * video: 'on-first-retry',
+ * },
+ * });
+ * ```
+ *
+ * Alternatively, with [test.use(options)](https://playwright.dev/docs/api/class-test#test-use) you can override some
+ * options for a file.
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * // Run tests in this file with portrait-like viewport.
+ * test.use({ viewport: { width: 600, height: 900 } });
+ *
+ * test('my portrait test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ */
+export interface PlaywrightWorkerOptions {
+ /**
+ * Name of the browser that runs tests. Defaults to `'chromium'`. Most of the time you should set `browserName` in
+ * your [TestConfig](https://playwright.dev/docs/api/class-testconfig):
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig, devices } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * browserName: 'firefox',
+ * },
+ * });
+ * ```
+ *
+ */
+ browserName: BrowserName;
+ defaultBrowserType: BrowserName;
+ /**
+ * Whether to run browser in headless mode. More details for
+ * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
+ * [Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * headless: false
+ * },
+ * });
+ * ```
+ *
+ */
+ headless: boolean;
+ /**
+ * Browser distribution channel.
+ *
+ * Use "chromium" to [opt in to new headless mode](https://playwright.dev/docs/browsers#chromium-new-headless-mode).
+ *
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or
+ * "msedge-canary" to use branded [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'Microsoft Edge',
+ * use: {
+ * ...devices['Desktop Edge'],
+ * channel: 'msedge'
+ * },
+ * },
+ * ]
+ * });
+ * ```
+ *
+ */
+ channel: BrowserChannel | undefined;
+ /**
+ * Options used to launch the browser, as passed to
+ * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). Specific
+ * options [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) and
+ * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over
+ * this.
+ *
+ * **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'chromium',
+ * use: {
+ * ...devices['Desktop Chrome'],
+ * launchOptions: {
+ * args: ['--start-maximized']
+ * }
+ * }
+ * }
+ * ]
+ * });
+ * ```
+ *
+ */
+ launchOptions: Omit;
+ /**
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * connectOptions: {
+ * wsEndpoint: 'ws://localhost:5678',
+ * },
+ * },
+ * });
+ * ```
+ *
+ * When connect options are specified, default
+ * [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser),
+ * [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and
+ * [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page) use the remote browser instead of
+ * launching a browser locally, and any launch options like
+ * [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) or
+ * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) are ignored.
+ */
+ connectOptions: ConnectOptions | undefined;
+ /**
+ * **NOTE** This option trades test isolation for speed and is intended for component tests that drive a story gallery. Leave
+ * it unset for end-to-end tests - a fresh browser context per test is one of the core guarantees of Playwright Test.
+ *
+ * **Experimental.** When set to `true`, all tests in a worker process run in a single browser context that is reused
+ * between tests, instead of getting a brand new context per test. Defaults to `false`.
+ *
+ * Between tests, Playwright resets the state that component tests typically touch: it clears cookies, cache, local
+ * storage and IndexedDB of visited origins, unregisters service workers, closes extra pages, removes routes, bindings
+ * and init scripts, and re-applies the configured storage state, viewport and emulation options.
+ *
+ * This reset is best-effort, not a guarantee of isolation. State that is **not** reset includes:
+ * - Permissions granted with
+ * [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions)
+ * during a test.
+ * - Runtime changes made through
+ * [browserContext.setGeolocation(geolocation)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-geolocation),
+ * [browserContext.setOffline(offline)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-offline)
+ * and
+ * [browserContext.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-extra-http-headers).
+ * - Browsing history, `window.name` and any browser-process-wide state.
+ *
+ * Additional restrictions:
+ * - The option is ignored when
+ * [testOptions.video](https://playwright.dev/docs/api/class-testoptions#test-options-video) recording is enabled.
+ * - Only a few context options may differ between consecutive tests: `colorScheme`, `forcedColors`,
+ * `reducedMotion`, `contrast`, `screen`, `userAgent`, `viewport` and `testIdAttribute`. Changing any other option
+ * in [test.use(options)](https://playwright.dev/docs/api/class-test#test-use), for example `locale` or
+ * `storageState`, silently forces a fresh context and negates the speedup.
+ * - Do not combine with
+ * [testOptions.connectOptions](https://playwright.dev/docs/api/class-testoptions#test-options-connect-options)
+ * pointing multiple workers at a shared browser - workers would compete for the single reusable context.
+ * - `recordHar` in
+ * [testOptions.contextOptions](https://playwright.dev/docs/api/class-testoptions#test-options-context-options) is
+ * not supported and produces no HAR file.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * projects: [
+ * {
+ * name: 'components',
+ * testDir: './tests/components',
+ * use: { reuseContext: true },
+ * },
+ * ],
+ * });
+ * ```
+ *
+ */
+ reuseContext: boolean;
+ /**
+ * Whether to automatically capture a screenshot after each test. Defaults to `'off'`.
+ * - `'off'`: Do not capture screenshots.
+ * - `'on'`: Capture screenshot after each test.
+ * - `'only-on-failure'`: Capture screenshot after each test failure.
+ * - `'on-first-failure'`: Capture screenshot after each test's first failure.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * screenshot: 'only-on-failure',
+ * },
+ * });
+ * ```
+ *
+ * Learn more about [automatic screenshots](https://playwright.dev/docs/test-use-options#recording-options).
+ */
+ screenshot: ScreenshotMode | { mode: ScreenshotMode } & Pick;
+ /**
+ * Whether to record trace for each test. Defaults to `'off'`. The initial run of a test is the "first run";
+ * subsequent runs caused by [retries](https://playwright.dev/docs/test-retries) are "retries".
+ * - `'off'`: Do not record trace.
+ * - `'on'`: Record and keep a trace for every run.
+ * - `'on-first-retry'`: Record and keep a trace only for the first retry of a test.
+ * - `'on-all-retries'`: Record and keep a trace for every retry.
+ * - `'retain-on-failure'`: Record a trace for every run, but keep it only for runs that failed. A failed run's
+ * trace is kept even when a later retry passes.
+ * - `'retain-on-first-failure'`: Record a trace only for the first run of a test (not for retries), and keep it
+ * only if that run failed.
+ * - `'retain-on-failure-and-retries'`: Record a trace for every run, and keep it for any run that failed or that is
+ * a retry.
+ *
+ * See [trace modes](https://playwright.dev/docs/test-use-options#trace-modes) for a side-by-side comparison of what each mode records and
+ * keeps.
+ *
+ * For more control, pass an object that specifies `mode` and trace features to enable.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * trace: 'on-first-retry'
+ * },
+ * });
+ * ```
+ *
+ * Learn more about [recording trace](https://playwright.dev/docs/test-use-options#recording-options).
+ */
+ trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, screenshots?: boolean, sources?: boolean, attachments?: boolean };
+ /**
+ * Whether to record video for each test. Defaults to `'off'`. The initial run of a test is the "first run";
+ * subsequent runs caused by [retries](https://playwright.dev/docs/test-retries) are "retries".
+ * - `'off'`: Do not record video.
+ * - `'on'`: Record and keep a video for every run.
+ * - `'on-first-retry'`: Record and keep a video only for the first retry of a test.
+ * - `'on-all-retries'`: Record and keep a video for every retry.
+ * - `'retain-on-failure'`: Record a video for every run, but keep it only for runs that failed. A failed run's
+ * video is kept even when a later retry passes.
+ * - `'retain-on-first-failure'`: Record a video only for the first run of a test (not for retries), and keep it
+ * only if that run failed.
+ * - `'retain-on-failure-and-retries'`: Record a video for every run, and keep it for any run that failed or that is
+ * a retry.
+ *
+ * See [video modes](https://playwright.dev/docs/test-use-options#video-modes) for a side-by-side comparison of what each mode records and
+ * keeps.
+ *
+ * To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be
+ * equal to [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) scaled
+ * down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual
+ * picture of each page will be scaled down if necessary to fit the specified size.
+ *
+ * To annotate actions in the video, pass `show` with `action` and/or `test` sub-options. The `action` option controls
+ * visual highlights on interacted elements with an optional `delay` in milliseconds (defaults to `500`). The `test`
+ * option controls which test information is displayed as a status overlay.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * video: 'on-first-retry',
+ * },
+ * });
+ * ```
+ *
+ * Learn more about [recording video](https://playwright.dev/docs/test-use-options#recording-options).
+ */
+ video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize, show?: { actions?: { duration?: number, position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number, cursor?: 'none' | 'pointer' }, test?: { level?: 'file' | 'title' | 'step', position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number } } };
+}
+
+export type ScreenshotMode = 'off' | 'on' | 'only-on-failure' | 'on-first-failure';
+export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure' | 'retain-on-failure-and-retries';
+export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure' | 'retain-on-failure-and-retries';
+/**
+ * Playwright Test provides many options to configure test environment,
+ * [Browser](https://playwright.dev/docs/api/class-browser),
+ * [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) and more.
+ *
+ * These options are usually provided in the [configuration file](https://playwright.dev/docs/test-configuration) through
+ * [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) and
+ * [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ * export default defineConfig({
+ * use: {
+ * headless: false,
+ * viewport: { width: 1280, height: 720 },
+ * ignoreHTTPSErrors: true,
+ * video: 'on-first-retry',
+ * },
+ * });
+ * ```
+ *
+ * Alternatively, with [test.use(options)](https://playwright.dev/docs/api/class-test#test-use) you can override some
+ * options for a file.
+ *
+ * ```js
+ * // example.spec.ts
+ * import { test, expect } from '@playwright/test';
+ *
+ * // Run tests in this file with portrait-like viewport.
+ * test.use({ viewport: { width: 600, height: 900 } });
+ *
+ * test('my portrait test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ */
+export interface PlaywrightTestOptions {
+ /**
+ * Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * acceptDownloads: false,
+ * },
+ * });
+ * ```
+ *
+ */
+ acceptDownloads: boolean;
+ /**
+ * Toggles bypassing page's Content-Security-Policy. Defaults to `false`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * bypassCSP: true,
+ * }
+ * });
+ * ```
+ *
+ */
+ bypassCSP: boolean;
+ /**
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
+ * media feature, supported values are `'light'` and `'dark'`. See
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * colorScheme: 'dark',
+ * },
+ * });
+ * ```
+ *
+ */
+ colorScheme: ColorScheme;
+ /**
+ * Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * contrast: 'more',
+ * },
+ * });
+ * ```
+ *
+ */
+ contrast: Contrast;
+ /**
+ * TLS Client Authentication allows the server to request a client certificate and verify it.
+ *
+ * **Details**
+ *
+ * An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,
+ * a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,
+ * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
+ * with an exact match to the request origin that the certificate is valid for.
+ *
+ * Client certificate authentication is only active when at least one client certificate is provided. If you want to
+ * reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
+ * does not match any of the domains you plan to visit.
+ *
+ * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
+ * work by replacing `localhost` with `local.playwright`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * clientCertificates: [{
+ * origin: 'https://example.com',
+ * certPath: './cert.pem',
+ * keyPath: './key.pem',
+ * passphrase: 'mysecretpassword',
+ * }],
+ * },
+ * });
+ * ```
+ *
+ */
+ clientCertificates: ClientCertificate[] | undefined;
+ /**
+ * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
+ * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * viewport: { width: 2560, height: 1440 },
+ * deviceScaleFactor: 2,
+ * },
+ * });
+ * ```
+ *
+ */
+ deviceScaleFactor: number | undefined;
+ /**
+ * An object containing additional HTTP headers to be sent with every request. Defaults to none.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * extraHTTPHeaders: {
+ * 'X-My-Header': 'value',
+ * },
+ * },
+ * });
+ * ```
+ *
+ */
+ extraHTTPHeaders: ExtraHTTPHeaders | undefined;
+ /**
+ * Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'none'`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * forcedColors: 'active',
+ * },
+ * });
+ * ```
+ *
+ */
+ forcedColors: ForcedColors;
+ /**
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * geolocation: { longitude: 12.492507, latitude: 41.889938 },
+ * },
+ * });
+ * ```
+ *
+ * Learn more about [geolocation](https://playwright.dev/docs/emulation#color-scheme-and-media).
+ */
+ geolocation: Geolocation | undefined;
+ /**
+ * Specifies if viewport supports touch events. Defaults to false. Learn more about
+ * [mobile emulation](https://playwright.dev/docs/emulation#devices).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * hasTouch: true
+ * },
+ * });
+ * ```
+ *
+ */
+ hasTouch: boolean;
+ /**
+ * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
+ * origin is specified, the username and password are sent to any servers upon unauthorized responses.
+ *
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
+ * is used, and entries with no origin match any request.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * httpCredentials: {
+ * username: 'user',
+ * password: 'pass',
+ * },
+ * },
+ * });
+ * ```
+ *
+ */
+ httpCredentials: HTTPCredentials | HTTPCredentials[] | undefined;
+ /**
+ * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * ignoreHTTPSErrors: true,
+ * },
+ * });
+ * ```
+ *
+ */
+ ignoreHTTPSErrors: boolean;
+ /**
+ * Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
+ * so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
+ * about [mobile emulation](https://playwright.dev/docs/emulation#ismobile).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * isMobile: false,
+ * },
+ * });
+ * ```
+ *
+ */
+ isMobile: boolean;
+ /**
+ * Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about
+ * [disabling JavaScript](https://playwright.dev/docs/emulation#javascript-enabled).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * javaScriptEnabled: false,
+ * },
+ * });
+ * ```
+ *
+ */
+ javaScriptEnabled: boolean;
+ /**
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules. Defaults to `en-US`. Learn more
+ * about emulation in our [emulation guide](https://playwright.dev/docs/emulation#locale--timezone).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * locale: 'it-IT',
+ * },
+ * });
+ * ```
+ *
+ */
+ locale: string | undefined;
+ /**
+ * Whether to emulate network being offline. Defaults to `false`. Learn more about
+ * [network emulation](https://playwright.dev/docs/emulation#offline).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * offline: true
+ * },
+ * });
+ * ```
+ *
+ */
+ offline: boolean;
+ /**
+ * A list of permissions to grant to all pages in this context. See
+ * [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions)
+ * for more details. Defaults to none.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * permissions: ['notifications'],
+ * },
+ * });
+ * ```
+ *
+ */
+ permissions: string[] | undefined;
+ /**
+ * Network proxy settings.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * proxy: {
+ * server: 'http://myproxy.com:3128',
+ * bypass: 'localhost',
+ * },
+ * },
+ * });
+ * ```
+ *
+ */
+ proxy: Proxy | undefined;
+ /**
+ * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * reducedMotion: 'reduce',
+ * },
+ * });
+ * ```
+ *
+ */
+ reducedMotion: ReducedMotion;
+ /**
+ * Learn more about [storage state and auth](https://playwright.dev/docs/auth).
+ *
+ * Populates context with given storage state. This option can be used to initialize context with logged-in
+ * information obtained via
+ * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * storageState: 'storage-state.json',
+ * },
+ * });
+ * ```
+ *
+ * **Details**
+ *
+ * When storage state is set up in the config, it is possible to reset storage state for a file:
+ *
+ * ```js
+ * // not-signed-in.spec.ts
+ * import { test } from '@playwright/test';
+ *
+ * // Reset storage state for this file to avoid being authenticated
+ * test.use({ storageState: { cookies: [], origins: [] } });
+ *
+ * test('not signed in test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ */
+ storageState: StorageState | undefined;
+ /**
+ * Changes the timezone of the context. See
+ * [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)
+ * for a list of supported timezone IDs. Defaults to the system timezone.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * timezoneId: 'Europe/Rome',
+ * },
+ * });
+ * ```
+ *
+ */
+ timezoneId: string | undefined;
+ /**
+ * Specific user agent to use in this context.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * userAgent: 'some custom ua',
+ * },
+ * });
+ * ```
+ *
+ */
+ userAgent: string | undefined;
+ /**
+ * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent
+ * viewport emulation. Learn more about [viewport emulation](https://playwright.dev/docs/emulation#viewport).
+ *
+ * **NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined
+ * by the operating system. It makes the execution of the tests non-deterministic.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * viewport: { width: 100, height: 100 },
+ * },
+ * });
+ * ```
+ *
+ */
+ viewport: ViewportSize | null;
+ /**
+ * When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto),
+ * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route),
+ * [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url),
+ * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request),
+ * or
+ * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-response)
+ * it takes the base URL in consideration by using the
+ * [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL.
+ * Unset by default. Examples:
+ * - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
+ * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
+ * `http://localhost:3000/foo/bar.html`
+ * - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
+ * `http://localhost:3000/bar.html`
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { defineConfig, devices } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * /* Base URL to use in actions like `await page.goto('/')`. *\/
+ * baseURL: 'http://localhost:3000',
+ * },
+ * });
+ * ```
+ *
+ */
+ baseURL: string | undefined;
+ /**
+ * Options used to create the context, as passed to
+ * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context). Specific
+ * options like [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) take
+ * priority over this.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * contextOptions: {
+ * reducedMotion: 'reduce',
+ * },
+ * },
+ * });
+ * ```
+ *
+ */
+ contextOptions: BrowserContextOptions;
+ /**
+ * Default timeout for each Playwright action in milliseconds, defaults to 0 (no timeout).
+ *
+ * This is a default timeout for all Playwright actions, same as configured via
+ * [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout).
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { defineConfig, devices } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). *\/
+ * actionTimeout: 0,
+ * },
+ * });
+ * ```
+ *
+ * Learn more about [various timeouts](https://playwright.dev/docs/test-timeouts).
+ */
+ actionTimeout: number;
+ /**
+ * Timeout for each navigation action in milliseconds. Defaults to 0 (no timeout).
+ *
+ * This is a default navigation timeout, same as configured via
+ * [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout).
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * navigationTimeout: 3000,
+ * },
+ * });
+ * ```
+ *
+ * Learn more about [various timeouts](https://playwright.dev/docs/test-timeouts).
+ */
+ navigationTimeout: number;
+ /**
+ * Whether to allow sites to register Service workers. Defaults to `'allow'`.
+ * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be
+ * registered.
+ * - `'block'`: Playwright will block all registration of Service Workers.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * serviceWorkers: 'allow'
+ * },
+ * });
+ * ```
+ *
+ */
+ serviceWorkers: ServiceWorkerPolicy;
+ /**
+ * Custom attribute to be used in
+ * [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used
+ * by default. To match elements with any of several attributes, pass them as a comma-separated list.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * testIdAttribute: 'pw-test-id',
+ * },
+ * });
+ * ```
+ *
+ * Multiple attributes:
+ *
+ * ```js
+ * // playwright.config.ts
+ * import { defineConfig } from '@playwright/test';
+ *
+ * export default defineConfig({
+ * use: {
+ * testIdAttribute: 'data-pw,data-ti',
+ * },
+ * });
+ * ```
+ *
+ */
+ testIdAttribute: string;
+}
+
+
+/**
+ * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to
+ * establish environment for each test, giving the test everything it needs and nothing else.
+ *
+ * Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those
+ * fixtures specifically for the test. Values prepared by the fixtures are merged into a single object that is
+ * available to the `test`, hooks, annotations and other fixtures as a first parameter.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Given the test above, Playwright Test will set up the `page` fixture before running the test, and tear it down
+ * after the test has finished. `page` fixture provides a [Page](https://playwright.dev/docs/api/class-page) object
+ * that is available to the test.
+ *
+ * Playwright Test comes with builtin fixtures listed below, and you can add your own fixtures as well. Playwright
+ * Test also [provides options][TestOptions](https://playwright.dev/docs/api/class-testoptions) to configure
+ * [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser),
+ * [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and
+ * [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page).
+ */
+export interface PlaywrightWorkerArgs {
+ playwright: typeof import('playwright-core');
+ /**
+ * [Browser](https://playwright.dev/docs/api/class-browser) instance is shared between all tests in the
+ * [same worker](https://playwright.dev/docs/test-parallel) - this makes testing efficient. However, each test runs in an isolated
+ * [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) and gets a fresh environment.
+ *
+ * Learn how to [configure browser](https://playwright.dev/docs/test-configuration) and see
+ * [available options][TestOptions](https://playwright.dev/docs/api/class-testoptions).
+ *
+ * **Usage**
+ *
+ * ```js
+ * test.beforeAll(async ({ browser }) => {
+ * const page = await browser.newPage();
+ * // ...
+ * });
+ * ```
+ *
+ */
+ browser: Browser;
+}
+
+export interface Stories {}
+
+type StoryProps =
+ Story extends (props: infer Props) => any ? Props :
+ Story extends new (...args: any[]) => { $props: infer Props } ? Props :
+ Story extends new (props: infer Props, ...args: any[]) => any ? Props :
+ Story;
+type StoryId = keyof Stories | (string & {});
+type StoryPropsFor = Id extends keyof Stories ? StoryProps : Record;
+// Explicit mount() wins over the id lookup; the indexed access keeps Story from being inferred from props.
+type MountProps = [Story] extends [never] ? StoryPropsFor : StoryProps<[Story][Story extends any ? 0 : never]>;
+
+/**
+ * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to
+ * establish environment for each test, giving the test everything it needs and nothing else.
+ *
+ * Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those
+ * fixtures specifically for the test. Values prepared by the fixtures are merged into a single object that is
+ * available to the `test`, hooks, annotations and other fixtures as a first parameter.
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }) => {
+ * // ...
+ * });
+ * ```
+ *
+ * Given the test above, Playwright Test will set up the `page` fixture before running the test, and tear it down
+ * after the test has finished. `page` fixture provides a [Page](https://playwright.dev/docs/api/class-page) object
+ * that is available to the test.
+ *
+ * Playwright Test comes with builtin fixtures listed below, and you can add your own fixtures as well. Playwright
+ * Test also [provides options][TestOptions](https://playwright.dev/docs/api/class-testoptions) to configure
+ * [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser),
+ * [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and
+ * [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page).
+ */
+export interface PlaywrightTestArgs {
+ /**
+ * Isolated [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) instance, created for each test.
+ * Since contexts are isolated between each other, every test gets a fresh environment, even when multiple tests run
+ * in a single [Browser](https://playwright.dev/docs/api/class-browser) for maximum efficiency.
+ *
+ * Learn how to [configure context](https://playwright.dev/docs/test-configuration) and see
+ * [available options][TestOptions](https://playwright.dev/docs/api/class-testoptions).
+ *
+ * Default [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page) belongs to this context.
+ *
+ * **Usage**
+ *
+ * ```js
+ * test('example test', async ({ page, context }) => {
+ * await context.route('*external.com/*', route => route.abort());
+ * // ...
+ * });
+ * ```
+ *
+ */
+ context: BrowserContext;
+ /**
+ * Isolated [Page](https://playwright.dev/docs/api/class-page) instance, created for each test. Pages are isolated
+ * between tests due to [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) isolation.
+ *
+ * This is the most common fixture used in a test.
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ page }) => {
+ * await page.goto('/signin');
+ * await page.getByLabel('User Name').fill('user');
+ * await page.getByLabel('Password').fill('password');
+ * await page.getByText('Sign in').click();
+ * // ...
+ * });
+ * ```
+ *
+ */
+ page: Page;
+ /**
+ * Isolated [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) instance for each test.
+ *
+ * **Usage**
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('basic test', async ({ request }) => {
+ * await request.post('/signin', {
+ * data: {
+ * username: 'user',
+ * password: 'password'
+ * }
+ * });
+ * // ...
+ * });
+ * ```
+ *
+ */
+ request: APIRequestContext;
+ /**
+ * Mounts a component story and returns a [Locator](https://playwright.dev/docs/api/class-locator) pointing to the
+ * root element the story was rendered into. Scope your queries from the returned locator:
+ * `component.getByRole('button')`, not `page.getByRole('button')`.
+ *
+ * A **story** is a small wrapper component that embeds the component under test in one specific scenario: hard-coded
+ * props, mock data, providers, recorded callbacks. Stories are rendered by a **gallery** page that you implement and
+ * serve at [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). The
+ * gallery exposes `window.mount(params)` and `window.unmount()` functions that render a story into its root element.
+ * Each call to [fixtures.mount(storyId[, props])](https://playwright.dev/docs/api/class-fixtures#fixtures-mount)
+ * navigates to [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) and
+ * calls `window.mount()` with the story id and props, so tests are fully isolated from each other.
+ *
+ * **Usage**
+ *
+ * ```js
+ * test('click should expand', async ({ mount }) => {
+ * const component = await mount('components/Expandable/Stateful');
+ * await component.getByRole('button').click();
+ * await expect(component.getByTestId('expanded')).toHaveValue('true');
+ * });
+ * ```
+ *
+ * Pass the story type as a template argument to type-check the props:
+ *
+ * ```js
+ * import type { WithTitle } from './Button.story';
+ *
+ * test('renders the title', async ({ mount }) => {
+ * const component = await mount('Button/WithTitle', { title: 'Hello' });
+ * await expect(component).toContainText('Hello');
+ * });
+ * ```
+ *
+ * The returned locator is augmented with two methods:
+ * - `update(props)` - re-renders the same story with new props without remounting, preserving component state;
+ * - `unmount()` - unmounts the story.
+ * @param storyId Identifier of the story to mount, as resolved by the gallery page. Conventionally, the story file path plus the
+ * exported story name, for example `'components/Button/Primary'`.
+ * @param props Optional plain, serializable props passed to the story.
+ */
+ mount: (storyId: Id, props?: MountProps) => Promise): Promise, unmount(): Promise }>;
+}
+
+type ExcludeProps = {
+ [K in Exclude]: A[K];
+};
+type CustomProperties = ExcludeProps;
+
+export type PlaywrightTestProject = Project, PlaywrightWorkerOptions & CustomProperties>;
+export type PlaywrightTestConfig = Config, PlaywrightWorkerOptions & CustomProperties>;
+
+// Use the global URLPattern type if available (Node.js 22+, modern browsers),
+// otherwise fall back to `never` so it disappears from union types.
+type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;
+type AsymmetricMatcher = Record;
+
+interface AsymmetricMatchers {
+ /**
+ * `expect.any()` matches any object instance created from the
+ * [`constructor`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-any-option-constructor)
+ * or a corresponding primitive type. Use it inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // Match instance of a class.
+ * class Example {}
+ * expect(new Example()).toEqual(expect.any(Example));
+ *
+ * // Match any number.
+ * expect({ prop: 1 }).toEqual({ prop: expect.any(Number) });
+ *
+ * // Match any string.
+ * expect('abc').toEqual(expect.any(String));
+ * ```
+ *
+ * @param constructor Constructor of the expected object like `ExampleClass`, or a primitive boxed type like `Number`.
+ */
+ any(sample: unknown): AsymmetricMatcher;
+ /**
+ * `expect.anything()` matches everything except `null` and `undefined`. Use it inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = { prop: 1 };
+ * expect(value).toEqual({ prop: expect.anything() });
+ * expect(value).not.toEqual({ otherProp: expect.anything() });
+ * ```
+ *
+ */
+ anything(): AsymmetricMatcher;
+ /**
+ * `expect.arrayContaining()` matches an array that contains all of the elements in the expected array, in any order.
+ * Note that received array may be a superset of the expected array and contain some extra elements.
+ *
+ * Use this method inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect([1, 2, 3]).toEqual(expect.arrayContaining([3, 1]));
+ * expect([1, 2, 3]).not.toEqual(expect.arrayContaining([1, 4]));
+ * ```
+ *
+ * @param expected Expected array that is a subset of the received value.
+ */
+ arrayContaining(sample: Array): AsymmetricMatcher;
+ /**
+ * `expect.arrayOf()` matches array of objects created from the
+ * [`constructor`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-array-of-option-constructor)
+ * or a corresponding primitive type. Use it inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // Match instance of a class.
+ * class Example {}
+ * expect([new Example(), new Example()]).toEqual(expect.arrayOf(Example));
+ *
+ * // Match any string.
+ * expect(['a', 'b', 'c']).toEqual(expect.arrayOf(String));
+ * ```
+ *
+ * @param constructor Constructor of the expected object like `ExampleClass`, or a primitive boxed type like `Number`.
+ */
+ arrayOf(sample: unknown): AsymmetricMatcher;
+ /**
+ * Compares floating point numbers for approximate equality. Use this method inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching. When just comparing two numbers, prefer
+ * [expect(value).toBeCloseTo(expected[, numDigits])](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be-close-to).
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect({ prop: 0.1 + 0.2 }).not.toEqual({ prop: 0.3 });
+ * expect({ prop: 0.1 + 0.2 }).toEqual({ prop: expect.closeTo(0.3, 5) });
+ * ```
+ *
+ * @param expected Expected value.
+ * @param numDigits The number of decimal digits after the decimal point that must be equal.
+ */
+ closeTo(sample: number, precision?: number): AsymmetricMatcher;
+ /**
+ * `expect.objectContaining()` matches an object that contains and matches all of the properties in the expected
+ * object. Note that received object may be a superset of the expected object and contain some extra properties.
+ *
+ * Use this method inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching. Object properties can be matchers to further relax the expectation. See examples.
+ *
+ * **Usage**
+ *
+ * ```js
+ * // Assert some of the properties.
+ * expect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ foo: 1 }));
+ *
+ * // Matchers can be used on the properties as well.
+ * expect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ bar: expect.any(Number) }));
+ *
+ * // Complex matching of sub-properties.
+ * expect({
+ * list: [1, 2, 3],
+ * obj: { prop: 'Hello world!', another: 'some other value' },
+ * extra: 'extra',
+ * }).toEqual(expect.objectContaining({
+ * list: expect.arrayContaining([2, 3]),
+ * obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),
+ * }));
+ * ```
+ *
+ * @param expected Expected object pattern that contains a subset of the properties.
+ */
+ objectContaining(sample: Record): AsymmetricMatcher;
+ /**
+ * `expect.stringContaining()` matches a string that contains the expected substring. Use this method inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect('Hello world!').toEqual(expect.stringContaining('Hello'));
+ * ```
+ *
+ * @param expected Expected substring.
+ */
+ stringContaining(sample: string): AsymmetricMatcher;
+ /**
+ * `expect.stringMatching()` matches a received string that in turn matches the expected pattern. Use this method
+ * inside
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * to perform pattern matching.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect('123ms').toEqual(expect.stringMatching(/\d+m?s/));
+ *
+ * // Inside another matcher.
+ * expect({
+ * status: 'passed',
+ * time: '123ms',
+ * }).toEqual({
+ * status: expect.stringMatching(/passed|failed/),
+ * time: expect.stringMatching(/\d+m?s/),
+ * });
+ * ```
+ *
+ * @param expected Pattern that expected string should match.
+ */
+ stringMatching(sample: string | RegExp): AsymmetricMatcher;
+}
+
+/**
+ * The [GenericAssertions](https://playwright.dev/docs/api/class-genericassertions) class provides assertion methods
+ * that can be used to make assertions about any values in the tests. A new instance of
+ * [GenericAssertions](https://playwright.dev/docs/api/class-genericassertions) is created by calling
+ * [expect(value)](https://playwright.dev/docs/api/class-playwrightassertions#playwright-assertions-expect-generic):
+ *
+ * ```js
+ * import { test, expect } from '@playwright/test';
+ *
+ * test('assert a value', async ({ page }) => {
+ * const value = 1;
+ * expect(value).toBe(2);
+ * });
+ * ```
+ *
+ */
+interface GenericAssertions {
+ /**
+ * Makes the assertion check for the opposite condition.
+ *
+ * **Usage**
+ *
+ * For example, the following code passes:
+ *
+ * ```js
+ * const value = 1;
+ * expect(value).not.toBe(2);
+ * ```
+ *
+ */
+ not: GenericAssertions;
+ /**
+ * Use `resolves` to unwrap the value of a fulfilled promise so any other matcher can be chained. If the promise is
+ * rejected the assertion fails.
+ *
+ * For example, this code tests that the promise resolves and that the resulting value is `'lemon'`:
+ *
+ * ```js
+ * test('resolves to lemon', async () => {
+ * await expect(Promise.resolve('lemon')).resolves.toBe('lemon');
+ * });
+ * ```
+ *
+ */
+ resolves: GenericAssertions;
+ /**
+ * Use `.rejects` to unwrap the reason of a rejected promise so any other matcher can be chained. If the promise is
+ * fulfilled the assertion fails.
+ *
+ * For example, this code tests that the promise rejects with reason `'octopus'`:
+ *
+ * ```js
+ * test('rejects to octopus', async () => {
+ * await expect(Promise.reject(new Error('octopus'))).rejects.toThrow('octopus');
+ * });
+ * ```
+ *
+ */
+ rejects: GenericAssertions;
+ /**
+ * Compares value with
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be-option-expected) by
+ * calling `Object.is`. This method compares objects by reference instead of their contents, similarly to the strict
+ * equality operator `===`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = { prop: 1 };
+ * expect(value).toBe(value);
+ * expect(value).not.toBe({});
+ * expect(value.prop).toBe(1);
+ * ```
+ *
+ * @param expected Expected value.
+ */
+ toBe(expected: unknown): R;
+ /**
+ * Compares floating point numbers for approximate equality. Use this method instead of
+ * [expect(value).toBe(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be)
+ * when comparing floating point numbers.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect(0.1 + 0.2).not.toBe(0.3);
+ * expect(0.1 + 0.2).toBeCloseTo(0.3, 5);
+ * ```
+ *
+ * @param expected Expected value.
+ * @param numDigits The number of decimal digits after the decimal point that must be equal.
+ */
+ toBeCloseTo(expected: number, numDigits?: number): R;
+ /**
+ * Ensures that value is not `undefined`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = null;
+ * expect(value).toBeDefined();
+ * ```
+ *
+ */
+ toBeDefined(): R;
+ /**
+ * Ensures that value is false in a boolean context, one of `false`, `0`, `''`, `null`, `undefined` or `NaN`. Use this
+ * method when you don't care about the specific value.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = null;
+ * expect(value).toBeFalsy();
+ * ```
+ *
+ */
+ toBeFalsy(): R;
+ /**
+ * Ensures that `value > expected` for number or big integer values.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = 42;
+ * expect(value).toBeGreaterThan(1);
+ * ```
+ *
+ * @param expected The value to compare to.
+ */
+ toBeGreaterThan(expected: number | bigint): R;
+ /**
+ * Ensures that `value >= expected` for number or big integer values.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = 42;
+ * expect(value).toBeGreaterThanOrEqual(42);
+ * ```
+ *
+ * @param expected The value to compare to.
+ */
+ toBeGreaterThanOrEqual(expected: number | bigint): R;
+ /**
+ * Ensures that value is an instance of a class. Uses `instanceof` operator.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect(page).toBeInstanceOf(Page);
+ *
+ * class Example {}
+ * expect(new Example()).toBeInstanceOf(Example);
+ * ```
+ *
+ * @param expected The class or constructor function.
+ */
+ toBeInstanceOf(expected: Function): R;
+ /**
+ * Ensures that `value < expected` for number or big integer values.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = 42;
+ * expect(value).toBeLessThan(100);
+ * ```
+ *
+ * @param expected The value to compare to.
+ */
+ toBeLessThan(expected: number | bigint): R;
+ /**
+ * Ensures that `value <= expected` for number or big integer values.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = 42;
+ * expect(value).toBeLessThanOrEqual(42);
+ * ```
+ *
+ * @param expected The value to compare to.
+ */
+ toBeLessThanOrEqual(expected: number | bigint): R;
+ /**
+ * Ensures that value is `NaN`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = NaN;
+ * expect(value).toBeNaN();
+ * ```
+ *
+ */
+ toBeNaN(): R;
+ /**
+ * Ensures that value is `null`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = null;
+ * expect(value).toBeNull();
+ * ```
+ *
+ */
+ toBeNull(): R;
+ /**
+ * Ensures that value is true in a boolean context, **anything but** `false`, `0`, `''`, `null`, `undefined` or `NaN`.
+ * Use this method when you don't care about the specific value.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = { example: 'value' };
+ * expect(value).toBeTruthy();
+ * ```
+ *
+ */
+ toBeTruthy(): R;
+ /**
+ * Ensures that value is `undefined`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = undefined;
+ * expect(value).toBeUndefined();
+ * ```
+ *
+ */
+ toBeUndefined(): R;
+ /**
+ * Ensures that string value contains an expected substring. Comparison is case-sensitive.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = 'Hello, World';
+ * expect(value).toContain('World');
+ * expect(value).toContain(',');
+ * ```
+ *
+ * @param expected Expected substring.
+ */
+ toContain(expected: string): R;
+ /**
+ * Ensures that value is an `Array` or `Set` and contains an expected item.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = [1, 2, 3];
+ * expect(value).toContain(2);
+ * expect(new Set(value)).toContain(2);
+ * ```
+ *
+ * @param expected Expected value in the collection.
+ */
+ toContain(expected: unknown): R;
+ /**
+ * Ensures that value is an `Array` or `Set` and contains an item equal to the expected.
+ *
+ * For objects, this method recursively checks equality of all fields, rather than comparing objects by reference as
+ * performed by
+ * [expect(value).toContain(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-contain-2).
+ *
+ * For primitive values, this method is equivalent to
+ * [expect(value).toContain(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-contain-2).
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = [
+ * { example: 1 },
+ * { another: 2 },
+ * { more: 3 },
+ * ];
+ * expect(value).toContainEqual({ another: 2 });
+ * expect(new Set(value)).toContainEqual({ another: 2 });
+ * ```
+ *
+ * @param expected Expected value in the collection.
+ */
+ toContainEqual(expected: unknown): R;
+ /**
+ * Compares contents of the value with contents of
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal-option-expected),
+ * performing "deep equality" check.
+ *
+ * For objects, this method recursively checks equality of all fields, rather than comparing objects by reference as
+ * performed by
+ * [expect(value).toBe(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be).
+ *
+ * For primitive values, this method is equivalent to
+ * [expect(value).toBe(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be).
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = { prop: 1 };
+ * expect(value).toEqual({ prop: 1 });
+ * ```
+ *
+ * **Non-strict equality**
+ *
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * performs deep equality check that compares contents of the received and expected values. To ensure two objects
+ * reference the same instance, use
+ * [expect(value).toBe(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be)
+ * instead.
+ *
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * ignores `undefined` properties and array items, and does not insist on object types being equal. For stricter
+ * matching, use
+ * [expect(value).toStrictEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-strict-equal).
+ *
+ * **Pattern matching**
+ *
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal)
+ * can be also used to perform pattern matching on objects, arrays and primitive types, with the help of the following
+ * matchers:
+ * - [expect(value).any(constructor)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-any)
+ * - [expect(value).anything()](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-anything)
+ * - [expect(value).arrayContaining(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-array-containing)
+ * - [expect(value).arrayOf(constructor)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-array-of)
+ * - [expect(value).closeTo(expected[, numDigits])](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-close-to)
+ * - [expect(value).objectContaining(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-object-containing)
+ * - [expect(value).stringContaining(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-string-containing)
+ * - [expect(value).stringMatching(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-string-matching)
+ *
+ * Here is an example that asserts some of the values inside a complex object:
+ *
+ * ```js
+ * expect({
+ * list: [1, 2, 3],
+ * obj: { prop: 'Hello world!', another: 'some other value' },
+ * extra: 'extra',
+ * }).toEqual(expect.objectContaining({
+ * list: expect.arrayContaining([2, 3]),
+ * obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),
+ * }));
+ * ```
+ *
+ * @param expected Expected value.
+ */
+ toEqual(expected: unknown): R;
+ /**
+ * Ensures that value has a `.length` property equal to
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-have-length-option-expected).
+ * Useful for arrays and strings.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect('Hello, World').toHaveLength(12);
+ * expect([1, 2, 3]).toHaveLength(3);
+ * ```
+ *
+ * @param expected Expected length.
+ */
+ toHaveLength(expected: number): R;
+ /**
+ * Ensures that property at provided `keyPath` exists on the object and optionally checks that property is equal to
+ * the
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-have-property-option-expected).
+ * Equality is checked recursively, similarly to
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal).
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = {
+ * a: {
+ * b: [42],
+ * },
+ * c: true,
+ * };
+ * expect(value).toHaveProperty('a.b');
+ * expect(value).toHaveProperty('a.b', [42]);
+ * expect(value).toHaveProperty('a.b[0]', 42);
+ * expect(value).toHaveProperty('c');
+ * expect(value).toHaveProperty('c', true);
+ * ```
+ *
+ * @param keyPath Path to the property. Use dot notation `a.b` to check nested properties and indexed `a[2]` notation to check nested
+ * array items.
+ * @param expected Optional expected value to compare the property to.
+ */
+ toHaveProperty(keyPath: string | Array, value?: unknown): R;
+ /**
+ * Ensures that string value matches a regular expression.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = 'Is 42 enough?';
+ * expect(value).toMatch(/Is \d+ enough/);
+ * ```
+ *
+ * @param expected Regular expression to match against.
+ */
+ toMatch(expected: RegExp | string): R;
+ /**
+ * Compares contents of the value with contents of
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-match-object-option-expected),
+ * performing "deep equality" check. Allows extra properties to be present in the value, unlike
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal),
+ * so you can check just a subset of object properties.
+ *
+ * When comparing arrays, the number of items must match, and each item is checked recursively.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = {
+ * a: 1,
+ * b: 2,
+ * c: true,
+ * };
+ * expect(value).toMatchObject({ a: 1, c: true });
+ * expect(value).toMatchObject({ b: 2, c: true });
+ *
+ * expect([{ a: 1, b: 2 }]).toMatchObject([{ a: 1 }]);
+ * ```
+ *
+ * @param expected The expected object value to match against.
+ */
+ toMatchObject(expected: Record | Array): R;
+ /**
+ * Compares contents of the value with contents of
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-strict-equal-option-expected)
+ * **and** their types.
+ *
+ * Differences from
+ * [expect(value).toEqual(expected)](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-equal):
+ * - Keys with undefined properties are checked. For example, `{ a: undefined, b: 2 }` does not match `{ b: 2 }`.
+ * - Array sparseness is checked. For example, `[, 1]` does not match `[undefined, 1]`.
+ * - Object types are checked to be equal. For example, a class instance with fields `a` and `b` will not equal a
+ * literal object with fields `a` and `b`.
+ *
+ * **Usage**
+ *
+ * ```js
+ * const value = { prop: 1 };
+ * expect(value).toStrictEqual({ prop: 1 });
+ * ```
+ *
+ * @param expected Expected value.
+ */
+ toStrictEqual(expected: unknown): R;
+ /**
+ * Calls the function and ensures it throws an error.
+ *
+ * Optionally compares the error with
+ * [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-throw-option-expected).
+ * Allowed expected values:
+ * - Regular expression - error message should **match** the pattern.
+ * - String - error message should **include** the substring.
+ * - Error object - error message should be **equal to** the message property of the object.
+ * - Error class - error object should be an **instance of** the class.
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect(() => {
+ * throw new Error('Something bad');
+ * }).toThrow();
+ *
+ * expect(() => {
+ * throw new Error('Something bad');
+ * }).toThrow(/something/);
+ *
+ * expect(() => {
+ * throw new Error('Something bad');
+ * }).toThrow(Error);
+ * ```
+ *
+ * @param expected Expected error message or error object.
+ */
+ toThrow(error?: unknown): R;
+ /**
+ * An alias for
+ * [expect(value).toThrow([expected])](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-throw).
+ *
+ * **Usage**
+ *
+ * ```js
+ * expect(() => {
+ * throw new Error('Something bad');
+ * }).toThrowError();
+ * ```
+ *
+ * @param expected Expected error message or error object.
+ */
+ toThrowError(error?: unknown): R;
+
+}
+
+type FunctionAssertions = {
+ /**
+ * Retries the callback until all assertions within it pass or the `timeout` value is reached.
+ * The `intervals` parameter can be used to establish the probing frequency or pattern.
+ *
+ * **Usage**
+ * ```js
+ * await expect(async () => {
+ * const response = await page.request.get('https://api.example.com');
+ * expect(response.status()).toBe(200);
+ * }).toPass({
+ * // Probe, wait 1s, probe, wait 2s, probe, wait 10s, probe, wait 10s, probe
+ * intervals: [1_000, 2_000, 10_000], // Defaults to [100, 250, 500, 1000].
+ * timeout: 60_000 // Defaults to 0
+ * });
+ * ```
+ *
+ * Note that by default `toPass` does not respect custom expect timeout.
+ *
+ * @param options
+ */
+ toPass(options?: { timeout?: number, intervals?: number[] }): Promise;
+};
+
+type BaseMatchers = GenericAssertions & PlaywrightTest.Matchers & SnapshotAssertions;
+type AllowedGenericMatchers = PlaywrightTest.Matchers & Pick, 'toBe' | 'toBeDefined' | 'toBeFalsy' | 'toBeNull' | 'toBeTruthy' | 'toBeUndefined'>;
+
+type SpecificMatchers =
+ T extends Page ? PageAssertions & AllowedGenericMatchers :
+ T extends Locator ? LocatorAssertions & AllowedGenericMatchers :
+ T extends APIResponse ? APIResponseAssertions & AllowedGenericMatchers :
+ BaseMatchers & (T extends Function ? FunctionAssertions : {});
+type AllMatchers = PageAssertions & LocatorAssertions & APIResponseAssertions & FunctionAssertions & BaseMatchers;
+
+type IfAny = 0 extends (1 & T) ? Y : N;
+type Awaited = T extends PromiseLike ? U : T;
+type ToUserMatcher = F extends (first: any, ...args: infer Rest) => infer R ? (...args: Rest) => (R extends PromiseLike ? Promise : DefaultReturnType) : never;
+type ToUserMatcherObject = {
+ [K in keyof T as T[K] extends (arg: ArgType, ...rest: any[]) => any ? K : never]: ToUserMatcher;
+};
+
+type MatcherHintColor = (arg: string) => string;
+
+export type MatcherHintOptions = {
+ comment?: string;
+ expectedColor?: MatcherHintColor;
+ isDirectExpectCall?: boolean;
+ isNot?: boolean;
+ promise?: string;
+ receivedColor?: MatcherHintColor;
+ secondArgument?: string;
+ secondArgumentColor?: MatcherHintColor;
+};
+
+export interface ExpectMatcherUtils {
+ matcherHint(matcherName: string, received: unknown, expected: unknown, options?: MatcherHintOptions): string;
+ printDiffOrStringify(expected: unknown, received: unknown, expectedLabel: string, receivedLabel: string, expand: boolean): string;
+ printExpected(value: unknown): string;
+ printReceived(object: unknown): string;
+ printWithType(name: string, value: T, print: (value: T) => string): string;
+ diff(a: unknown, b: unknown): string | null;
+ stringify(object: unknown, maxDepth?: number, maxWidth?: number): string;
+}
+
+export type ExpectMatcherState = {
+ /**
+ * Whether this matcher was called with the negated .not modifier.
+ */
+ isNot: boolean;
+ /**
+ * - 'rejects' if matcher was called with the promise .rejects modifier
+ * - 'resolves' if matcher was called with the promise .resolves modifier
+ * - '' if matcher was not called with a promise modifier
+ */
+ promise: 'rejects' | 'resolves' | '';
+ utils: ExpectMatcherUtils;
+ /**
+ * Timeout in milliseconds for the assertion to be fulfilled.
+ */
+ timeout: number;
+};
+
+export type MatcherReturnType = {
+ message: () => string;
+ pass: boolean;
+ name?: string;
+ expected?: unknown;
+ actual?: any;
+ log?: string[];
+ timeout?: number;
+};
+
+type MakeMatchers = {
+ /**
+ * If you know how to test something, `.not` lets you test its opposite.
+ */
+ not: MakeMatchers;
+ /**
+ * Use resolves to unwrap the value of a fulfilled promise so any other
+ * matcher can be chained. If the promise is rejected the assertion fails.
+ */
+ resolves: MakeMatchers, Awaited, ExtendedMatchers>;
+ /**
+ * Unwraps the reason of a rejected promise so any other matcher can be chained.
+ * If the promise is fulfilled the assertion fails.
+ */
+ rejects: MakeMatchers, any, ExtendedMatchers>;
+} & IfAny, SpecificMatchers & ToUserMatcherObject>;
+
+type PollMatchers = {
+ /**
+ * If you know how to test something, `.not` lets you test its opposite.
+ */
+ not: PollMatchers;
+} & BaseMatchers & ToUserMatcherObject;
+
+export type Expect = {
+ (actual: T, messageOrOptions?: string | { message?: string }): MakeMatchers;
+ soft: Expect;
+ poll: (actual: () => T | Promise, messageOrOptions?: string | { message?: string, timeout?: number, intervals?: number[] }) => PollMatchers, T, ExtendedMatchers>;
+ extend MatcherReturnType | Promise>>(matchers: MoreMatchers): Expect;
+ configure: (configuration: {
+ message?: string,
+ timeout?: number,
+ soft?: boolean,
+ }) => Expect;
+ getState(): unknown;
+ not: Omit;
+} & AsymmetricMatchers;
+
+// --- BEGINGLOBAL ---
+declare global {
+ export namespace PlaywrightTest {
+ export interface Matchers {
+ }
+ }
+}
+// --- ENDGLOBAL ---
+
+/**
+ * These tests are executed in Playwright environment that launches the browser
+ * and provides a fresh page to each test.
+ */
+export const test: TestType;
+export default test;
+
+export const _baseTest: TestType<{}, {}>;
+export const expect: Expect<{}>;
+
+/**
+ * Defines Playwright config
+ */
+export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
+export function defineConfig