playwright 1.54.1 → 1.56.1

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.
Files changed (116) hide show
  1. package/README.md +3 -3
  2. package/ThirdPartyNotices.txt +2727 -434
  3. package/lib/agents/generateAgents.js +263 -0
  4. package/lib/agents/generator.md +102 -0
  5. package/lib/agents/healer.md +78 -0
  6. package/lib/agents/planner.md +135 -0
  7. package/lib/common/config.js +3 -1
  8. package/lib/common/configLoader.js +2 -1
  9. package/lib/common/expectBundle.js +3 -0
  10. package/lib/common/expectBundleImpl.js +51 -51
  11. package/lib/common/fixtures.js +1 -1
  12. package/lib/common/suiteUtils.js +0 -9
  13. package/lib/index.js +127 -115
  14. package/lib/isomorphic/testTree.js +35 -8
  15. package/lib/matchers/expect.js +6 -7
  16. package/lib/matchers/matcherHint.js +43 -15
  17. package/lib/matchers/matchers.js +10 -4
  18. package/lib/matchers/toBeTruthy.js +16 -14
  19. package/lib/matchers/toEqual.js +18 -13
  20. package/lib/matchers/toHaveURL.js +12 -27
  21. package/lib/matchers/toMatchAriaSnapshot.js +26 -31
  22. package/lib/matchers/toMatchSnapshot.js +15 -12
  23. package/lib/matchers/toMatchText.js +29 -35
  24. package/lib/mcp/browser/actions.d.js +16 -0
  25. package/lib/mcp/browser/browserContextFactory.js +296 -0
  26. package/lib/mcp/browser/browserServerBackend.js +76 -0
  27. package/lib/mcp/browser/codegen.js +66 -0
  28. package/lib/mcp/browser/config.js +383 -0
  29. package/lib/mcp/browser/context.js +284 -0
  30. package/lib/mcp/browser/response.js +228 -0
  31. package/lib/mcp/browser/sessionLog.js +160 -0
  32. package/lib/mcp/browser/tab.js +277 -0
  33. package/lib/mcp/browser/tools/common.js +63 -0
  34. package/lib/mcp/browser/tools/console.js +44 -0
  35. package/lib/mcp/browser/tools/dialogs.js +60 -0
  36. package/lib/mcp/browser/tools/evaluate.js +70 -0
  37. package/lib/mcp/browser/tools/files.js +58 -0
  38. package/lib/mcp/browser/tools/form.js +74 -0
  39. package/lib/mcp/browser/tools/install.js +69 -0
  40. package/lib/mcp/browser/tools/keyboard.js +85 -0
  41. package/lib/mcp/browser/tools/mouse.js +107 -0
  42. package/lib/mcp/browser/tools/navigate.js +62 -0
  43. package/lib/mcp/browser/tools/network.js +54 -0
  44. package/lib/mcp/browser/tools/pdf.js +59 -0
  45. package/lib/mcp/browser/tools/screenshot.js +88 -0
  46. package/lib/mcp/browser/tools/snapshot.js +182 -0
  47. package/lib/mcp/browser/tools/tabs.js +67 -0
  48. package/lib/mcp/browser/tools/tool.js +49 -0
  49. package/lib/mcp/browser/tools/tracing.js +74 -0
  50. package/lib/mcp/browser/tools/utils.js +100 -0
  51. package/lib/mcp/browser/tools/verify.js +154 -0
  52. package/lib/mcp/browser/tools/wait.js +63 -0
  53. package/lib/mcp/browser/tools.js +80 -0
  54. package/lib/mcp/browser/watchdog.js +44 -0
  55. package/lib/mcp/config.d.js +16 -0
  56. package/lib/mcp/extension/cdpRelay.js +351 -0
  57. package/lib/mcp/extension/extensionContextFactory.js +75 -0
  58. package/lib/mcp/extension/protocol.js +28 -0
  59. package/lib/mcp/index.js +61 -0
  60. package/lib/mcp/log.js +35 -0
  61. package/lib/mcp/program.js +96 -0
  62. package/lib/mcp/sdk/bundle.js +81 -0
  63. package/lib/mcp/sdk/exports.js +32 -0
  64. package/lib/mcp/sdk/http.js +180 -0
  65. package/lib/mcp/sdk/inProcessTransport.js +71 -0
  66. package/lib/mcp/sdk/mdb.js +208 -0
  67. package/lib/mcp/sdk/proxyBackend.js +128 -0
  68. package/lib/mcp/sdk/server.js +190 -0
  69. package/lib/mcp/sdk/tool.js +51 -0
  70. package/lib/mcp/test/browserBackend.js +98 -0
  71. package/lib/mcp/test/generatorTools.js +122 -0
  72. package/lib/mcp/test/plannerTools.js +46 -0
  73. package/lib/mcp/test/seed.js +72 -0
  74. package/lib/mcp/test/streams.js +39 -0
  75. package/lib/mcp/test/testBackend.js +97 -0
  76. package/lib/mcp/test/testContext.js +176 -0
  77. package/lib/mcp/test/testTool.js +30 -0
  78. package/lib/mcp/test/testTools.js +115 -0
  79. package/lib/mcpBundleImpl.js +41 -0
  80. package/lib/plugins/webServerPlugin.js +2 -0
  81. package/lib/program.js +77 -57
  82. package/lib/reporters/base.js +34 -29
  83. package/lib/reporters/dot.js +11 -11
  84. package/lib/reporters/github.js +2 -1
  85. package/lib/reporters/html.js +58 -41
  86. package/lib/reporters/internalReporter.js +2 -1
  87. package/lib/reporters/line.js +15 -15
  88. package/lib/reporters/list.js +24 -19
  89. package/lib/reporters/listModeReporter.js +69 -0
  90. package/lib/reporters/markdown.js +3 -3
  91. package/lib/reporters/merge.js +3 -1
  92. package/lib/reporters/teleEmitter.js +3 -1
  93. package/lib/runner/dispatcher.js +9 -2
  94. package/lib/runner/failureTracker.js +12 -2
  95. package/lib/runner/lastRun.js +7 -4
  96. package/lib/runner/loadUtils.js +46 -12
  97. package/lib/runner/projectUtils.js +8 -2
  98. package/lib/runner/reporters.js +7 -32
  99. package/lib/runner/tasks.js +20 -10
  100. package/lib/runner/testRunner.js +390 -0
  101. package/lib/runner/testServer.js +57 -276
  102. package/lib/runner/watchMode.js +5 -1
  103. package/lib/runner/workerHost.js +8 -6
  104. package/lib/transform/babelBundleImpl.js +179 -195
  105. package/lib/transform/compilationCache.js +22 -5
  106. package/lib/transform/transform.js +1 -1
  107. package/lib/util.js +12 -35
  108. package/lib/utilsBundleImpl.js +1 -1
  109. package/lib/worker/fixtureRunner.js +7 -2
  110. package/lib/worker/testInfo.js +76 -45
  111. package/lib/worker/testTracing.js +8 -7
  112. package/lib/worker/workerMain.js +12 -3
  113. package/package.json +10 -2
  114. package/types/test.d.ts +63 -44
  115. package/types/testReporter.d.ts +1 -1
  116. package/lib/runner/runner.js +0 -110
@@ -43,6 +43,9 @@ class WorkerMain extends import_process.ProcessRunner {
43
43
  this._fatalErrors = [];
44
44
  // The stage of the full cleanup. Once "finished", we can safely stop running anything.
45
45
  this._didRunFullCleanup = false;
46
+ // Whether the worker was stopped due to an unhandled error in a test marked with test.fail().
47
+ // This should force dispatcher to use a new worker instead.
48
+ this._stoppedDueToUnhandledErrorInTestFail = false;
46
49
  // Whether the worker was requested to stop.
47
50
  this._isStopped = false;
48
51
  // This promise resolves once the single "run test group" call finishes.
@@ -154,8 +157,10 @@ class WorkerMain extends import_process.ProcessRunner {
154
157
  }
155
158
  const isExpectError = error instanceof Error && !!error.matcherResult;
156
159
  const shouldContinueInThisWorker = this._currentTest.expectedStatus === "failed" && isExpectError;
157
- if (!shouldContinueInThisWorker)
160
+ if (!shouldContinueInThisWorker) {
161
+ this._stoppedDueToUnhandledErrorInTestFail = true;
158
162
  void this._stop();
163
+ }
159
164
  }
160
165
  async _loadIfNeeded() {
161
166
  if (this._config)
@@ -204,7 +209,8 @@ class WorkerMain extends import_process.ProcessRunner {
204
209
  const donePayload = {
205
210
  fatalErrors: this._fatalErrors,
206
211
  skipTestsDueToSetupFailure: [],
207
- fatalUnknownTestIds
212
+ fatalUnknownTestIds,
213
+ stoppedDueToUnhandledErrorInTestFail: this._stoppedDueToUnhandledErrorInTestFail
208
214
  };
209
215
  for (const test of this._skipRemainingTestsInSuite?.allTests() || []) {
210
216
  if (entries.has(test.id))
@@ -312,7 +318,10 @@ class WorkerMain extends import_process.ProcessRunner {
312
318
  await testInfo._runAsStep({ title: "After Hooks", category: "hook" }, async () => {
313
319
  let firstAfterHooksError;
314
320
  try {
315
- await testInfo._runWithTimeout({ type: "test", slot: afterHooksSlot }, async () => testInfo._onDidFinishTestFunction?.());
321
+ await testInfo._runWithTimeout({ type: "test", slot: afterHooksSlot }, async () => {
322
+ for (const fn of testInfo._onDidFinishTestFunctions)
323
+ await fn();
324
+ });
316
325
  } catch (error) {
317
326
  firstAfterHooksError = firstAfterHooksError ?? error;
318
327
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright",
3
- "version": "1.54.1",
3
+ "version": "1.56.1",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,13 +21,21 @@
21
21
  "./package.json": "./package.json",
22
22
  "./lib/common/configLoader": "./lib/common/configLoader.js",
23
23
  "./lib/fsWatcher": "./lib/fsWatcher.js",
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",
24
29
  "./lib/program": "./lib/program.js",
30
+ "./lib/reporters/base": "./lib/reporters/base.js",
31
+ "./lib/reporters/list": "./lib/reporters/list.js",
25
32
  "./lib/transform/babelBundle": "./lib/transform/babelBundle.js",
26
33
  "./lib/transform/compilationCache": "./lib/transform/compilationCache.js",
27
34
  "./lib/transform/esmLoader": "./lib/transform/esmLoader.js",
28
35
  "./lib/transform/transform": "./lib/transform/transform.js",
29
36
  "./lib/internalsForTest": "./lib/internalsForTest.js",
30
37
  "./lib/plugins": "./lib/plugins/index.js",
38
+ "./lib/runner/testRunner": "./lib/runner/testRunner.js",
31
39
  "./jsx-runtime": {
32
40
  "import": "./jsx-runtime.mjs",
33
41
  "require": "./jsx-runtime.js",
@@ -56,7 +64,7 @@
56
64
  },
57
65
  "license": "Apache-2.0",
58
66
  "dependencies": {
59
- "playwright-core": "1.54.1"
67
+ "playwright-core": "1.56.1"
60
68
  },
61
69
  "optionalDependencies": {
62
70
  "fsevents": "2.3.2"
package/types/test.d.ts CHANGED
@@ -22,7 +22,16 @@ export type BlobReporterOptions = { outputDir?: string, fileName?: string };
22
22
  export type ListReporterOptions = { printSteps?: boolean };
23
23
  export type JUnitReporterOptions = { outputFile?: string, stripANSIControlSequences?: boolean, includeProjectInTestName?: boolean };
24
24
  export type JsonReporterOptions = { outputFile?: string };
25
- export type HtmlReporterOptions = { outputFolder?: string, open?: 'always' | 'never' | 'on-failure', host?: string, port?: number, attachmentsBaseURL?: string, title?: string, noSnippets?: boolean };
25
+ export type HtmlReporterOptions = {
26
+ outputFolder?: string;
27
+ open?: 'always' | 'never' | 'on-failure';
28
+ host?: string;
29
+ port?: number;
30
+ attachmentsBaseURL?: string;
31
+ title?: string;
32
+ noSnippets?: boolean;
33
+ noCopyPrompt?: boolean;
34
+ };
26
35
 
27
36
  export type ReporterDescription = Readonly<
28
37
  ['blob'] | ['blob', BlobReporterOptions] |
@@ -305,7 +314,7 @@ interface TestProject<TestArgs = {}, WorkerArgs = {}> {
305
314
  grep?: RegExp|Array<RegExp>;
306
315
 
307
316
  /**
308
- * Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of
317
+ * Filter to only run tests with a title **not** matching any of the patterns. This is the opposite of
309
318
  * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally
310
319
  * and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
311
320
  *
@@ -1388,8 +1397,8 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
1388
1397
  maxFailures?: number;
1389
1398
 
1390
1399
  /**
1391
- * Metadata contains key-value pairs to be included in the report. For example, HTML report will display it as
1392
- * key-value pairs, and JSON report will include metadata serialized as json.
1400
+ * Metadata contains key-value pairs to be included in the report. For example, the JSON report will include metadata
1401
+ * serialized as JSON.
1393
1402
  *
1394
1403
  * **Usage**
1395
1404
  *
@@ -1852,7 +1861,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
1852
1861
  * Whether to update expected snapshots with the actual results produced by the test run. Defaults to `'missing'`.
1853
1862
  * - `'all'` - All tests that are executed will update snapshots.
1854
1863
  * - `'changed'` - All tests that are executed will update snapshots that did not match. Matching snapshots will not
1855
- * be updated.
1864
+ * be updated. Also creates missing snapshots.
1856
1865
  * - `'missing'` - Missing snapshots are created, for example when authoring a new test and running it for the first
1857
1866
  * time. This is the default.
1858
1867
  * - `'none'` - No snapshots are updated.
@@ -4186,7 +4195,7 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4186
4195
  * });
4187
4196
  * ```
4188
4197
  *
4189
- * You can also call `test.skip()` without arguments inside the test body to always mark the test as failed. We
4198
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
4190
4199
  * recommend using `test.skip(title, body)` instead.
4191
4200
  *
4192
4201
  * ```js
@@ -4203,9 +4212,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4203
4212
  * description.
4204
4213
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4205
4214
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4206
- * @param condition Test is marked as "should fail" when the condition is `true`.
4207
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4208
- * "should fail" when the return value is `true`.
4215
+ * @param condition Test is marked as "skipped" when the condition is `true`.
4216
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
4217
+ * when the return value is `true`.
4209
4218
  * @param description Optional description that will be reflected in a test report.
4210
4219
  */
4211
4220
  skip(title: string, body: TestBody<TestArgs & WorkerArgs>): void;
@@ -4267,7 +4276,7 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4267
4276
  * });
4268
4277
  * ```
4269
4278
  *
4270
- * You can also call `test.skip()` without arguments inside the test body to always mark the test as failed. We
4279
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
4271
4280
  * recommend using `test.skip(title, body)` instead.
4272
4281
  *
4273
4282
  * ```js
@@ -4284,9 +4293,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4284
4293
  * description.
4285
4294
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4286
4295
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4287
- * @param condition Test is marked as "should fail" when the condition is `true`.
4288
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4289
- * "should fail" when the return value is `true`.
4296
+ * @param condition Test is marked as "skipped" when the condition is `true`.
4297
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
4298
+ * when the return value is `true`.
4290
4299
  * @param description Optional description that will be reflected in a test report.
4291
4300
  */
4292
4301
  skip(title: string, details: TestDetails, body: TestBody<TestArgs & WorkerArgs>): void;
@@ -4348,7 +4357,7 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4348
4357
  * });
4349
4358
  * ```
4350
4359
  *
4351
- * You can also call `test.skip()` without arguments inside the test body to always mark the test as failed. We
4360
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
4352
4361
  * recommend using `test.skip(title, body)` instead.
4353
4362
  *
4354
4363
  * ```js
@@ -4365,9 +4374,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4365
4374
  * description.
4366
4375
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4367
4376
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4368
- * @param condition Test is marked as "should fail" when the condition is `true`.
4369
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4370
- * "should fail" when the return value is `true`.
4377
+ * @param condition Test is marked as "skipped" when the condition is `true`.
4378
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
4379
+ * when the return value is `true`.
4371
4380
  * @param description Optional description that will be reflected in a test report.
4372
4381
  */
4373
4382
  skip(): void;
@@ -4429,7 +4438,7 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4429
4438
  * });
4430
4439
  * ```
4431
4440
  *
4432
- * You can also call `test.skip()` without arguments inside the test body to always mark the test as failed. We
4441
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
4433
4442
  * recommend using `test.skip(title, body)` instead.
4434
4443
  *
4435
4444
  * ```js
@@ -4446,9 +4455,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4446
4455
  * description.
4447
4456
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4448
4457
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4449
- * @param condition Test is marked as "should fail" when the condition is `true`.
4450
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4451
- * "should fail" when the return value is `true`.
4458
+ * @param condition Test is marked as "skipped" when the condition is `true`.
4459
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
4460
+ * when the return value is `true`.
4452
4461
  * @param description Optional description that will be reflected in a test report.
4453
4462
  */
4454
4463
  skip(condition: boolean, description?: string): void;
@@ -4510,7 +4519,7 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4510
4519
  * });
4511
4520
  * ```
4512
4521
  *
4513
- * You can also call `test.skip()` without arguments inside the test body to always mark the test as failed. We
4522
+ * You can also call `test.skip()` without arguments inside the test body to always skip the test. However, we
4514
4523
  * recommend using `test.skip(title, body)` instead.
4515
4524
  *
4516
4525
  * ```js
@@ -4527,9 +4536,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4527
4536
  * description.
4528
4537
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4529
4538
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4530
- * @param condition Test is marked as "should fail" when the condition is `true`.
4531
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4532
- * "should fail" when the return value is `true`.
4539
+ * @param condition Test is marked as "skipped" when the condition is `true`.
4540
+ * @param callback A function that returns whether to mark as "skipped", based on test fixtures. Test or tests are marked as "skipped"
4541
+ * when the return value is `true`.
4533
4542
  * @param description Optional description that will be reflected in a test report.
4534
4543
  */
4535
4544
  skip(callback: ConditionBody<TestArgs & WorkerArgs>, description?: string): void;
@@ -4606,9 +4615,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4606
4615
  * description.
4607
4616
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4608
4617
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4609
- * @param condition Test is marked as "should fail" when the condition is `true`.
4610
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4611
- * "should fail" when the return value is `true`.
4618
+ * @param condition Test is marked as "fixme" when the condition is `true`.
4619
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
4620
+ * when the return value is `true`.
4612
4621
  * @param description Optional description that will be reflected in a test report.
4613
4622
  */
4614
4623
  fixme(title: string, body: TestBody<TestArgs & WorkerArgs>): void;
@@ -4684,9 +4693,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4684
4693
  * description.
4685
4694
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4686
4695
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4687
- * @param condition Test is marked as "should fail" when the condition is `true`.
4688
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4689
- * "should fail" when the return value is `true`.
4696
+ * @param condition Test is marked as "fixme" when the condition is `true`.
4697
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
4698
+ * when the return value is `true`.
4690
4699
  * @param description Optional description that will be reflected in a test report.
4691
4700
  */
4692
4701
  fixme(title: string, details: TestDetails, body: TestBody<TestArgs & WorkerArgs>): void;
@@ -4762,9 +4771,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4762
4771
  * description.
4763
4772
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4764
4773
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4765
- * @param condition Test is marked as "should fail" when the condition is `true`.
4766
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4767
- * "should fail" when the return value is `true`.
4774
+ * @param condition Test is marked as "fixme" when the condition is `true`.
4775
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
4776
+ * when the return value is `true`.
4768
4777
  * @param description Optional description that will be reflected in a test report.
4769
4778
  */
4770
4779
  fixme(): void;
@@ -4840,9 +4849,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4840
4849
  * description.
4841
4850
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4842
4851
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4843
- * @param condition Test is marked as "should fail" when the condition is `true`.
4844
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4845
- * "should fail" when the return value is `true`.
4852
+ * @param condition Test is marked as "fixme" when the condition is `true`.
4853
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
4854
+ * when the return value is `true`.
4846
4855
  * @param description Optional description that will be reflected in a test report.
4847
4856
  */
4848
4857
  fixme(condition: boolean, description?: string): void;
@@ -4918,9 +4927,9 @@ export interface TestType<TestArgs extends {}, WorkerArgs extends {}> {
4918
4927
  * description.
4919
4928
  * @param body Test body that takes one or two arguments: an object with fixtures and optional
4920
4929
  * [TestInfo](https://playwright.dev/docs/api/class-testinfo).
4921
- * @param condition Test is marked as "should fail" when the condition is `true`.
4922
- * @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
4923
- * "should fail" when the return value is `true`.
4930
+ * @param condition Test is marked as "fixme" when the condition is `true`.
4931
+ * @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
4932
+ * when the return value is `true`.
4924
4933
  * @param description Optional description that will be reflected in a test report.
4925
4934
  */
4926
4935
  fixme(callback: ConditionBody<TestArgs & WorkerArgs>, description?: string): void;
@@ -6574,13 +6583,13 @@ export type WorkerFixture<R, Args extends {}> = (args: Args, use: (r: R) => Prom
6574
6583
  type TestFixtureValue<R, Args extends {}> = Exclude<R, Function> | TestFixture<R, Args>;
6575
6584
  type WorkerFixtureValue<R, Args extends {}> = Exclude<R, Function> | WorkerFixture<R, Args>;
6576
6585
  export type Fixtures<T extends {} = {}, W extends {} = {}, PT extends {} = {}, PW extends {} = {}> = {
6577
- [K in keyof PW]?: WorkerFixtureValue<PW[K], W & PW> | [WorkerFixtureValue<PW[K], W & PW>, { scope: 'worker', timeout?: number | undefined, title?: string, box?: boolean }];
6586
+ [K in keyof PW]?: WorkerFixtureValue<PW[K], W & PW> | [WorkerFixtureValue<PW[K], W & PW>, { scope: 'worker', timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
6578
6587
  } & {
6579
- [K in keyof PT]?: TestFixtureValue<PT[K], T & W & PT & PW> | [TestFixtureValue<PT[K], T & W & PT & PW>, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean }];
6588
+ [K in keyof PT]?: TestFixtureValue<PT[K], T & W & PT & PW> | [TestFixtureValue<PT[K], T & W & PT & PW>, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
6580
6589
  } & {
6581
- [K in Exclude<keyof W, keyof PW | keyof PT>]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
6590
+ [K in Exclude<keyof W, keyof PW | keyof PT>]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
6582
6591
  } & {
6583
- [K in Exclude<keyof T, keyof PW | keyof PT>]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
6592
+ [K in Exclude<keyof T, keyof PW | keyof PT>]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean | 'self' }];
6584
6593
  };
6585
6594
 
6586
6595
  type BrowserName = 'chromium' | 'firefox' | 'webkit';
@@ -6982,6 +6991,10 @@ export interface PlaywrightTestOptions {
6982
6991
  * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided
6983
6992
  * with an exact match to the request origin that the certificate is valid for.
6984
6993
  *
6994
+ * Client certificate authentication is only active when at least one client certificate is provided. If you want to
6995
+ * reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that
6996
+ * does not match any of the domains you plan to visit.
6997
+ *
6985
6998
  * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it
6986
6999
  * work by replacing `localhost` with `local.playwright`.
6987
7000
  *
@@ -9914,6 +9927,12 @@ export interface TestStepInfo {
9914
9927
  * @param description Optional description that will be reflected in a test report.
9915
9928
  */
9916
9929
  skip(condition: boolean, description?: string): void;
9930
+
9931
+ /**
9932
+ * The full title path starting with the test file name, including the step titles. See also
9933
+ * [testInfo.titlePath](https://playwright.dev/docs/api/class-testinfo#test-info-title-path).
9934
+ */
9935
+ titlePath: Array<string>;
9917
9936
  }
9918
9937
 
9919
9938
  /**
@@ -773,7 +773,7 @@ export interface TestStep {
773
773
  * - `hook` for hooks initialization and teardown
774
774
  * - `pw:api` for Playwright API calls.
775
775
  * - `test.step` for test.step API calls.
776
- * - `test.attach` for test attachmen calls.
776
+ * - `test.attach` for testInfo.attach API calls.
777
777
  */
778
778
  category: string;
779
779
 
@@ -1,110 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var runner_exports = {};
20
- __export(runner_exports, {
21
- Runner: () => Runner
22
- });
23
- module.exports = __toCommonJS(runner_exports);
24
- var import_lastRun = require("./lastRun");
25
- var import_projectUtils = require("./projectUtils");
26
- var import_reporters = require("./reporters");
27
- var import_tasks = require("./tasks");
28
- var import_gitCommitInfoPlugin = require("../plugins/gitCommitInfoPlugin");
29
- var import_webServerPlugin = require("../plugins/webServerPlugin");
30
- var import_base = require("../reporters/base");
31
- var import_internalReporter = require("../reporters/internalReporter");
32
- var import_compilationCache = require("../transform/compilationCache");
33
- class Runner {
34
- constructor(config) {
35
- this._config = config;
36
- }
37
- async listTestFiles(projectNames) {
38
- const projects = (0, import_projectUtils.filterProjects)(this._config.projects, projectNames);
39
- const report = {
40
- projects: []
41
- };
42
- for (const project of projects) {
43
- report.projects.push({
44
- name: project.project.name,
45
- testDir: project.project.testDir,
46
- use: { testIdAttribute: project.project.use.testIdAttribute },
47
- files: await (0, import_projectUtils.collectFilesForProject)(project)
48
- });
49
- }
50
- return report;
51
- }
52
- async runAllTests() {
53
- const config = this._config;
54
- const listOnly = config.cliListOnly;
55
- (0, import_gitCommitInfoPlugin.addGitCommitInfoPlugin)(config);
56
- (0, import_webServerPlugin.webServerPluginsForConfig)(config).forEach((p) => config.plugins.push({ factory: p }));
57
- const reporters = await (0, import_reporters.createReporters)(config, listOnly ? "list" : "test", false);
58
- const lastRun = new import_lastRun.LastRunReporter(config);
59
- if (config.cliLastFailed)
60
- await lastRun.filterLastFailed();
61
- const reporter = new import_internalReporter.InternalReporter([...reporters, lastRun]);
62
- const tasks = listOnly ? [
63
- (0, import_tasks.createLoadTask)("in-process", { failOnLoadErrors: true, filterOnly: false }),
64
- (0, import_tasks.createReportBeginTask)()
65
- ] : [
66
- (0, import_tasks.createApplyRebaselinesTask)(),
67
- ...(0, import_tasks.createGlobalSetupTasks)(config),
68
- (0, import_tasks.createLoadTask)("in-process", { filterOnly: true, failOnLoadErrors: true }),
69
- ...(0, import_tasks.createRunTestsTasks)(config)
70
- ];
71
- const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(config, reporter), tasks, config.config.globalTimeout);
72
- await new Promise((resolve) => process.stdout.write("", () => resolve()));
73
- await new Promise((resolve) => process.stderr.write("", () => resolve()));
74
- return status;
75
- }
76
- async findRelatedTestFiles(files) {
77
- const errorReporter = (0, import_reporters.createErrorCollectingReporter)(import_base.terminalScreen);
78
- const reporter = new import_internalReporter.InternalReporter([errorReporter]);
79
- const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(this._config, reporter), [
80
- ...(0, import_tasks.createPluginSetupTasks)(this._config),
81
- (0, import_tasks.createLoadTask)("in-process", { failOnLoadErrors: true, filterOnly: false, populateDependencies: true })
82
- ]);
83
- if (status !== "passed")
84
- return { errors: errorReporter.errors(), testFiles: [] };
85
- return { testFiles: (0, import_compilationCache.affectedTestFiles)(files) };
86
- }
87
- async runDevServer() {
88
- const reporter = new import_internalReporter.InternalReporter([(0, import_reporters.createErrorCollectingReporter)(import_base.terminalScreen, true)]);
89
- const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(this._config, reporter), [
90
- ...(0, import_tasks.createPluginSetupTasks)(this._config),
91
- (0, import_tasks.createLoadTask)("in-process", { failOnLoadErrors: true, filterOnly: false }),
92
- (0, import_tasks.createStartDevServerTask)(),
93
- { title: "wait until interrupted", setup: async () => new Promise(() => {
94
- }) }
95
- ]);
96
- return { status };
97
- }
98
- async clearCache() {
99
- const reporter = new import_internalReporter.InternalReporter([(0, import_reporters.createErrorCollectingReporter)(import_base.terminalScreen, true)]);
100
- const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(this._config, reporter), [
101
- ...(0, import_tasks.createPluginSetupTasks)(this._config),
102
- (0, import_tasks.createClearCacheTask)(this._config)
103
- ]);
104
- return { status };
105
- }
106
- }
107
- // Annotate the CommonJS export names for ESM import in node:
108
- 0 && (module.exports = {
109
- Runner
110
- });