mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: make ts snippets esm-friendly (#14451)
This commit is contained in:
parent
cac13c248b
commit
f724fa570f
@ -48,7 +48,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
channel: 'chrome',
|
channel: 'chrome',
|
||||||
|
|||||||
@ -138,7 +138,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
|
|||||||
@ -752,7 +752,7 @@ To launch a server during the tests, use the [`webServer`](./test-advanced#launc
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start', // command to launch
|
command: 'npm run start', // command to launch
|
||||||
|
|||||||
@ -15,7 +15,7 @@ Here is an example that defines a common timeout and two projects. The "Smoke" p
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
timeout: 60000, // Timeout is shared between all tests.
|
timeout: 60000, // Timeout is shared between all tests.
|
||||||
projects: [
|
projects: [
|
||||||
@ -152,7 +152,7 @@ It is also recommended to specify [`property: TestOptions.baseURL`] in the confi
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start',
|
command: 'npm run start',
|
||||||
@ -269,7 +269,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalSetup: require.resolve('./global-setup'),
|
globalSetup: require.resolve('./global-setup'),
|
||||||
@ -392,7 +392,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
projects: [
|
projects: [
|
||||||
@ -430,7 +430,7 @@ Here is an example that runs projects with different tests and configurations. T
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
timeout: 60000, // Timeout is shared between all tests.
|
timeout: 60000, // Timeout is shared between all tests.
|
||||||
projects: [
|
projects: [
|
||||||
|
|||||||
@ -31,7 +31,7 @@ GitHub API requires authorization, so we'll configure the token once for all tes
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
|
|||||||
@ -601,7 +601,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
import { Options } from './my-test';
|
import { Options } from './my-test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig<Options> = {
|
const config: PlaywrightTestConfig<Options> = {
|
||||||
|
|||||||
@ -22,7 +22,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
@ -69,7 +69,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
expect: {
|
expect: {
|
||||||
@ -101,7 +101,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
@ -138,7 +138,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalSetup: './global-setup',
|
globalSetup: './global-setup',
|
||||||
@ -167,7 +167,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalTeardown: './global-teardown',
|
globalTeardown: './global-teardown',
|
||||||
@ -194,7 +194,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
||||||
@ -239,7 +239,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
maxFailures: process.env.CI ? 1 : 0,
|
maxFailures: process.env.CI ? 1 : 0,
|
||||||
@ -276,7 +276,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
outputDir: './test-results',
|
outputDir: './test-results',
|
||||||
@ -371,7 +371,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: 'line',
|
reporter: 'line',
|
||||||
@ -407,7 +407,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
retries: 2,
|
retries: 2,
|
||||||
@ -479,7 +479,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
testDir: './tests/playwright',
|
testDir: './tests/playwright',
|
||||||
@ -508,7 +508,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
testIgnore: '**/test-assets/**',
|
testIgnore: '**/test-assets/**',
|
||||||
@ -537,7 +537,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
testMatch: /.*\.e2e\.js/,
|
testMatch: /.*\.e2e\.js/,
|
||||||
@ -566,7 +566,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
timeout: 5 * 60 * 1000,
|
timeout: 5 * 60 * 1000,
|
||||||
@ -605,7 +605,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
@ -640,7 +640,7 @@ It is also recommended to specify [`property: TestOptions.baseURL`] in the confi
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start',
|
command: 'npm run start',
|
||||||
@ -718,7 +718,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
workers: 3,
|
workers: 3,
|
||||||
|
|||||||
@ -22,7 +22,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
headless: false,
|
headless: false,
|
||||||
@ -85,7 +85,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
|
|||||||
@ -59,7 +59,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// Options shared for all projects.
|
// Options shared for all projects.
|
||||||
@ -298,7 +298,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
projects: [
|
projects: [
|
||||||
@ -391,7 +391,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
projects: [
|
projects: [
|
||||||
|
|||||||
@ -109,7 +109,7 @@ Register global setup script in the Playwright configuration file:
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalSetup: require.resolve('./global-setup'),
|
globalSetup: require.resolve('./global-setup'),
|
||||||
|
|||||||
@ -34,7 +34,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
headless: false,
|
headless: false,
|
||||||
@ -145,7 +145,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
baseURL: 'http://localhost:3000',
|
baseURL: 'http://localhost:3000',
|
||||||
@ -188,7 +188,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
projects: [
|
projects: [
|
||||||
@ -272,7 +272,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
projects: [
|
projects: [
|
||||||
@ -327,7 +327,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
locale: 'fr-FR',
|
locale: 'fr-FR',
|
||||||
@ -435,7 +435,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
screenshot: 'only-on-failure',
|
screenshot: 'only-on-failure',
|
||||||
@ -469,7 +469,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
video: 'on-first-retry',
|
video: 'on-first-retry',
|
||||||
@ -503,7 +503,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
trace: 'retain-on-failure',
|
trace: 'retain-on-failure',
|
||||||
@ -532,7 +532,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
launchOptions: {
|
launchOptions: {
|
||||||
@ -593,7 +593,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// Look for test files in the "tests" directory, relative to this configuration file
|
// Look for test files in the "tests" directory, relative to this configuration file
|
||||||
|
|||||||
@ -592,7 +592,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
import { MyOptions } from './my-test';
|
import { MyOptions } from './my-test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig<MyOptions> = {
|
const config: PlaywrightTestConfig<MyOptions> = {
|
||||||
|
|||||||
@ -47,7 +47,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// Limit the number of workers on CI, use default locally
|
// Limit the number of workers on CI, use default locally
|
||||||
@ -104,7 +104,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
@ -214,7 +214,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// Limit the number of failures on CI to save resources
|
// Limit the number of failures on CI to save resources
|
||||||
@ -318,7 +318,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
workers: 1,
|
workers: 1,
|
||||||
|
|||||||
@ -112,7 +112,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
import { TestOptions } from './my-test';
|
import { TestOptions } from './my-test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig<TestOptions> = {
|
const config: PlaywrightTestConfig<TestOptions> = {
|
||||||
@ -243,7 +243,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
@ -295,7 +295,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: './my-awesome-reporter.ts',
|
reporter: './my-awesome-reporter.ts',
|
||||||
|
|||||||
@ -30,7 +30,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: 'line',
|
reporter: 'line',
|
||||||
@ -59,7 +59,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: [
|
reporter: [
|
||||||
@ -89,7 +89,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// Concise 'dot' for CI, default 'list' when running locally
|
// Concise 'dot' for CI, default 'list' when running locally
|
||||||
@ -124,7 +124,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: 'list',
|
reporter: 'list',
|
||||||
@ -171,7 +171,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: 'line',
|
reporter: 'line',
|
||||||
@ -215,7 +215,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: 'dot',
|
reporter: 'dot',
|
||||||
@ -256,7 +256,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: [ ['html', { open: 'never' }] ],
|
reporter: [ ['html', { open: 'never' }] ],
|
||||||
@ -282,7 +282,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: [ ['html', { outputFolder: 'my-report' }] ],
|
reporter: [ ['html', { outputFolder: 'my-report' }] ],
|
||||||
@ -338,7 +338,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: [ ['json', { outputFile: 'results.json' }] ],
|
reporter: [ ['json', { outputFile: 'results.json' }] ],
|
||||||
@ -381,7 +381,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: [ ['junit', { outputFile: 'results.xml' }] ],
|
reporter: [ ['junit', { outputFile: 'results.xml' }] ],
|
||||||
@ -411,7 +411,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
|
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
|
||||||
@ -491,7 +491,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
reporter: './my-awesome-reporter.ts',
|
reporter: './my-awesome-reporter.ts',
|
||||||
|
|||||||
@ -85,7 +85,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
// Give failing tests 3 retry attempts
|
// Give failing tests 3 retry attempts
|
||||||
|
|||||||
@ -103,7 +103,7 @@ module.exports = {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
expect: {
|
expect: {
|
||||||
toHaveScreenshot: { maxDiffPixels: 100 },
|
toHaveScreenshot: { maxDiffPixels: 100 },
|
||||||
|
|||||||
@ -48,7 +48,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
timeout: 5 * 60 * 1000,
|
timeout: 5 * 60 * 1000,
|
||||||
@ -146,7 +146,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
expect: {
|
expect: {
|
||||||
@ -210,7 +210,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
use: {
|
use: {
|
||||||
@ -271,7 +271,7 @@ module.exports = config;
|
|||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
// playwright.config.ts
|
// playwright.config.ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalTimeout: 60 * 60 * 1000,
|
globalTimeout: 60 * 60 * 1000,
|
||||||
|
|||||||
@ -29,7 +29,7 @@ module.exports = config;
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js js-flavor=ts
|
```js js-flavor=ts
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
retries: 1,
|
retries: 1,
|
||||||
use: {
|
use: {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable notice/notice */
|
/* eslint-disable notice/notice */
|
||||||
|
|
||||||
import { PlaywrightTestConfig } from '@playwright/test';
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See https://playwright.dev/docs/test-configuration.
|
* See https://playwright.dev/docs/test-configuration.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable notice/notice */
|
/* eslint-disable notice/notice */
|
||||||
|
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See https://playwright.dev/docs/test-configuration.
|
* See https://playwright.dev/docs/test-configuration.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable notice/notice */
|
/* eslint-disable notice/notice */
|
||||||
|
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See https://playwright.dev/docs/test-configuration.
|
* See https://playwright.dev/docs/test-configuration.
|
||||||
|
|||||||
76
packages/playwright-test/types/test.d.ts
vendored
76
packages/playwright-test/types/test.d.ts
vendored
@ -44,7 +44,7 @@ type UseOptions<TestArgs, WorkerArgs> = { [K in keyof WorkerArgs]?: WorkerArgs[K
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* // Options shared for all projects.
|
* // Options shared for all projects.
|
||||||
@ -98,7 +98,7 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -132,7 +132,7 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* // Options shared for all projects.
|
* // Options shared for all projects.
|
||||||
@ -264,7 +264,7 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -343,7 +343,7 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -376,7 +376,7 @@ type LiteralUnion<T extends U, U = string> = T | (U & { zz_IGNORE_ME?: never });
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 30000,
|
* timeout: 30000,
|
||||||
@ -401,7 +401,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* reporter: 'line',
|
* reporter: 'line',
|
||||||
@ -430,7 +430,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* webServer: {
|
* webServer: {
|
||||||
* command: 'npm run start',
|
* command: 'npm run start',
|
||||||
@ -464,7 +464,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* expect: {
|
* expect: {
|
||||||
@ -556,7 +556,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* forbidOnly: !!process.env.CI,
|
* forbidOnly: !!process.env.CI,
|
||||||
@ -584,7 +584,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalSetup: './global-setup',
|
* globalSetup: './global-setup',
|
||||||
@ -603,7 +603,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTeardown: './global-teardown',
|
* globalTeardown: './global-teardown',
|
||||||
@ -621,7 +621,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
||||||
@ -657,7 +657,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* maxFailures: process.env.CI ? 1 : 0,
|
* maxFailures: process.env.CI ? 1 : 0,
|
||||||
@ -684,7 +684,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* outputDir: './test-results',
|
* outputDir: './test-results',
|
||||||
@ -777,7 +777,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* retries: 2,
|
* retries: 2,
|
||||||
@ -810,7 +810,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* testDir: './tests/playwright',
|
* testDir: './tests/playwright',
|
||||||
@ -829,7 +829,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* testIgnore: '**\/test-assets/**',
|
* testIgnore: '**\/test-assets/**',
|
||||||
@ -848,7 +848,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* testMatch: /.*\.e2e\.js/,
|
* testMatch: /.*\.e2e\.js/,
|
||||||
@ -868,7 +868,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 5 * 60 * 1000,
|
* timeout: 5 * 60 * 1000,
|
||||||
@ -901,7 +901,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* workers: 3,
|
* workers: 3,
|
||||||
@ -922,7 +922,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 30000,
|
* timeout: 30000,
|
||||||
@ -946,7 +946,7 @@ export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
@ -972,7 +972,7 @@ export type Metadata = { [key: string]: any };
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 30000,
|
* timeout: 30000,
|
||||||
@ -992,7 +992,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* forbidOnly: !!process.env.CI,
|
* forbidOnly: !!process.env.CI,
|
||||||
@ -1018,7 +1018,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalSetup: './global-setup',
|
* globalSetup: './global-setup',
|
||||||
@ -1036,7 +1036,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTeardown: './global-teardown',
|
* globalTeardown: './global-teardown',
|
||||||
@ -1053,7 +1053,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
||||||
@ -1086,7 +1086,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* maxFailures: process.env.CI ? 1 : 0,
|
* maxFailures: process.env.CI ? 1 : 0,
|
||||||
@ -1125,7 +1125,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* reporter: 'line',
|
* reporter: 'line',
|
||||||
@ -1174,7 +1174,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* workers: 3,
|
* workers: 3,
|
||||||
@ -1203,7 +1203,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* webServer: {
|
* webServer: {
|
||||||
* command: 'npm run start',
|
* command: 'npm run start',
|
||||||
@ -2414,7 +2414,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* import { Options } from './my-test';
|
* import { Options } from './my-test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig<Options> = {
|
* const config: PlaywrightTestConfig<Options> = {
|
||||||
@ -2489,7 +2489,7 @@ type ConnectOptions = {
|
|||||||
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
* headless: false,
|
* headless: false,
|
||||||
@ -2524,7 +2524,7 @@ export interface PlaywrightWorkerOptions {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
@ -2616,7 +2616,7 @@ export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry';
|
|||||||
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
* headless: false,
|
* headless: false,
|
||||||
@ -3937,7 +3937,7 @@ export interface TestError {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* // Options shared for all projects.
|
* // Options shared for all projects.
|
||||||
@ -4163,7 +4163,7 @@ interface TestProject {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
|
|||||||
@ -323,7 +323,7 @@ export interface FullResult {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* reporter: './my-awesome-reporter.ts',
|
* reporter: './my-awesome-reporter.ts',
|
||||||
|
|||||||
78
tests/config/experimental.d.ts
vendored
78
tests/config/experimental.d.ts
vendored
@ -16226,7 +16226,7 @@ type UseOptions<TestArgs, WorkerArgs> = { [K in keyof WorkerArgs]?: WorkerArgs[K
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* // Options shared for all projects.
|
* // Options shared for all projects.
|
||||||
@ -16280,7 +16280,7 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -16314,7 +16314,7 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* // Options shared for all projects.
|
* // Options shared for all projects.
|
||||||
@ -16446,7 +16446,7 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -16525,7 +16525,7 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -16558,7 +16558,7 @@ type LiteralUnion<T extends U, U = string> = T | (U & { zz_IGNORE_ME?: never });
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 30000,
|
* timeout: 30000,
|
||||||
@ -16583,7 +16583,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* reporter: 'line',
|
* reporter: 'line',
|
||||||
@ -16612,7 +16612,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* webServer: {
|
* webServer: {
|
||||||
* command: 'npm run start',
|
* command: 'npm run start',
|
||||||
@ -16646,7 +16646,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* expect: {
|
* expect: {
|
||||||
@ -16738,7 +16738,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* forbidOnly: !!process.env.CI,
|
* forbidOnly: !!process.env.CI,
|
||||||
@ -16766,7 +16766,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalSetup: './global-setup',
|
* globalSetup: './global-setup',
|
||||||
@ -16785,7 +16785,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTeardown: './global-teardown',
|
* globalTeardown: './global-teardown',
|
||||||
@ -16803,7 +16803,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
||||||
@ -16839,7 +16839,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* maxFailures: process.env.CI ? 1 : 0,
|
* maxFailures: process.env.CI ? 1 : 0,
|
||||||
@ -16866,7 +16866,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* outputDir: './test-results',
|
* outputDir: './test-results',
|
||||||
@ -16959,7 +16959,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* retries: 2,
|
* retries: 2,
|
||||||
@ -17030,7 +17030,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* testDir: './tests/playwright',
|
* testDir: './tests/playwright',
|
||||||
@ -17049,7 +17049,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* testIgnore: '**\/test-assets/**',
|
* testIgnore: '**\/test-assets/**',
|
||||||
@ -17068,7 +17068,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* testMatch: /.*\.e2e\.js/,
|
* testMatch: /.*\.e2e\.js/,
|
||||||
@ -17088,7 +17088,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 5 * 60 * 1000,
|
* timeout: 5 * 60 * 1000,
|
||||||
@ -17121,7 +17121,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* workers: 3,
|
* workers: 3,
|
||||||
@ -17142,7 +17142,7 @@ interface TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 30000,
|
* timeout: 30000,
|
||||||
@ -17166,7 +17166,7 @@ export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
@ -17192,7 +17192,7 @@ export type Metadata = { [key: string]: any };
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* timeout: 30000,
|
* timeout: 30000,
|
||||||
@ -17212,7 +17212,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* forbidOnly: !!process.env.CI,
|
* forbidOnly: !!process.env.CI,
|
||||||
@ -17238,7 +17238,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalSetup: './global-setup',
|
* globalSetup: './global-setup',
|
||||||
@ -17256,7 +17256,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTeardown: './global-teardown',
|
* globalTeardown: './global-teardown',
|
||||||
@ -17273,7 +17273,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
* globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined,
|
||||||
@ -17306,7 +17306,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* maxFailures: process.env.CI ? 1 : 0,
|
* maxFailures: process.env.CI ? 1 : 0,
|
||||||
@ -17345,7 +17345,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* reporter: 'line',
|
* reporter: 'line',
|
||||||
@ -17394,7 +17394,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* workers: 3,
|
* workers: 3,
|
||||||
@ -17423,7 +17423,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* webServer: {
|
* webServer: {
|
||||||
* command: 'npm run start',
|
* command: 'npm run start',
|
||||||
@ -18634,7 +18634,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* import { Options } from './my-test';
|
* import { Options } from './my-test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig<Options> = {
|
* const config: PlaywrightTestConfig<Options> = {
|
||||||
@ -18709,7 +18709,7 @@ type ConnectOptions = {
|
|||||||
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
* headless: false,
|
* headless: false,
|
||||||
@ -18744,7 +18744,7 @@ export interface PlaywrightWorkerOptions {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
@ -18836,7 +18836,7 @@ export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry';
|
|||||||
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
* [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* use: {
|
* use: {
|
||||||
* headless: false,
|
* headless: false,
|
||||||
@ -20149,7 +20149,7 @@ export interface TestError {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig, devices } from '@playwright/test';
|
* import { type PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* // Options shared for all projects.
|
* // Options shared for all projects.
|
||||||
@ -20411,7 +20411,7 @@ interface TestProject {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* projects: [
|
* projects: [
|
||||||
@ -20863,7 +20863,7 @@ export interface FullResult {
|
|||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* // playwright.config.ts
|
* // playwright.config.ts
|
||||||
* import { PlaywrightTestConfig } from '@playwright/test';
|
* import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
*
|
*
|
||||||
* const config: PlaywrightTestConfig = {
|
* const config: PlaywrightTestConfig = {
|
||||||
* reporter: './my-awesome-reporter.ts',
|
* reporter: './my-awesome-reporter.ts',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user