@playwright/test 1.35.0-alpha-may-30-2023 → 1.35.0-alpha-jun-1-2023

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.
@@ -44,7 +44,6 @@ class Runner {
44
44
  report.projects.push({
45
45
  name: project.project.name,
46
46
  testDir: project.project.testDir,
47
- outputDir: project.project.outputDir,
48
47
  use: {
49
48
  testIdAttribute: project.project.use.testIdAttribute
50
49
  },
@@ -154,6 +154,7 @@ function createRemoveOutputDirsTask() {
154
154
  return async ({
155
155
  config
156
156
  }) => {
157
+ if (process.env.PW_TEST_NO_REMOVE_OUTPUT_DIRS) return;
157
158
  const outputDirs = new Set();
158
159
  for (const p of config.projects) {
159
160
  if (!config.cliProjectFilter || config.cliProjectFilter.includes(p.project.name)) outputDirs.add(p.project.outputDir);
@@ -159,7 +159,9 @@ class UIMode {
159
159
  }
160
160
  _dispatchEvent(message) {
161
161
  // eslint-disable-next-line no-console
162
- this._page.mainFrame().evaluateExpression(dispatchFuncSource, true, message).catch(e => this._originalStderrWrite.call(process.stderr, String(e)));
162
+ this._page.mainFrame().evaluateExpression(dispatchFuncSource, {
163
+ isFunction: true
164
+ }, message).catch(e => this._originalStderrWrite.call(process.stderr, String(e)));
163
165
  }
164
166
  async _listTests() {
165
167
  const listReporter = new _teleEmitter.TeleReporterEmitter(e => this._dispatchEvent(e));
@@ -284,6 +284,7 @@ class WorkerMain extends _process.ProcessRunner {
284
284
  didFailBeforeAllForSuite = undefined;
285
285
  return;
286
286
  }
287
+ await removeFolderAsync(testInfo.outputDir).catch(() => {});
287
288
  let testFunctionParams = null;
288
289
  await testInfo._runAsStep({
289
290
  category: 'hook',
@@ -455,7 +456,7 @@ class WorkerMain extends _process.ProcessRunner {
455
456
  (0, _globals.setCurrentTestInfo)(null);
456
457
  this.dispatchEvent('testEnd', buildTestEndPayload(testInfo));
457
458
  const preserveOutput = this._config.config.preserveOutput === 'always' || this._config.config.preserveOutput === 'failures-only' && testInfo._isFailure();
458
- if (!preserveOutput) await removeFolderAsync(testInfo.outputDir).catch(e => {});
459
+ if (!preserveOutput) await removeFolderAsync(testInfo.outputDir).catch(() => {});
459
460
  }
460
461
  async _runModifiersForSuite(suite, testInfo, scope, timeSlot, extraAnnotations) {
461
462
  for (const modifier of suite._modifiers) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playwright/test",
3
- "version": "1.35.0-alpha-may-30-2023",
3
+ "version": "1.35.0-alpha-jun-1-2023",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": "github:Microsoft/playwright",
6
6
  "homepage": "https://playwright.dev",
@@ -41,7 +41,7 @@
41
41
  "license": "Apache-2.0",
42
42
  "dependencies": {
43
43
  "@types/node": "*",
44
- "playwright-core": "1.35.0-alpha-may-30-2023"
44
+ "playwright-core": "1.35.0-alpha-jun-1-2023"
45
45
  },
46
46
  "optionalDependencies": {
47
47
  "fsevents": "2.3.2"
package/types/test.d.ts CHANGED
@@ -3675,7 +3675,7 @@ export interface PlaywrightTestOptions {
3675
3675
  * });
3676
3676
  * ```
3677
3677
  *
3678
- * Toggles bypassing page's Content-Security-Policy.
3678
+ * Toggles bypassing page's Content-Security-Policy. Defaults to `false`.
3679
3679
  */
3680
3680
  bypassCSP: boolean;
3681
3681
  /**
@@ -3732,7 +3732,7 @@ export interface PlaywrightTestOptions {
3732
3732
  * });
3733
3733
  * ```
3734
3734
  *
3735
- * An object containing additional HTTP headers to be sent with every request.
3735
+ * An object containing additional HTTP headers to be sent with every request. Defaults to none.
3736
3736
  */
3737
3737
  extraHTTPHeaders: ExtraHTTPHeaders | undefined;
3738
3738
  /**
@@ -3860,8 +3860,8 @@ export interface PlaywrightTestOptions {
3860
3860
  * ```
3861
3861
  *
3862
3862
  * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
3863
- * `Accept-Language` request header value as well as number and date formatting rules. Learn more about emulation in
3864
- * our [emulation guide](https://playwright.dev/docs/emulation#locale--timezone).
3863
+ * `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default
3864
+ * locale. Learn more about emulation in our [emulation guide](https://playwright.dev/docs/emulation#locale--timezone).
3865
3865
  */
3866
3866
  locale: string | undefined;
3867
3867
  /**
@@ -3898,7 +3898,7 @@ export interface PlaywrightTestOptions {
3898
3898
  *
3899
3899
  * A list of permissions to grant to all pages in this context. See
3900
3900
  * [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions)
3901
- * for more details.
3901
+ * for more details. Defaults to none.
3902
3902
  */
3903
3903
  permissions: string[] | undefined;
3904
3904
  /**
@@ -3958,7 +3958,7 @@ export interface PlaywrightTestOptions {
3958
3958
  *
3959
3959
  * Changes the timezone of the context. See
3960
3960
  * [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)
3961
- * for a list of supported timezone IDs.
3961
+ * for a list of supported timezone IDs. Defaults to the system timezone.
3962
3962
  */
3963
3963
  timezoneId: string | undefined;
3964
3964
  /**
@@ -4021,7 +4021,7 @@ export interface PlaywrightTestOptions {
4021
4021
  * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-response)
4022
4022
  * it takes the base URL in consideration by using the
4023
4023
  * [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL.
4024
- * Examples:
4024
+ * Unset by default. Examples:
4025
4025
  * - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
4026
4026
  * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
4027
4027
  * `http://localhost:3000/foo/bar.html`
@@ -4869,7 +4869,7 @@ interface LocatorAssertions {
4869
4869
  attached?: boolean;
4870
4870
 
4871
4871
  /**
4872
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4872
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4873
4873
  */
4874
4874
  timeout?: number;
4875
4875
  }): Promise<void>;
@@ -4890,7 +4890,7 @@ interface LocatorAssertions {
4890
4890
  checked?: boolean;
4891
4891
 
4892
4892
  /**
4893
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4893
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4894
4894
  */
4895
4895
  timeout?: number;
4896
4896
  }): Promise<void>;
@@ -4913,7 +4913,7 @@ interface LocatorAssertions {
4913
4913
  */
4914
4914
  toBeDisabled(options?: {
4915
4915
  /**
4916
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4916
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4917
4917
  */
4918
4918
  timeout?: number;
4919
4919
  }): Promise<void>;
@@ -4934,7 +4934,7 @@ interface LocatorAssertions {
4934
4934
  editable?: boolean;
4935
4935
 
4936
4936
  /**
4937
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4937
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4938
4938
  */
4939
4939
  timeout?: number;
4940
4940
  }): Promise<void>;
@@ -4953,7 +4953,7 @@ interface LocatorAssertions {
4953
4953
  */
4954
4954
  toBeEmpty(options?: {
4955
4955
  /**
4956
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4956
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4957
4957
  */
4958
4958
  timeout?: number;
4959
4959
  }): Promise<void>;
@@ -4974,7 +4974,7 @@ interface LocatorAssertions {
4974
4974
  enabled?: boolean;
4975
4975
 
4976
4976
  /**
4977
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4977
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4978
4978
  */
4979
4979
  timeout?: number;
4980
4980
  }): Promise<void>;
@@ -4993,7 +4993,7 @@ interface LocatorAssertions {
4993
4993
  */
4994
4994
  toBeFocused(options?: {
4995
4995
  /**
4996
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
4996
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
4997
4997
  */
4998
4998
  timeout?: number;
4999
4999
  }): Promise<void>;
@@ -5013,7 +5013,7 @@ interface LocatorAssertions {
5013
5013
  */
5014
5014
  toBeHidden(options?: {
5015
5015
  /**
5016
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5016
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5017
5017
  */
5018
5018
  timeout?: number;
5019
5019
  }): Promise<void>;
@@ -5044,7 +5044,7 @@ interface LocatorAssertions {
5044
5044
  ratio?: number;
5045
5045
 
5046
5046
  /**
5047
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5047
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5048
5048
  */
5049
5049
  timeout?: number;
5050
5050
  }): Promise<void>;
@@ -5063,7 +5063,7 @@ interface LocatorAssertions {
5063
5063
  */
5064
5064
  toBeVisible(options?: {
5065
5065
  /**
5066
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5066
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5067
5067
  */
5068
5068
  timeout?: number;
5069
5069
 
@@ -5125,7 +5125,7 @@ interface LocatorAssertions {
5125
5125
  ignoreCase?: boolean;
5126
5126
 
5127
5127
  /**
5128
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5128
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5129
5129
  */
5130
5130
  timeout?: number;
5131
5131
 
@@ -5151,7 +5151,7 @@ interface LocatorAssertions {
5151
5151
  */
5152
5152
  toHaveAttribute(name: string, value: string|RegExp, options?: {
5153
5153
  /**
5154
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5154
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5155
5155
  */
5156
5156
  timeout?: number;
5157
5157
  }): Promise<void>;
@@ -5184,7 +5184,7 @@ interface LocatorAssertions {
5184
5184
  */
5185
5185
  toHaveClass(expected: string|RegExp|Array<string|RegExp>, options?: {
5186
5186
  /**
5187
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5187
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5188
5188
  */
5189
5189
  timeout?: number;
5190
5190
  }): Promise<void>;
@@ -5204,7 +5204,7 @@ interface LocatorAssertions {
5204
5204
  */
5205
5205
  toHaveCount(count: number, options?: {
5206
5206
  /**
5207
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5207
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5208
5208
  */
5209
5209
  timeout?: number;
5210
5210
  }): Promise<void>;
@@ -5225,7 +5225,7 @@ interface LocatorAssertions {
5225
5225
  */
5226
5226
  toHaveCSS(name: string, value: string|RegExp, options?: {
5227
5227
  /**
5228
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5228
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5229
5229
  */
5230
5230
  timeout?: number;
5231
5231
  }): Promise<void>;
@@ -5245,7 +5245,7 @@ interface LocatorAssertions {
5245
5245
  */
5246
5246
  toHaveId(id: string|RegExp, options?: {
5247
5247
  /**
5248
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5248
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5249
5249
  */
5250
5250
  timeout?: number;
5251
5251
  }): Promise<void>;
@@ -5267,7 +5267,7 @@ interface LocatorAssertions {
5267
5267
  */
5268
5268
  toHaveJSProperty(name: string, value: any, options?: {
5269
5269
  /**
5270
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5270
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5271
5271
  */
5272
5272
  timeout?: number;
5273
5273
  }): Promise<void>;
@@ -5345,7 +5345,7 @@ interface LocatorAssertions {
5345
5345
  threshold?: number;
5346
5346
 
5347
5347
  /**
5348
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5348
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5349
5349
  */
5350
5350
  timeout?: number;
5351
5351
  }): Promise<void>;
@@ -5422,7 +5422,7 @@ interface LocatorAssertions {
5422
5422
  threshold?: number;
5423
5423
 
5424
5424
  /**
5425
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5425
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5426
5426
  */
5427
5427
  timeout?: number;
5428
5428
  }): Promise<void>;
@@ -5481,7 +5481,7 @@ interface LocatorAssertions {
5481
5481
  ignoreCase?: boolean;
5482
5482
 
5483
5483
  /**
5484
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5484
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5485
5485
  */
5486
5486
  timeout?: number;
5487
5487
 
@@ -5507,7 +5507,7 @@ interface LocatorAssertions {
5507
5507
  */
5508
5508
  toHaveValue(value: string|RegExp, options?: {
5509
5509
  /**
5510
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5510
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5511
5511
  */
5512
5512
  timeout?: number;
5513
5513
  }): Promise<void>;
@@ -5539,7 +5539,7 @@ interface LocatorAssertions {
5539
5539
  */
5540
5540
  toHaveValues(values: Array<string|RegExp>, options?: {
5541
5541
  /**
5542
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5542
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5543
5543
  */
5544
5544
  timeout?: number;
5545
5545
  }): Promise<void>;
@@ -5675,7 +5675,7 @@ interface PageAssertions {
5675
5675
  threshold?: number;
5676
5676
 
5677
5677
  /**
5678
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5678
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5679
5679
  */
5680
5680
  timeout?: number;
5681
5681
  }): Promise<void>;
@@ -5782,7 +5782,7 @@ interface PageAssertions {
5782
5782
  threshold?: number;
5783
5783
 
5784
5784
  /**
5785
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5785
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5786
5786
  */
5787
5787
  timeout?: number;
5788
5788
  }): Promise<void>;
@@ -5801,7 +5801,7 @@ interface PageAssertions {
5801
5801
  */
5802
5802
  toHaveTitle(titleOrRegExp: string|RegExp, options?: {
5803
5803
  /**
5804
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5804
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5805
5805
  */
5806
5806
  timeout?: number;
5807
5807
  }): Promise<void>;
@@ -5820,7 +5820,7 @@ interface PageAssertions {
5820
5820
  */
5821
5821
  toHaveURL(urlOrRegExp: string|RegExp, options?: {
5822
5822
  /**
5823
- * Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.
5823
+ * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
5824
5824
  */
5825
5825
  timeout?: number;
5826
5826
  }): Promise<void>;