playwright 1.62.1 → 1.65.0
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/README.md +4 -4
- package/lib/agents/playwright-test-generator.agent.md +1 -1
- package/lib/cli/testActions.js +9 -6
- package/lib/common/index.js +207 -148
- package/lib/common/index.js.txt +13 -14
- package/lib/index.js +51 -30
- package/lib/matchers/expect.js +117 -81
- package/lib/matchers/expect.js.LICENSE +3 -3
- package/lib/matchers/expect.js.txt +8 -8
- package/lib/mcp/test/browserBackend.js +12 -2
- package/lib/mcp/test/testContext.js +2 -8
- package/lib/program.js +4 -4
- package/lib/runner/index.js +1151 -572
- package/lib/runner/index.js.txt +32 -29
- package/lib/transform/babelBundle.js +1217 -982
- package/lib/transform/babelBundle.js.LICENSE +15 -15
- package/lib/transform/babelBundle.js.txt +14 -11
- package/lib/transform/esmLoader.js +375 -187
- package/lib/transform/esmLoader.js.LICENSE +3 -3
- package/lib/transform/esmLoader.js.txt +9 -8
- package/lib/worker/workerProcessEntry.js +43 -41
- package/lib/worker/workerProcessEntry.js.txt +4 -4
- package/package.json +2 -10
- package/types/test.d.ts +755 -88
- package/types/testReporter.d.ts +74 -3
- package/jsx-runtime.js +0 -42
- package/jsx-runtime.mjs +0 -21
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🎭 Playwright
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[](https://webkit.org/)<!-- GEN:stop --> [](https://aka.ms/playwright/discord)
|
|
4
4
|
|
|
5
5
|
## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright)
|
|
6
6
|
|
|
@@ -296,9 +296,9 @@ The [Playwright VS Code extension](https://marketplace.visualstudio.com/items?it
|
|
|
296
296
|
|
|
297
297
|
| | Linux | macOS | Windows |
|
|
298
298
|
| :--- | :---: | :---: | :---: |
|
|
299
|
-
| Chromium<sup>1</sup> <!-- GEN:chromium-version -->
|
|
300
|
-
| WebKit <!-- GEN:webkit-version -->
|
|
301
|
-
| Firefox <!-- GEN:firefox-version -->
|
|
299
|
+
| Chromium<sup>1</sup> <!-- GEN:chromium-version -->158.0.8127.18<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
300
|
+
| WebKit <!-- GEN:webkit-version -->27.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
301
|
+
| Firefox <!-- GEN:firefox-version -->159.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
302
302
|
|
|
303
303
|
Headless and headed execution on all platforms. <sup>1</sup> Uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing) by default.
|
|
304
304
|
|
|
@@ -68,7 +68,7 @@ application behavior.
|
|
|
68
68
|
// seed: tests/seed.spec.ts
|
|
69
69
|
|
|
70
70
|
test.describe('Adding New Todos', () => {
|
|
71
|
-
test('Add Valid Todo', async { page } => {
|
|
71
|
+
test('Add Valid Todo', async ({ page }) => {
|
|
72
72
|
// 1. Click in the "What needs to be done?" input field
|
|
73
73
|
await page.click(...);
|
|
74
74
|
|
package/lib/cli/testActions.js
CHANGED
|
@@ -38,9 +38,7 @@ var import_path = __toESM(require("path"));
|
|
|
38
38
|
var import_common = require("../common");
|
|
39
39
|
var import_runner = require("../runner");
|
|
40
40
|
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
|
|
41
|
-
const { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundle").utils;
|
|
42
41
|
async function runTests(args, opts) {
|
|
43
|
-
await startProfiling();
|
|
44
42
|
const cliOverrides = overridesFromOptions(opts);
|
|
45
43
|
cliOverrides.argv = process.argv;
|
|
46
44
|
const config = await import_common.configLoader.loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);
|
|
@@ -71,7 +69,6 @@ async function runTests(args, opts) {
|
|
|
71
69
|
project: opts.project || void 0,
|
|
72
70
|
reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : void 0
|
|
73
71
|
});
|
|
74
|
-
await stopProfiling("runner");
|
|
75
72
|
const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
|
|
76
73
|
gracefullyProcessExitDoNotHang(exitCode2);
|
|
77
74
|
return;
|
|
@@ -87,13 +84,11 @@ async function runTests(args, opts) {
|
|
|
87
84
|
grep: opts.grep
|
|
88
85
|
}
|
|
89
86
|
);
|
|
90
|
-
await stopProfiling("runner");
|
|
91
87
|
const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
|
|
92
88
|
gracefullyProcessExitDoNotHang(exitCode2);
|
|
93
89
|
return;
|
|
94
90
|
}
|
|
95
91
|
const status = await import_runner.testRunner.runAllTestsWithConfig(config, options);
|
|
96
|
-
await stopProfiling("runner");
|
|
97
92
|
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
|
|
98
93
|
gracefullyProcessExitDoNotHang(exitCode);
|
|
99
94
|
}
|
|
@@ -123,12 +118,13 @@ function overridesFromOptions(options) {
|
|
|
123
118
|
globalTimeout: options.globalTimeout ? parseInt(options.globalTimeout, 10) : void 0,
|
|
124
119
|
maxFailures: options.x ? 1 : options.maxFailures ? parseInt(options.maxFailures, 10) : void 0,
|
|
125
120
|
outputDir: options.output ? import_path.default.resolve(process.cwd(), options.output) : void 0,
|
|
126
|
-
pause: !!process.env.PWPAUSE,
|
|
127
121
|
quiet: options.quiet ? options.quiet : void 0,
|
|
128
122
|
repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : void 0,
|
|
129
123
|
retries: options.retries ? parseInt(options.retries, 10) : void 0,
|
|
130
124
|
reporter: resolveReporterOption(options.reporter),
|
|
125
|
+
additionalReporters: resolveReporterOption(options.addReporter),
|
|
131
126
|
shard: resolveShardOption(options.shard),
|
|
127
|
+
shuffle: resolveShuffleOption(options.shuffle),
|
|
132
128
|
timeout: options.timeout ? parseInt(options.timeout, 10) : void 0,
|
|
133
129
|
tsconfig: options.tsconfig ? import_path.default.resolve(process.cwd(), options.tsconfig) : void 0,
|
|
134
130
|
ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : void 0,
|
|
@@ -166,6 +162,13 @@ function resolveReporterOption(reporter) {
|
|
|
166
162
|
return void 0;
|
|
167
163
|
return reporter.split(",").map((r) => [resolveReporter(r)]);
|
|
168
164
|
}
|
|
165
|
+
function resolveShuffleOption(shuffle) {
|
|
166
|
+
if (!shuffle)
|
|
167
|
+
return void 0;
|
|
168
|
+
if (shuffle === true)
|
|
169
|
+
return String(Math.floor(Math.random() * 1e9));
|
|
170
|
+
return shuffle;
|
|
171
|
+
}
|
|
169
172
|
function resolveShardOption(shard) {
|
|
170
173
|
if (!shard)
|
|
171
174
|
return void 0;
|