@smoothdeploy/playwright 1.58.3 → 1.60.0-beta-1780662356000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ThirdPartyNotices.txt +8 -5036
- package/lib/agents/agentParser.js +2 -2
- package/lib/agents/generateAgents.js +21 -22
- package/lib/agents/playwright-test-healer.agent.md +1 -0
- package/lib/agents/playwright-test-planner.agent.md +2 -1
- package/lib/cli/reportActions.js +78 -0
- package/lib/cli/testActions.js +211 -0
- package/lib/common/index.js +2898 -0
- package/lib/common/index.js.txt +35 -0
- package/lib/errorContext.js +130 -0
- package/lib/index.js +283 -206
- package/lib/{isomorphic/testServerConnection.js → isomorphic.js} +70 -35
- package/lib/isomorphic.js.txt +9 -0
- package/lib/loader/loaderProcessEntry.js +34 -0
- package/lib/loader/loaderProcessEntry.js.txt +9 -0
- package/lib/matchers/expect.js +12988 -249
- package/lib/matchers/expect.js.LICENSE +693 -0
- package/lib/matchers/expect.js.txt +72 -0
- package/lib/mcp/test/browserBackend.js +49 -22
- package/lib/mcp/test/generatorTools.js +16 -16
- package/lib/mcp/test/plannerTools.js +25 -20
- package/lib/mcp/test/seed.js +7 -7
- package/lib/mcp/test/testBackend.js +30 -30
- package/lib/mcp/test/testContext.js +50 -33
- package/lib/mcp/test/testTools.js +15 -25
- package/lib/{internalsForTest.js → package.js} +13 -8
- package/lib/program.js +63 -263
- package/lib/runner/index.js +8339 -0
- package/lib/runner/index.js.txt +60 -0
- package/lib/transform/babelBundle.js +71002 -18
- package/lib/transform/babelBundle.js.LICENSE +2359 -0
- package/lib/transform/babelBundle.js.txt +325 -0
- package/lib/transform/esmLoader.js +5884 -30
- package/lib/transform/esmLoader.js.LICENSE +335 -0
- package/lib/transform/esmLoader.js.txt +55 -0
- package/lib/util.js +37 -34
- package/lib/worker/workerProcessEntry.js +3251 -0
- package/lib/worker/workerProcessEntry.js.txt +24 -0
- package/package.json +5 -16
- package/test.mjs +1 -0
- package/types/test.d.ts +173 -12
- package/types/testReporter.d.ts +7 -5
- package/lib/common/config.js +0 -282
- package/lib/common/configLoader.js +0 -344
- package/lib/common/esmLoaderHost.js +0 -104
- package/lib/common/expectBundle.js +0 -28
- package/lib/common/expectBundleImpl.js +0 -407
- package/lib/common/fixtures.js +0 -302
- package/lib/common/ipc.js +0 -60
- package/lib/common/poolBuilder.js +0 -85
- package/lib/common/process.js +0 -132
- package/lib/common/suiteUtils.js +0 -140
- package/lib/common/test.js +0 -321
- package/lib/common/testLoader.js +0 -101
- package/lib/common/testType.js +0 -298
- package/lib/common/validators.js +0 -68
- package/lib/fsWatcher.js +0 -67
- package/lib/isomorphic/events.js +0 -77
- package/lib/isomorphic/folders.js +0 -30
- package/lib/isomorphic/stringInternPool.js +0 -69
- package/lib/isomorphic/teleReceiver.js +0 -521
- package/lib/isomorphic/teleSuiteUpdater.js +0 -157
- package/lib/isomorphic/testServerInterface.js +0 -16
- package/lib/isomorphic/testTree.js +0 -329
- package/lib/isomorphic/types.d.js +0 -16
- package/lib/loader/loaderMain.js +0 -59
- package/lib/matchers/matcherHint.js +0 -44
- package/lib/matchers/matchers.js +0 -383
- package/lib/matchers/toBeTruthy.js +0 -75
- package/lib/matchers/toEqual.js +0 -100
- package/lib/matchers/toHaveURL.js +0 -101
- package/lib/matchers/toMatchAriaSnapshot.js +0 -159
- package/lib/matchers/toMatchSnapshot.js +0 -342
- package/lib/matchers/toMatchText.js +0 -99
- package/lib/mcp/browser/browserContextFactory.js +0 -329
- package/lib/mcp/browser/browserServerBackend.js +0 -84
- package/lib/mcp/browser/config.js +0 -421
- package/lib/mcp/browser/context.js +0 -244
- package/lib/mcp/browser/response.js +0 -278
- package/lib/mcp/browser/sessionLog.js +0 -75
- package/lib/mcp/browser/tab.js +0 -343
- package/lib/mcp/browser/tools/common.js +0 -65
- package/lib/mcp/browser/tools/console.js +0 -46
- package/lib/mcp/browser/tools/dialogs.js +0 -60
- package/lib/mcp/browser/tools/evaluate.js +0 -61
- package/lib/mcp/browser/tools/files.js +0 -58
- package/lib/mcp/browser/tools/form.js +0 -63
- package/lib/mcp/browser/tools/install.js +0 -72
- package/lib/mcp/browser/tools/keyboard.js +0 -107
- package/lib/mcp/browser/tools/mouse.js +0 -107
- package/lib/mcp/browser/tools/navigate.js +0 -71
- package/lib/mcp/browser/tools/network.js +0 -63
- package/lib/mcp/browser/tools/open.js +0 -57
- package/lib/mcp/browser/tools/pdf.js +0 -49
- package/lib/mcp/browser/tools/runCode.js +0 -78
- package/lib/mcp/browser/tools/screenshot.js +0 -93
- package/lib/mcp/browser/tools/snapshot.js +0 -173
- package/lib/mcp/browser/tools/tabs.js +0 -67
- package/lib/mcp/browser/tools/tool.js +0 -47
- package/lib/mcp/browser/tools/tracing.js +0 -74
- package/lib/mcp/browser/tools/utils.js +0 -94
- package/lib/mcp/browser/tools/verify.js +0 -143
- package/lib/mcp/browser/tools/wait.js +0 -63
- package/lib/mcp/browser/tools.js +0 -84
- package/lib/mcp/browser/watchdog.js +0 -44
- package/lib/mcp/config.d.js +0 -16
- package/lib/mcp/extension/cdpRelay.js +0 -351
- package/lib/mcp/extension/extensionContextFactory.js +0 -76
- package/lib/mcp/extension/protocol.js +0 -28
- package/lib/mcp/index.js +0 -61
- package/lib/mcp/log.js +0 -35
- package/lib/mcp/program.js +0 -111
- package/lib/mcp/sdk/exports.js +0 -28
- package/lib/mcp/sdk/http.js +0 -152
- package/lib/mcp/sdk/inProcessTransport.js +0 -71
- package/lib/mcp/sdk/server.js +0 -223
- package/lib/mcp/sdk/tool.js +0 -47
- package/lib/mcp/terminal/cli.js +0 -296
- package/lib/mcp/terminal/command.js +0 -56
- package/lib/mcp/terminal/commands.js +0 -333
- package/lib/mcp/terminal/daemon.js +0 -129
- package/lib/mcp/terminal/help.json +0 -32
- package/lib/mcp/terminal/helpGenerator.js +0 -88
- package/lib/mcp/terminal/socketConnection.js +0 -80
- package/lib/plugins/gitCommitInfoPlugin.js +0 -198
- package/lib/plugins/index.js +0 -28
- package/lib/plugins/webServerPlugin.js +0 -237
- package/lib/reporters/base.js +0 -634
- package/lib/reporters/blob.js +0 -138
- package/lib/reporters/dot.js +0 -99
- package/lib/reporters/empty.js +0 -32
- package/lib/reporters/github.js +0 -128
- package/lib/reporters/html.js +0 -633
- package/lib/reporters/internalReporter.js +0 -138
- package/lib/reporters/json.js +0 -254
- package/lib/reporters/junit.js +0 -232
- package/lib/reporters/line.js +0 -131
- package/lib/reporters/list.js +0 -253
- package/lib/reporters/listModeReporter.js +0 -69
- package/lib/reporters/markdown.js +0 -144
- package/lib/reporters/merge.js +0 -558
- package/lib/reporters/multiplexer.js +0 -112
- package/lib/reporters/reporterV2.js +0 -102
- package/lib/reporters/smoothdeploy.js +0 -333
- package/lib/reporters/teleEmitter.js +0 -317
- package/lib/reporters/versions/blobV1.js +0 -16
- package/lib/runner/dispatcher.js +0 -531
- package/lib/runner/failureTracker.js +0 -72
- package/lib/runner/lastRun.js +0 -77
- package/lib/runner/loadUtils.js +0 -334
- package/lib/runner/loaderHost.js +0 -89
- package/lib/runner/processHost.js +0 -180
- package/lib/runner/projectUtils.js +0 -241
- package/lib/runner/rebase.js +0 -189
- package/lib/runner/reporters.js +0 -140
- package/lib/runner/sigIntWatcher.js +0 -96
- package/lib/runner/storage.js +0 -91
- package/lib/runner/taskRunner.js +0 -127
- package/lib/runner/tasks.js +0 -410
- package/lib/runner/testGroups.js +0 -125
- package/lib/runner/testRunner.js +0 -398
- package/lib/runner/testServer.js +0 -269
- package/lib/runner/uiModeReporter.js +0 -30
- package/lib/runner/vcs.js +0 -72
- package/lib/runner/watchMode.js +0 -396
- package/lib/runner/workerHost.js +0 -104
- package/lib/third_party/pirates.js +0 -62
- package/lib/third_party/tsconfig-loader.js +0 -103
- package/lib/transform/babelBundleImpl.js +0 -461
- package/lib/transform/compilationCache.js +0 -274
- package/lib/transform/md.js +0 -221
- package/lib/transform/portTransport.js +0 -67
- package/lib/transform/transform.js +0 -303
- package/lib/utilsBundle.js +0 -50
- package/lib/utilsBundleImpl.js +0 -103
- package/lib/worker/fixtureRunner.js +0 -262
- package/lib/worker/testInfo.js +0 -536
- package/lib/worker/testTracing.js +0 -345
- package/lib/worker/timeoutManager.js +0 -174
- package/lib/worker/util.js +0 -31
- package/lib/worker/workerMain.js +0 -530
- /package/lib/{common/globals.js → globals.js} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# packages/playwright/lib/worker/workerProcessEntry.js
|
|
2
|
+
# total: 123.4 KB
|
|
3
|
+
|
|
4
|
+
## Inlined (12)
|
|
5
|
+
4.7 KB packages/playwright/src/util.ts
|
|
6
|
+
8.6 KB packages/playwright/src/worker/fixtureRunner.ts
|
|
7
|
+
20.8 KB packages/playwright/src/worker/testInfo.ts
|
|
8
|
+
11.6 KB packages/playwright/src/worker/testTracing.ts
|
|
9
|
+
5.4 KB packages/playwright/src/worker/timeoutManager.ts
|
|
10
|
+
0.3 KB packages/playwright/src/worker/util.ts
|
|
11
|
+
21.0 KB packages/playwright/src/worker/workerMain.ts
|
|
12
|
+
0.1 KB packages/playwright/src/worker/workerProcessEntry.ts
|
|
13
|
+
6.0 KB packages/utils/third_party/yauzl/buffer-crc32.js
|
|
14
|
+
9.3 KB packages/utils/third_party/yauzl/fd-slicer.js
|
|
15
|
+
32.2 KB packages/utils/third_party/yauzl/index.js
|
|
16
|
+
1.4 KB packages/utils/third_party/yauzl/pend.js
|
|
17
|
+
|
|
18
|
+
## External (6)
|
|
19
|
+
../common
|
|
20
|
+
../globals
|
|
21
|
+
../matchers/expect
|
|
22
|
+
playwright-core/lib/coreBundle
|
|
23
|
+
playwright-core/lib/utilsBundle
|
|
24
|
+
playwright-core/package.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smoothdeploy/playwright",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.60.0-beta-1780662356000",
|
|
4
4
|
"description": "A high-level API to automate web browsers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,30 +19,19 @@
|
|
|
19
19
|
"default": "./index.js"
|
|
20
20
|
},
|
|
21
21
|
"./package.json": "./package.json",
|
|
22
|
-
"./lib/common
|
|
22
|
+
"./lib/common": "./lib/common/index.js",
|
|
23
23
|
"./lib/fsWatcher": "./lib/fsWatcher.js",
|
|
24
24
|
"./lib/mcp/index": "./lib/mcp/index.js",
|
|
25
|
-
"./lib/mcp/browser/tools": "./lib/mcp/browser/tools.js",
|
|
26
|
-
"./lib/mcp/program": "./lib/mcp/program.js",
|
|
27
|
-
"./lib/mcp/sdk/bundle": "./lib/mcp/sdk/bundle.js",
|
|
28
|
-
"./lib/mcp/sdk/exports": "./lib/mcp/sdk/exports.js",
|
|
29
25
|
"./lib/program": "./lib/program.js",
|
|
30
|
-
"./lib/
|
|
31
|
-
"./lib/
|
|
26
|
+
"./lib/runner": "./lib/runner/index.js",
|
|
27
|
+
"./lib/isomorphic": "./lib/isomorphic/index.js",
|
|
32
28
|
"./lib/transform/babelBundle": "./lib/transform/babelBundle.js",
|
|
33
|
-
"./lib/transform/compilationCache": "./lib/transform/compilationCache.js",
|
|
34
|
-
"./lib/transform/esmLoader": "./lib/transform/esmLoader.js",
|
|
35
|
-
"./lib/transform/transform": "./lib/transform/transform.js",
|
|
36
|
-
"./lib/internalsForTest": "./lib/internalsForTest.js",
|
|
37
|
-
"./lib/plugins": "./lib/plugins/index.js",
|
|
38
|
-
"./lib/runner/testRunner": "./lib/runner/testRunner.js",
|
|
39
29
|
"./jsx-runtime": {
|
|
40
30
|
"import": "./jsx-runtime.mjs",
|
|
41
31
|
"require": "./jsx-runtime.js",
|
|
42
32
|
"default": "./jsx-runtime.js"
|
|
43
33
|
},
|
|
44
34
|
"./lib/util": "./lib/util.js",
|
|
45
|
-
"./lib/utilsBundle": "./lib/utilsBundle.js",
|
|
46
35
|
"./types/test": {
|
|
47
36
|
"types": "./types/test.d.ts"
|
|
48
37
|
},
|
|
@@ -64,7 +53,7 @@
|
|
|
64
53
|
},
|
|
65
54
|
"license": "Apache-2.0",
|
|
66
55
|
"dependencies": {
|
|
67
|
-
"playwright-core": "npm:@smoothdeploy/playwright-core@1.
|
|
56
|
+
"playwright-core": "npm:@smoothdeploy/playwright-core@1.60.0-beta-1780662356000"
|
|
68
57
|
},
|
|
69
58
|
"optionalDependencies": {
|
|
70
59
|
"fsevents": "2.3.2"
|
package/test.mjs
CHANGED
|
@@ -26,6 +26,7 @@ export const request = playwright.request;
|
|
|
26
26
|
export const _electron = playwright._electron;
|
|
27
27
|
export const _android = playwright._android;
|
|
28
28
|
export const _baseTest = playwright._baseTest;
|
|
29
|
+
export const _utilityTest = playwright._utilityTest;
|
|
29
30
|
export const test = playwright.test;
|
|
30
31
|
export const expect = playwright.expect;
|
|
31
32
|
export const defineConfig = playwright.defineConfig;
|
package/types/test.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export * from 'playwright-core';
|
|
|
20
20
|
|
|
21
21
|
export type BlobReporterOptions = { outputDir?: string, fileName?: string };
|
|
22
22
|
export type ListReporterOptions = { printSteps?: boolean };
|
|
23
|
-
export type JUnitReporterOptions = { outputFile?: string, stripANSIControlSequences?: boolean, includeProjectInTestName?: boolean };
|
|
23
|
+
export type JUnitReporterOptions = { outputFile?: string, stripANSIControlSequences?: boolean, includeProjectInTestName?: boolean, includeRetries?: boolean };
|
|
24
24
|
export type JsonReporterOptions = { outputFile?: string };
|
|
25
25
|
export type HtmlReporterOptions = {
|
|
26
26
|
outputFolder?: string;
|
|
@@ -31,6 +31,7 @@ export type HtmlReporterOptions = {
|
|
|
31
31
|
title?: string;
|
|
32
32
|
noSnippets?: boolean;
|
|
33
33
|
noCopyPrompt?: boolean;
|
|
34
|
+
doNotInlineAssets?: boolean;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export type ReporterDescription = Readonly<
|
|
@@ -250,6 +251,13 @@ interface TestProject<TestArgs = {}, WorkerArgs = {}> {
|
|
|
250
251
|
* for details.
|
|
251
252
|
*/
|
|
252
253
|
pathTemplate?: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Controls how children of the snapshot root are matched against the actual accessibility tree. This is equivalent to
|
|
257
|
+
* adding a `/children` property at the top of every aria snapshot template. Individual snapshots can override this by
|
|
258
|
+
* including an explicit `/children` property.
|
|
259
|
+
*/
|
|
260
|
+
children?: "contain"|"equal"|"deep-equal";
|
|
253
261
|
};
|
|
254
262
|
|
|
255
263
|
/**
|
|
@@ -521,6 +529,8 @@ interface TestProject<TestArgs = {}, WorkerArgs = {}> {
|
|
|
521
529
|
* config)
|
|
522
530
|
* - `{testFileDir}` - Directories in relative path from `testDir` to **test file**.
|
|
523
531
|
* - Value: `page`
|
|
532
|
+
* - `{testFileBaseName}` - Test file name without the last extension.
|
|
533
|
+
* - Value: `page-click.spec`
|
|
524
534
|
* - `{testFileName}` - Test file name with extension.
|
|
525
535
|
* - Value: `page-click.spec.ts`
|
|
526
536
|
* - `{testFilePath}` - Relative path from `testDir` to **test file**.
|
|
@@ -764,6 +774,11 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|
|
764
774
|
*/
|
|
765
775
|
grepInvert: null|RegExp|Array<RegExp>;
|
|
766
776
|
|
|
777
|
+
/**
|
|
778
|
+
* See [testProject.ignoreSnapshots](https://playwright.dev/docs/api/class-testproject#test-project-ignore-snapshots).
|
|
779
|
+
*/
|
|
780
|
+
ignoreSnapshots: boolean;
|
|
781
|
+
|
|
767
782
|
/**
|
|
768
783
|
* See [testProject.metadata](https://playwright.dev/docs/api/class-testproject#test-project-metadata).
|
|
769
784
|
*/
|
|
@@ -1176,6 +1191,13 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
|
|
|
1176
1191
|
* for details.
|
|
1177
1192
|
*/
|
|
1178
1193
|
pathTemplate?: string;
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Controls how children of the snapshot root are matched against the actual accessibility tree. This is equivalent to
|
|
1197
|
+
* adding a `/children` property at the top of every aria snapshot template. Individual snapshots can override this by
|
|
1198
|
+
* including an explicit `/children` property.
|
|
1199
|
+
*/
|
|
1200
|
+
children?: "contain"|"equal"|"deep-equal";
|
|
1179
1201
|
};
|
|
1180
1202
|
|
|
1181
1203
|
/**
|
|
@@ -1750,6 +1772,8 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
|
|
|
1750
1772
|
* config)
|
|
1751
1773
|
* - `{testFileDir}` - Directories in relative path from `testDir` to **test file**.
|
|
1752
1774
|
* - Value: `page`
|
|
1775
|
+
* - `{testFileBaseName}` - Test file name without the last extension.
|
|
1776
|
+
* - Value: `page-click.spec`
|
|
1753
1777
|
* - `{testFileName}` - Test file name with extension.
|
|
1754
1778
|
* - Value: `page-click.spec.ts`
|
|
1755
1779
|
* - `{testFilePath}` - Relative path from `testDir` to **test file**.
|
|
@@ -5511,6 +5535,29 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
|
|
|
5511
5535
|
only(title: string, details: TestDetails, body: TestBody<TestArgs & WorkerArgs>): void;
|
|
5512
5536
|
}
|
|
5513
5537
|
|
|
5538
|
+
/**
|
|
5539
|
+
* Aborts the currently running test by throwing an error. The test is immediately marked as failed and execution
|
|
5540
|
+
* stops. This is useful from inside a fixture or a route handler when you have detected an unrecoverable misuse and
|
|
5541
|
+
* want to fail the test right away.
|
|
5542
|
+
*
|
|
5543
|
+
* **Usage**
|
|
5544
|
+
*
|
|
5545
|
+
* ```js
|
|
5546
|
+
* import { test, expect } from '@playwright/test';
|
|
5547
|
+
*
|
|
5548
|
+
* test('does not publish to shared page', async ({ page }) => {
|
|
5549
|
+
* await page.route('**\/publish', route => {
|
|
5550
|
+
* test.abort('Tests must not publish to the shared page. Use the `clone` option.');
|
|
5551
|
+
* return route.abort();
|
|
5552
|
+
* });
|
|
5553
|
+
* // ...
|
|
5554
|
+
* });
|
|
5555
|
+
* ```
|
|
5556
|
+
*
|
|
5557
|
+
* @param message Optional message describing the reason for the abort. It will be included in the failure error.
|
|
5558
|
+
*/
|
|
5559
|
+
abort(message?: string): never;
|
|
5560
|
+
|
|
5514
5561
|
/**
|
|
5515
5562
|
* Marks a test as "slow". Slow test will be given triple the default timeout.
|
|
5516
5563
|
*
|
|
@@ -6895,6 +6942,7 @@ export interface PlaywrightWorkerOptions {
|
|
|
6895
6942
|
*
|
|
6896
6943
|
*/
|
|
6897
6944
|
resultScreenshots: boolean;
|
|
6945
|
+
pauseOnFailure: boolean;
|
|
6898
6946
|
/**
|
|
6899
6947
|
* Whether to record trace for each test. Defaults to `'off'`.
|
|
6900
6948
|
* - `'off'`: Do not record trace.
|
|
@@ -6904,6 +6952,7 @@ export interface PlaywrightWorkerOptions {
|
|
|
6904
6952
|
* - `'retain-on-failure'`: Record trace for each test. When test run passes, remove the recorded trace.
|
|
6905
6953
|
* - `'retain-on-first-failure'`: Record trace for the first run of each test, but not for retries. When test run
|
|
6906
6954
|
* passes, remove the recorded trace.
|
|
6955
|
+
* - `'retain-on-failure-and-retries'`: Record trace for each test run. Retains all traces when an attempt fails.
|
|
6907
6956
|
*
|
|
6908
6957
|
* For more control, pass an object that specifies `mode` and trace features to enable.
|
|
6909
6958
|
*
|
|
@@ -6935,6 +6984,10 @@ export interface PlaywrightWorkerOptions {
|
|
|
6935
6984
|
* down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual
|
|
6936
6985
|
* picture of each page will be scaled down if necessary to fit the specified size.
|
|
6937
6986
|
*
|
|
6987
|
+
* To annotate actions in the video, pass `show` with `action` and/or `test` sub-options. The `action` option controls
|
|
6988
|
+
* visual highlights on interacted elements with an optional `delay` in milliseconds (defaults to `500`). The `test`
|
|
6989
|
+
* option controls which test information is displayed as a status overlay.
|
|
6990
|
+
*
|
|
6938
6991
|
* **Usage**
|
|
6939
6992
|
*
|
|
6940
6993
|
* ```js
|
|
@@ -6950,13 +7003,12 @@ export interface PlaywrightWorkerOptions {
|
|
|
6950
7003
|
*
|
|
6951
7004
|
* Learn more about [recording video](https://playwright.dev/docs/test-use-options#recording-options).
|
|
6952
7005
|
*/
|
|
6953
|
-
video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize };
|
|
7006
|
+
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 }, test?: { level?: 'file' | 'title' | 'step', position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number } } };
|
|
6954
7007
|
}
|
|
6955
7008
|
|
|
6956
7009
|
export type ScreenshotMode = 'off' | 'on' | 'only-on-failure' | 'on-first-failure';
|
|
6957
|
-
export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure';
|
|
7010
|
+
export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure' | 'retain-on-failure-and-retries';
|
|
6958
7011
|
export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry';
|
|
6959
|
-
|
|
6960
7012
|
/**
|
|
6961
7013
|
* Playwright Test provides many options to configure test environment,
|
|
6962
7014
|
* [Browser](https://playwright.dev/docs/api/class-browser),
|
|
@@ -7715,6 +7767,9 @@ type CustomProperties<T> = ExcludeProps<T, PlaywrightTestOptions & PlaywrightWor
|
|
|
7715
7767
|
export type PlaywrightTestProject<TestArgs = {}, WorkerArgs = {}> = Project<PlaywrightTestOptions & CustomProperties<TestArgs>, PlaywrightWorkerOptions & CustomProperties<WorkerArgs>>;
|
|
7716
7768
|
export type PlaywrightTestConfig<TestArgs = {}, WorkerArgs = {}> = Config<PlaywrightTestOptions & CustomProperties<TestArgs>, PlaywrightWorkerOptions & CustomProperties<WorkerArgs>>;
|
|
7717
7769
|
|
|
7770
|
+
// Use the global URLPattern type if available (Node.js 22+, modern browsers),
|
|
7771
|
+
// otherwise fall back to `never` so it disappears from union types.
|
|
7772
|
+
type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;
|
|
7718
7773
|
type AsymmetricMatcher = Record<string, any>;
|
|
7719
7774
|
|
|
7720
7775
|
interface AsymmetricMatchers {
|
|
@@ -7902,7 +7957,11 @@ interface AsymmetricMatchers {
|
|
|
7902
7957
|
*/
|
|
7903
7958
|
interface GenericAssertions<R> {
|
|
7904
7959
|
/**
|
|
7905
|
-
* Makes the assertion check for the opposite condition.
|
|
7960
|
+
* Makes the assertion check for the opposite condition.
|
|
7961
|
+
*
|
|
7962
|
+
* **Usage**
|
|
7963
|
+
*
|
|
7964
|
+
* For example, the following code passes:
|
|
7906
7965
|
*
|
|
7907
7966
|
* ```js
|
|
7908
7967
|
* const value = 1;
|
|
@@ -7911,6 +7970,34 @@ interface GenericAssertions<R> {
|
|
|
7911
7970
|
*
|
|
7912
7971
|
*/
|
|
7913
7972
|
not: GenericAssertions<R>;
|
|
7973
|
+
/**
|
|
7974
|
+
* Use `resolves` to unwrap the value of a fulfilled promise so any other matcher can be chained. If the promise is
|
|
7975
|
+
* rejected the assertion fails.
|
|
7976
|
+
*
|
|
7977
|
+
* For example, this code tests that the promise resolves and that the resulting value is `'lemon'`:
|
|
7978
|
+
*
|
|
7979
|
+
* ```js
|
|
7980
|
+
* test('resolves to lemon', async () => {
|
|
7981
|
+
* await expect(Promise.resolve('lemon')).resolves.toBe('lemon');
|
|
7982
|
+
* });
|
|
7983
|
+
* ```
|
|
7984
|
+
*
|
|
7985
|
+
*/
|
|
7986
|
+
resolves: GenericAssertions<R>;
|
|
7987
|
+
/**
|
|
7988
|
+
* Use `.rejects` to unwrap the reason of a rejected promise so any other matcher can be chained. If the promise is
|
|
7989
|
+
* fulfilled the assertion fails.
|
|
7990
|
+
*
|
|
7991
|
+
* For example, this code tests that the promise rejects with reason `'octopus'`:
|
|
7992
|
+
*
|
|
7993
|
+
* ```js
|
|
7994
|
+
* test('rejects to octopus', async () => {
|
|
7995
|
+
* await expect(Promise.reject(new Error('octopus'))).rejects.toThrow('octopus');
|
|
7996
|
+
* });
|
|
7997
|
+
* ```
|
|
7998
|
+
*
|
|
7999
|
+
*/
|
|
8000
|
+
rejects: GenericAssertions<R>;
|
|
7914
8001
|
/**
|
|
7915
8002
|
* Compares value with
|
|
7916
8003
|
* [`expected`](https://playwright.dev/docs/api/class-genericassertions#generic-assertions-to-be-option-expected) by
|
|
@@ -8564,8 +8651,11 @@ interface APIResponseAssertions {
|
|
|
8564
8651
|
toBeOK(): Promise<void>;
|
|
8565
8652
|
|
|
8566
8653
|
/**
|
|
8567
|
-
* Makes the assertion check for the opposite condition.
|
|
8568
|
-
*
|
|
8654
|
+
* Makes the assertion check for the opposite condition.
|
|
8655
|
+
*
|
|
8656
|
+
* **Usage**
|
|
8657
|
+
*
|
|
8658
|
+
* For example, this code tests that the response status is not successful:
|
|
8569
8659
|
*
|
|
8570
8660
|
* ```js
|
|
8571
8661
|
* await expect(response).not.toBeOK();
|
|
@@ -9160,6 +9250,11 @@ interface LocatorAssertions {
|
|
|
9160
9250
|
* @param options
|
|
9161
9251
|
*/
|
|
9162
9252
|
toHaveCSS(name: string, value: string|RegExp, options?: {
|
|
9253
|
+
/**
|
|
9254
|
+
* Pseudo-element to read computed styles from.
|
|
9255
|
+
*/
|
|
9256
|
+
pseudo?: "before"|"after";
|
|
9257
|
+
|
|
9163
9258
|
/**
|
|
9164
9259
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9165
9260
|
*/
|
|
@@ -9596,8 +9691,11 @@ interface LocatorAssertions {
|
|
|
9596
9691
|
}): Promise<void>;
|
|
9597
9692
|
|
|
9598
9693
|
/**
|
|
9599
|
-
* Makes the assertion check for the opposite condition.
|
|
9600
|
-
*
|
|
9694
|
+
* Makes the assertion check for the opposite condition.
|
|
9695
|
+
*
|
|
9696
|
+
* **Usage**
|
|
9697
|
+
*
|
|
9698
|
+
* For example, this code tests that the Locator doesn't contain text `"error"`:
|
|
9601
9699
|
*
|
|
9602
9700
|
* ```js
|
|
9603
9701
|
* await expect(locator).not.toContainText('error');
|
|
@@ -9685,6 +9783,9 @@ interface PageAssertions {
|
|
|
9685
9783
|
* // Check for the page URL to contain 'doc', followed by an optional 's', followed by '/'
|
|
9686
9784
|
* await expect(page).toHaveURL(/docs?\//);
|
|
9687
9785
|
*
|
|
9786
|
+
* // Check for the page URL to match the URL pattern
|
|
9787
|
+
* await expect(page).toHaveURL(new URLPattern({ pathname: '/docs/*' }));
|
|
9788
|
+
*
|
|
9688
9789
|
* // Check for the predicate to be satisfied
|
|
9689
9790
|
* // For example: verify query strings
|
|
9690
9791
|
* await expect(page).toHaveURL(url => {
|
|
@@ -9700,7 +9801,7 @@ interface PageAssertions {
|
|
|
9700
9801
|
* against the current browser URL.
|
|
9701
9802
|
* @param options
|
|
9702
9803
|
*/
|
|
9703
|
-
toHaveURL(url: string|RegExp|((url: URL) => boolean), options?: {
|
|
9804
|
+
toHaveURL(url: string|RegExp|URLPattern|((url: URL) => boolean), options?: {
|
|
9704
9805
|
/**
|
|
9705
9806
|
* Whether to perform case-insensitive match.
|
|
9706
9807
|
* [`ignoreCase`](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-url-option-ignore-case)
|
|
@@ -9716,8 +9817,62 @@ interface PageAssertions {
|
|
|
9716
9817
|
}): Promise<void>;
|
|
9717
9818
|
|
|
9718
9819
|
/**
|
|
9719
|
-
*
|
|
9720
|
-
*
|
|
9820
|
+
* Asserts that the page body matches the given [accessibility snapshot](https://playwright.dev/docs/aria-snapshots).
|
|
9821
|
+
*
|
|
9822
|
+
* **Usage**
|
|
9823
|
+
*
|
|
9824
|
+
* ```js
|
|
9825
|
+
* await page.goto('https://demo.playwright.dev/todomvc/');
|
|
9826
|
+
* await expect(page).toMatchAriaSnapshot(`
|
|
9827
|
+
* - heading "todos"
|
|
9828
|
+
* - textbox "What needs to be done?"
|
|
9829
|
+
* `);
|
|
9830
|
+
* ```
|
|
9831
|
+
*
|
|
9832
|
+
* @param expected
|
|
9833
|
+
* @param options
|
|
9834
|
+
*/
|
|
9835
|
+
toMatchAriaSnapshot(expected: string, options?: {
|
|
9836
|
+
/**
|
|
9837
|
+
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9838
|
+
*/
|
|
9839
|
+
timeout?: number;
|
|
9840
|
+
}): Promise<void>;
|
|
9841
|
+
|
|
9842
|
+
/**
|
|
9843
|
+
* Asserts that the page body matches the given [accessibility snapshot](https://playwright.dev/docs/aria-snapshots).
|
|
9844
|
+
*
|
|
9845
|
+
* Snapshot is stored in a separate `.aria.yml` file in a location configured by
|
|
9846
|
+
* `expect.toMatchAriaSnapshot.pathTemplate` and/or `snapshotPathTemplate` properties in the configuration file.
|
|
9847
|
+
*
|
|
9848
|
+
* **Usage**
|
|
9849
|
+
*
|
|
9850
|
+
* ```js
|
|
9851
|
+
* await expect(page).toMatchAriaSnapshot();
|
|
9852
|
+
* await expect(page).toMatchAriaSnapshot({ name: 'home.aria.yml' });
|
|
9853
|
+
* ```
|
|
9854
|
+
*
|
|
9855
|
+
* @param options
|
|
9856
|
+
*/
|
|
9857
|
+
toMatchAriaSnapshot(options?: {
|
|
9858
|
+
/**
|
|
9859
|
+
* Name of the snapshot to store in the snapshot folder corresponding to this test. Generates sequential names if not
|
|
9860
|
+
* specified.
|
|
9861
|
+
*/
|
|
9862
|
+
name?: string;
|
|
9863
|
+
|
|
9864
|
+
/**
|
|
9865
|
+
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9866
|
+
*/
|
|
9867
|
+
timeout?: number;
|
|
9868
|
+
}): Promise<void>;
|
|
9869
|
+
|
|
9870
|
+
/**
|
|
9871
|
+
* Makes the assertion check for the opposite condition.
|
|
9872
|
+
*
|
|
9873
|
+
* **Usage**
|
|
9874
|
+
*
|
|
9875
|
+
* For example, this code tests that the page URL doesn't contain `"error"`:
|
|
9721
9876
|
*
|
|
9722
9877
|
* ```js
|
|
9723
9878
|
* await expect(page).not.toHaveURL('error');
|
|
@@ -9879,6 +10034,12 @@ export interface TestInfoError {
|
|
|
9879
10034
|
*/
|
|
9880
10035
|
cause?: TestInfoError;
|
|
9881
10036
|
|
|
10037
|
+
/**
|
|
10038
|
+
* Additional context for the error, such as the aria snapshot of the receiver at the time of an `expect(...)` matcher
|
|
10039
|
+
* failure.
|
|
10040
|
+
*/
|
|
10041
|
+
errorContext?: string;
|
|
10042
|
+
|
|
9882
10043
|
/**
|
|
9883
10044
|
* Error message. Set when [Error] (or its subclass) has been thrown.
|
|
9884
10045
|
*/
|
package/types/testReporter.d.ts
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject, Location } from './test';
|
|
19
|
-
export type { FullConfig, FullProject, TestStatus, Location } from './test';
|
|
18
|
+
import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject, Location, WorkerInfo } from './test';
|
|
19
|
+
export type { FullConfig, FullProject, TestStatus, Location, WorkerInfo } from './test';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Result of the full test run.
|
|
@@ -119,8 +119,8 @@ export interface FullResult {
|
|
|
119
119
|
* [reporter.onStdOut(chunk, test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-std-out) and
|
|
120
120
|
* [reporter.onStdErr(chunk, test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-std-err) are
|
|
121
121
|
* called when standard output is produced in the worker process, possibly during a test execution, and
|
|
122
|
-
* [reporter.onError(error)](https://playwright.dev/docs/api/class-reporter#reporter-on-error) is called
|
|
123
|
-
* something went wrong outside of the test execution.
|
|
122
|
+
* [reporter.onError(error[, workerInfo])](https://playwright.dev/docs/api/class-reporter#reporter-on-error) is called
|
|
123
|
+
* when something went wrong outside of the test execution.
|
|
124
124
|
*
|
|
125
125
|
* If your custom reporter does not print anything to the terminal, implement
|
|
126
126
|
* [reporter.printsToStdio()](https://playwright.dev/docs/api/class-reporter#reporter-prints-to-stdio) and return
|
|
@@ -169,8 +169,10 @@ export interface Reporter {
|
|
|
169
169
|
/**
|
|
170
170
|
* Called on some global error, for example unhandled exception in the worker process.
|
|
171
171
|
* @param error The error.
|
|
172
|
+
* @param workerInfo Contains information about the worker that produced this error. `undefined` for errors that are not associated with
|
|
173
|
+
* a specific worker.
|
|
172
174
|
*/
|
|
173
|
-
onError?(error: TestError): void;
|
|
175
|
+
onError?(error: TestError, workerInfo?: WorkerInfo): void;
|
|
174
176
|
|
|
175
177
|
/**
|
|
176
178
|
* Called immediately before test runner exists. At this point all the reporters have received the
|