@playwright/test 1.35.0-alpha-jun-5-2023 → 1.35.0-alpha-jun-7-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.
- package/.eslintrc.js +13 -1
- package/ThirdPartyNotices.txt +1 -61
- package/lib/cli.js +5 -2
- package/lib/common/process.js +1 -1
- package/lib/index.js +2 -2
- package/lib/matchers/toMatchSnapshot.js +6 -0
- package/lib/reporters/github.js +1 -1
- package/lib/reporters/html.js +4 -11
- package/lib/reporters/internalReporter.js +6 -1
- package/lib/reporters/merge.js +6 -2
- package/lib/runner/dispatcher.js +5 -5
- package/lib/runner/runner.js +2 -2
- package/lib/runner/uiMode.js +55 -68
- package/lib/util.js +19 -2
- package/lib/utilsBundle.js +1 -3
- package/lib/utilsBundleImpl.js +36 -36
- package/lib/worker/testInfo.js +1 -1
- package/lib/worker/workerMain.js +3 -3
- package/package.json +2 -2
- package/types/test.d.ts +119 -89
- package/types/testReporter.d.ts +16 -14
package/types/testReporter.d.ts
CHANGED
|
@@ -20,15 +20,15 @@ export type { FullConfig, TestStatus } from './test';
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* `Suite` is a group of tests. All tests in Playwright Test form the following hierarchy:
|
|
23
|
-
* - Root suite has a child suite for each
|
|
23
|
+
* - Root suite has a child suite for each {@link TestProject}.
|
|
24
24
|
* - Project suite #1. Has a child suite for each test file in the project.
|
|
25
25
|
* - File suite #1
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
26
|
+
* - {@link TestCase} #1
|
|
27
|
+
* - {@link TestCase} #2
|
|
28
28
|
* - Suite corresponding to a
|
|
29
29
|
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group
|
|
30
|
-
* -
|
|
31
|
-
* -
|
|
30
|
+
* - {@link TestCase} #1 in a group
|
|
31
|
+
* - {@link TestCase} #2 in a group
|
|
32
32
|
* - < more test cases ... >
|
|
33
33
|
* - File suite #2
|
|
34
34
|
* - < more file suites ... >
|
|
@@ -65,7 +65,7 @@ export interface Suite {
|
|
|
65
65
|
parent?: Suite;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* Child suites. See
|
|
68
|
+
* Child suites. See {@link Suite} for the hierarchy of suites.
|
|
69
69
|
*/
|
|
70
70
|
suites: Array<Suite>;
|
|
71
71
|
|
|
@@ -200,7 +200,7 @@ export interface TestCase {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
* A result of a single
|
|
203
|
+
* A result of a single {@link TestCase} run.
|
|
204
204
|
*/
|
|
205
205
|
export interface TestResult {
|
|
206
206
|
/**
|
|
@@ -357,17 +357,18 @@ export interface FullResult {
|
|
|
357
357
|
*
|
|
358
358
|
* Here is a typical order of reporter calls:
|
|
359
359
|
* - [reporter.onBegin(config, suite)](https://playwright.dev/docs/api/class-reporter#reporter-on-begin) is called
|
|
360
|
-
* once with a root suite that contains all other suites and tests. Learn more about [suites hierarchy]
|
|
360
|
+
* once with a root suite that contains all other suites and tests. Learn more about [suites hierarchy]{@link
|
|
361
|
+
* Suite}.
|
|
361
362
|
* - [reporter.onTestBegin(test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-test-begin) is
|
|
362
|
-
* called for each test run. It is given a
|
|
363
|
-
* Test result will be populated while the test runs (for example, with steps and stdio) and will
|
|
364
|
-
* `status` once the test finishes.
|
|
363
|
+
* called for each test run. It is given a {@link TestCase} that is executed, and a {@link TestResult} that is
|
|
364
|
+
* almost empty. Test result will be populated while the test runs (for example, with steps and stdio) and will
|
|
365
|
+
* get final `status` once the test finishes.
|
|
365
366
|
* - [reporter.onStepBegin(test, result, step)](https://playwright.dev/docs/api/class-reporter#reporter-on-step-begin)
|
|
366
367
|
* and
|
|
367
368
|
* [reporter.onStepEnd(test, result, step)](https://playwright.dev/docs/api/class-reporter#reporter-on-step-end)
|
|
368
369
|
* are called for each executed step inside the test. When steps are executed, test run has not finished yet.
|
|
369
370
|
* - [reporter.onTestEnd(test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-test-end) is
|
|
370
|
-
* called when test run has finished. By this time,
|
|
371
|
+
* called when test run has finished. By this time, {@link TestResult} is complete and you can use
|
|
371
372
|
* [testResult.status](https://playwright.dev/docs/api/class-testresult#test-result-status),
|
|
372
373
|
* [testResult.error](https://playwright.dev/docs/api/class-testresult#test-result-error) and more.
|
|
373
374
|
* - [reporter.onEnd(result)](https://playwright.dev/docs/api/class-reporter#reporter-on-end) is called once after
|
|
@@ -389,7 +390,8 @@ export interface FullResult {
|
|
|
389
390
|
*/
|
|
390
391
|
export interface Reporter {
|
|
391
392
|
/**
|
|
392
|
-
* Called once before running tests. All tests have been already discovered and put into a hierarchy of
|
|
393
|
+
* Called once before running tests. All tests have been already discovered and put into a hierarchy of {@link
|
|
394
|
+
* Suite}s.
|
|
393
395
|
* @param config Resolved configuration.
|
|
394
396
|
* @param suite The root suite that contains all projects, files and test cases.
|
|
395
397
|
*/
|
|
@@ -560,7 +562,7 @@ export {};
|
|
|
560
562
|
|
|
561
563
|
|
|
562
564
|
/**
|
|
563
|
-
* Represents a location in the source code where
|
|
565
|
+
* Represents a location in the source code where {@link TestCase} or {@link Suite} is defined.
|
|
564
566
|
*/
|
|
565
567
|
export interface Location {
|
|
566
568
|
/**
|