@serenity-js/playwright-test 3.7.0 → 3.7.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.7.2](https://github.com/serenity-js/serenity-js/compare/v3.7.1...v3.7.2) (2023-07-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update playwright dependencies to ^1.36.2 ([f9cc78f](https://github.com/serenity-js/serenity-js/commit/f9cc78fb75f431f92ef3788e9ed1e39d18039eac))
12
+ * **playwright-test:** simplified exported types, as per [@mxschmitt](https://github.com/mxschmitt) suggestion ([94874ba](https://github.com/serenity-js/serenity-js/commit/94874bae848713523b3513b91551097d6090351a)), closes [microsoft/playwright#24146](https://github.com/microsoft/playwright/issues/24146) [microsoft/TypeScript#5711](https://github.com/microsoft/TypeScript/issues/5711)
13
+
14
+
15
+
16
+
17
+
18
+ ## [3.7.1](https://github.com/serenity-js/serenity-js/compare/v3.7.0...v3.7.1) (2023-07-22)
19
+
20
+ **Note:** Version bump only for package @serenity-js/playwright-test
21
+
22
+
23
+
24
+
25
+
6
26
  # [3.7.0](https://github.com/serenity-js/serenity-js/compare/v3.6.1...v3.7.0) (2023-07-20)
7
27
 
8
28
 
@@ -1,7 +1,5 @@
1
- export * from './DescribeFunction';
2
1
  export * from './PlaywrightTestConfig';
3
2
  export * from './SerenityFixtures';
4
3
  export * from './SerenityOptions';
5
- export * from './SuiteFunction';
6
4
  export * from './test-api';
7
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
package/lib/api/index.js CHANGED
@@ -14,10 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./DescribeFunction"), exports);
18
17
  __exportStar(require("./PlaywrightTestConfig"), exports);
19
18
  __exportStar(require("./SerenityFixtures"), exports);
20
19
  __exportStar(require("./SerenityOptions"), exports);
21
- __exportStar(require("./SuiteFunction"), exports);
22
20
  __exportStar(require("./test-api"), exports);
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,yDAAuC;AACvC,qDAAmC;AACnC,oDAAkC;AAClC,kDAAgC;AAChC,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,qDAAmC;AACnC,oDAAkC;AAClC,6CAA2B"}
@@ -1,5 +1,5 @@
1
1
  import type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestInfo, TestType } from '@playwright/test';
2
- import type { DescribeFunction } from './DescribeFunction';
2
+ import { test as playwrightBaseTest } from '@playwright/test';
3
3
  import type { SerenityFixtures } from './SerenityFixtures';
4
4
  import type { SerenityOptions } from './SerenityOptions';
5
5
  export declare const fixtures: Fixtures<Omit<SerenityOptions, 'actors'> & SerenityFixtures, object, PlaywrightTestArgs & PlaywrightTestOptions, PlaywrightWorkerArgs & PlaywrightWorkerOptions>;
@@ -34,9 +34,8 @@ export type TestApi<TestArgs extends Record<string, any>, WorkerArgs extends Rec
34
34
  useFixtures: <T extends Record<string, any>, W extends Record<string, any> = object>(customFixtures: Fixtures<T, W, TestArgs, WorkerArgs>) => TestApi<TestArgs & T, WorkerArgs & W>;
35
35
  it: TestType<TestArgs, WorkerArgs>;
36
36
  test: TestType<TestArgs, WorkerArgs>;
37
- describe: DescribeFunction;
37
+ describe: typeof playwrightBaseTest.describe;
38
38
  };
39
- export declare const
40
39
  /**
41
40
  * Declares a single test scenario.
42
41
  *
@@ -94,11 +93,11 @@ export declare const
94
93
  * - [Playwright Test `test` function](https://playwright.dev/docs/api/class-test#test-call)
95
94
  * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
96
95
  */
97
- it: TestType<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object>,
96
+ export declare const it: TestType<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object>;
98
97
  /**
99
98
  * Declares a single test scenario. Alias for [`it`](/api/playwright-test/function/it/).
100
99
  */
101
- test: TestType<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object>,
100
+ export declare const test: TestType<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object>;
102
101
  /**
103
102
  * Declares a group of test scenarios.
104
103
  *
@@ -147,7 +146,13 @@ test: TestType<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions
147
146
  * - [Playwright Test `describe` function](https://playwright.dev/docs/api/class-test#test-describe-1)
148
147
  * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
149
148
  */
150
- describe: DescribeFunction, beforeAll: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void, beforeEach: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void, afterEach: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void, afterAll: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void, expect: import("@playwright/test").Expect, useFixtures: <T extends Record<string, any>, W extends Record<string, any> = object>(customFixtures: Fixtures<T, W, PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object>) => TestApi<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & T, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object & W>;
149
+ export declare const describe: typeof playwrightBaseTest.describe;
150
+ export declare const beforeAll: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void;
151
+ export declare const beforeEach: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void;
152
+ export declare const afterEach: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void;
153
+ export declare const afterAll: (inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any) => void;
154
+ export declare const expect: import("@playwright/test").Expect;
155
+ export declare const useFixtures: <T extends Record<string, any>, W extends Record<string, any> = object>(customFixtures: Fixtures<T, W, PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object>) => TestApi<PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, "actors"> & SerenityFixtures & T, PlaywrightWorkerArgs & PlaywrightWorkerOptions & object & W>;
151
156
  /**
152
157
  * Creates a Serenity/JS BDD-style test API around the given Playwright [base test](https://playwright.dev/docs/test-fixtures).
153
158
  *
@@ -1 +1 @@
1
- {"version":3,"file":"test-api.d.ts","sourceRoot":"","sources":["../../src/api/test-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACR,QAAQ,EACX,MAAM,kBAAkB,CAAC;AAgB1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyIG;AACH,wBAAgB,OAAO,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EACzG,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG,gBAAgB,GAAG,QAAQ,EAAE,UAAU,CAAC,CAGpF"}
@@ -22,7 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var _a;
26
25
  Object.defineProperty(exports, "__esModule", { value: true });
27
26
  exports.useBase = exports.useFixtures = exports.expect = exports.afterAll = exports.afterEach = exports.beforeEach = exports.beforeAll = exports.describe = exports.test = exports.it = exports.fixtures = void 0;
28
27
  const test_1 = require("@playwright/test");
@@ -135,7 +134,7 @@ function createTestApi(baseTest) {
135
134
  test: baseTest,
136
135
  };
137
136
  }
138
- _a = createTestApi(test_1.test).useFixtures(exports.fixtures),
137
+ const api = createTestApi(test_1.test).useFixtures(exports.fixtures);
139
138
  /**
140
139
  * Declares a single test scenario.
141
140
  *
@@ -193,11 +192,11 @@ _a = createTestApi(test_1.test).useFixtures(exports.fixtures),
193
192
  * - [Playwright Test `test` function](https://playwright.dev/docs/api/class-test#test-call)
194
193
  * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
195
194
  */
196
- exports.it = _a.it,
195
+ exports.it = api.it;
197
196
  /**
198
197
  * Declares a single test scenario. Alias for [`it`](/api/playwright-test/function/it/).
199
198
  */
200
- exports.test = _a.test,
199
+ exports.test = api.test;
201
200
  /**
202
201
  * Declares a group of test scenarios.
203
202
  *
@@ -246,7 +245,13 @@ exports.test = _a.test,
246
245
  * - [Playwright Test `describe` function](https://playwright.dev/docs/api/class-test#test-describe-1)
247
246
  * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
248
247
  */
249
- exports.describe = _a.describe, exports.beforeAll = _a.beforeAll, exports.beforeEach = _a.beforeEach, exports.afterEach = _a.afterEach, exports.afterAll = _a.afterAll, exports.expect = _a.expect, exports.useFixtures = _a.useFixtures;
248
+ exports.describe = api.describe;
249
+ exports.beforeAll = api.beforeAll;
250
+ exports.beforeEach = api.beforeEach;
251
+ exports.afterEach = api.afterEach;
252
+ exports.afterAll = api.afterAll;
253
+ exports.expect = api.expect;
254
+ exports.useFixtures = api.useFixtures;
250
255
  /**
251
256
  * Creates a Serenity/JS BDD-style test API around the given Playwright [base test](https://playwright.dev/docs/test-fixtures).
252
257
  *
@@ -1 +1 @@
1
- {"version":3,"file":"test-api.js","sourceRoot":"","sources":["../../src/api/test-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,2CAA+D;AAC/D,4CAA+G;AAC/G,yDAA0E;AAC1E,uDAAsE;AACtE,wDAA8F;AAC9F,0CAAsE;AACtE,uCAAyB;AAEzB,2CAA0D;AAE1D,0CAIqB;AAErB,6FAA0F;AAI1F,MAAM,uBAAuB,GAAG,IAAI,oCAAuB,EAAE,CAAC;AAEjD,QAAA,QAAQ,GAAqK;IACtL,MAAM,EAAE;QACJ,6EAA6E;QAC7E,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAiB,EAAE;YAC7D,MAAM,GAAG,CAAC,WAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CACtC,uCAA0B,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,EAC1D,gBAAS,CAAC,mBAAmB,EAAE,CAClC,CAAC,CAAC,CAAA;QACP,CAAC;QACD,EAAE,MAAM,EAAE,IAAI,EAAE;KACnB;IAED,UAAU,EAAE,KAAK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G;AACU,QAAA,QAAQ,GAAuC,GAAG,CAAC,QAAQ,CAAC;AAE5D,QAAA,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;AAE1B,QAAA,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;AAE5B,QAAA,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;AAE1B,QAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAExB,QAAA,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;AAEpB,QAAA,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyIG;AACH,SAAgB,OAAO,CACnB,QAAwC;IAExC,OAAO,aAAa,CAAC,QAAQ,CAAC;SACzB,WAAW,CAA4E,gBAAQ,CAAC,CAAC;AAC1G,CAAC;AALD,0BAKC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,aAAgC;IAChD,OAAO,aAAa,YAAY,eAAQ;QACpC,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,eAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAS,MAAM,CAAC,SAAkB;IAC9B,OAAO,IAAA,mBAAM,EAAC,QAAQ,EAAE,SAAiB,EAAE,IAAA,qBAAQ,EAAC,SAAS,EAAE,IAAA,uBAAU,GAAE,CAAC,CAAC,CAAC;AAClF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/playwright-test",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "Serenity/JS reporter and test APIs for Playwright Test",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -44,10 +44,10 @@
44
44
  "node": "^16.13 || ^18.12 || ^20"
45
45
  },
46
46
  "dependencies": {
47
- "@playwright/test": "^1.36.1",
48
- "@serenity-js/core": "3.7.0",
49
- "@serenity-js/playwright": "3.7.0",
50
- "@serenity-js/web": "3.7.0",
47
+ "@playwright/test": "^1.36.2",
48
+ "@serenity-js/core": "3.7.2",
49
+ "@serenity-js/playwright": "3.7.2",
50
+ "@serenity-js/web": "3.7.2",
51
51
  "deepmerge": "^4.3.1",
52
52
  "tiny-types": "^1.20.0"
53
53
  },
@@ -55,11 +55,11 @@
55
55
  "@integration/testing-tools": "3.0.0",
56
56
  "@types/chai": "^4.3.5",
57
57
  "@types/mocha": "^10.0.1",
58
- "c8": "8.0.0",
58
+ "c8": "8.0.1",
59
59
  "mocha": "^10.2.0",
60
60
  "mocha-multi": "^1.1.7",
61
61
  "ts-node": "^10.9.1",
62
62
  "typescript": "^5.1.6"
63
63
  },
64
- "gitHead": "9a4da7e6080c3628e69bbf01f0efb3cd4e7b0720"
64
+ "gitHead": "1803ef1287e21b4b6239f0800788483fe4e9d580"
65
65
  }
package/src/api/index.ts CHANGED
@@ -1,6 +1,4 @@
1
- export * from './DescribeFunction';
2
1
  export * from './PlaywrightTestConfig';
3
2
  export * from './SerenityFixtures';
4
3
  export * from './SerenityOptions';
5
- export * from './SuiteFunction';
6
4
  export * from './test-api';
@@ -22,7 +22,6 @@ import {
22
22
  PlaywrightStepReporter,
23
23
  SERENITY_JS_DOMAIN_EVENTS_ATTACHMENT_CONTENT_TYPE
24
24
  } from '../reporter';
25
- import type { DescribeFunction } from './DescribeFunction';
26
25
  import { PerformActivitiesAsPlaywrightSteps } from './PerformActivitiesAsPlaywrightSteps';
27
26
  import type { SerenityFixtures } from './SerenityFixtures';
28
27
  import type { SerenityOptions } from './SerenityOptions';
@@ -186,7 +185,7 @@ export type TestApi<TestArgs extends Record<string, any>, WorkerArgs extends Rec
186
185
  useFixtures: <T extends Record<string, any>, W extends Record<string, any> = object>(customFixtures: Fixtures<T, W, TestArgs, WorkerArgs>) => TestApi<TestArgs & T, WorkerArgs & W>,
187
186
  it: TestType<TestArgs, WorkerArgs>,
188
187
  test: TestType<TestArgs, WorkerArgs>,
189
- describe: DescribeFunction,
188
+ describe: typeof playwrightBaseTest.describe,
190
189
  }
191
190
 
192
191
  function createTestApi<TestArgs extends Record<string, any>, WorkerArgs extends Record<string, any> = object>(baseTest: TestType<TestArgs, WorkerArgs>): TestApi<TestArgs, WorkerArgs> {
@@ -205,125 +204,133 @@ function createTestApi<TestArgs extends Record<string, any>, WorkerArgs extends
205
204
  };
206
205
  }
207
206
 
208
- export const {
209
- /**
210
- * Declares a single test scenario.
211
- *
212
- * ## Example
213
- *
214
- * ```typescript
215
- * import { Ensure, equals } from '@serenity-js/assertions'
216
- * import { describe, it } from '@serenity-js/playwright-test'
217
- *
218
- * describe(`Todo List App`, () => {
219
- *
220
- * it(`should allow me to add a todo item`, async ({ actor }) => {
221
- * await actor.attemptsTo(
222
- * startWithAnEmptyList(),
223
- *
224
- * recordItem('Buy some milk'),
225
- *
226
- * Ensure.that(itemNames(), equals([
227
- * 'Buy some milk',
228
- * ])),
229
- * )
230
- * })
231
- *
232
- * it('supports multiple actors using separate browsers', async ({ actorCalled }) => {
233
- * await actorCalled('Alice').attemptsTo(
234
- * startWithAListContaining(
235
- * 'Feed the cat'
236
- * ),
237
- * )
238
- *
239
- * await actorCalled('Bob').attemptsTo(
240
- * startWithAListContaining(
241
- * 'Walk the dog'
242
- * ),
243
- * )
244
- *
245
- * await actorCalled('Alice').attemptsTo(
246
- * Ensure.that(itemNames(), equals([
247
- * 'Feed the cat'
248
- * ])),
249
- * )
250
- *
251
- * await actorCalled('Bob').attemptsTo(
252
- * Ensure.that(itemNames(), equals([
253
- * 'Walk the dog'
254
- * ])),
255
- * )
256
- * })
257
- * })
258
- * ```
259
- *
260
- * ## Learn more
261
- * - [Grouping test scenarios](/api/playwright-test/function/describe/)
262
- * - {@apilink SerenityFixtures}
263
- * - [Playwright Test `test` function](https://playwright.dev/docs/api/class-test#test-call)
264
- * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
265
- */
266
- it,
267
- /**
268
- * Declares a single test scenario. Alias for [`it`](/api/playwright-test/function/it/).
269
- */
270
- test,
271
- /**
272
- * Declares a group of test scenarios.
273
- *
274
- * ## Example
275
- *
276
- * ```typescript
277
- * import { Ensure, equals } from '@serenity-js/assertions'
278
- * import { describe, it, test } from '@serenity-js/playwright-test'
279
- * import { Photographer, TakePhotosOfFailures, Value } from '@serenity-js/web'
280
- *
281
- * describe(`Todo List App`, () => {
282
- *
283
- * test.use({
284
- * defaultActorName: 'Serena',
285
- * crew: [
286
- * Photographer.whoWill(TakePhotosOfFailures),
287
- * ],
288
- * })
289
- *
290
- * it(`should allow me to add a todo item`, async ({ actor }) => {
291
- * await actor.attemptsTo(
292
- * startWithAnEmptyList(),
293
- *
294
- * recordItem('Buy some milk'),
295
- *
296
- * Ensure.that(itemNames(), equals([
297
- * 'Buy some milk',
298
- * ])),
299
- * )
300
- * })
301
- *
302
- * it('should clear text input field when an item is added', async ({ actor }) => {
303
- * await actor.attemptsTo(
304
- * startWithAnEmptyList(),
305
- *
306
- * recordItem('Buy some milk'),
307
- *
308
- * Ensure.that(Value.of(newTodoInput()), equals('')),
309
- * )
310
- * })
311
- * })
312
- * ```
313
- *
314
- * ## Learn more
315
- * - Declaring a Serenity/JS [test scenario](/api/playwright-test/function/it/)
316
- * - [Playwright Test `describe` function](https://playwright.dev/docs/api/class-test#test-describe-1)
317
- * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
318
- */
319
- describe,
320
- beforeAll,
321
- beforeEach,
322
- afterEach,
323
- afterAll,
324
- expect,
325
- useFixtures,
326
- } = createTestApi(playwrightBaseTest).useFixtures(fixtures);
207
+ const api = createTestApi(playwrightBaseTest).useFixtures(fixtures);
208
+
209
+ /**
210
+ * Declares a single test scenario.
211
+ *
212
+ * ## Example
213
+ *
214
+ * ```typescript
215
+ * import { Ensure, equals } from '@serenity-js/assertions'
216
+ * import { describe, it } from '@serenity-js/playwright-test'
217
+ *
218
+ * describe(`Todo List App`, () => {
219
+ *
220
+ * it(`should allow me to add a todo item`, async ({ actor }) => {
221
+ * await actor.attemptsTo(
222
+ * startWithAnEmptyList(),
223
+ *
224
+ * recordItem('Buy some milk'),
225
+ *
226
+ * Ensure.that(itemNames(), equals([
227
+ * 'Buy some milk',
228
+ * ])),
229
+ * )
230
+ * })
231
+ *
232
+ * it('supports multiple actors using separate browsers', async ({ actorCalled }) => {
233
+ * await actorCalled('Alice').attemptsTo(
234
+ * startWithAListContaining(
235
+ * 'Feed the cat'
236
+ * ),
237
+ * )
238
+ *
239
+ * await actorCalled('Bob').attemptsTo(
240
+ * startWithAListContaining(
241
+ * 'Walk the dog'
242
+ * ),
243
+ * )
244
+ *
245
+ * await actorCalled('Alice').attemptsTo(
246
+ * Ensure.that(itemNames(), equals([
247
+ * 'Feed the cat'
248
+ * ])),
249
+ * )
250
+ *
251
+ * await actorCalled('Bob').attemptsTo(
252
+ * Ensure.that(itemNames(), equals([
253
+ * 'Walk the dog'
254
+ * ])),
255
+ * )
256
+ * })
257
+ * })
258
+ * ```
259
+ *
260
+ * ## Learn more
261
+ * - [Grouping test scenarios](/api/playwright-test/function/describe/)
262
+ * - {@apilink SerenityFixtures}
263
+ * - [Playwright Test `test` function](https://playwright.dev/docs/api/class-test#test-call)
264
+ * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
265
+ */
266
+ export const it = api.it;
267
+
268
+ /**
269
+ * Declares a single test scenario. Alias for [`it`](/api/playwright-test/function/it/).
270
+ */
271
+ export const test = api.test;
272
+
273
+ /**
274
+ * Declares a group of test scenarios.
275
+ *
276
+ * ## Example
277
+ *
278
+ * ```typescript
279
+ * import { Ensure, equals } from '@serenity-js/assertions'
280
+ * import { describe, it, test } from '@serenity-js/playwright-test'
281
+ * import { Photographer, TakePhotosOfFailures, Value } from '@serenity-js/web'
282
+ *
283
+ * describe(`Todo List App`, () => {
284
+ *
285
+ * test.use({
286
+ * defaultActorName: 'Serena',
287
+ * crew: [
288
+ * Photographer.whoWill(TakePhotosOfFailures),
289
+ * ],
290
+ * })
291
+ *
292
+ * it(`should allow me to add a todo item`, async ({ actor }) => {
293
+ * await actor.attemptsTo(
294
+ * startWithAnEmptyList(),
295
+ *
296
+ * recordItem('Buy some milk'),
297
+ *
298
+ * Ensure.that(itemNames(), equals([
299
+ * 'Buy some milk',
300
+ * ])),
301
+ * )
302
+ * })
303
+ *
304
+ * it('should clear text input field when an item is added', async ({ actor }) => {
305
+ * await actor.attemptsTo(
306
+ * startWithAnEmptyList(),
307
+ *
308
+ * recordItem('Buy some milk'),
309
+ *
310
+ * Ensure.that(Value.of(newTodoInput()), equals('')),
311
+ * )
312
+ * })
313
+ * })
314
+ * ```
315
+ *
316
+ * ## Learn more
317
+ * - Declaring a Serenity/JS [test scenario](/api/playwright-test/function/it/)
318
+ * - [Playwright Test `describe` function](https://playwright.dev/docs/api/class-test#test-describe-1)
319
+ * - [Serenity/JS + Playwright Test project template](https://github.com/serenity-js/serenity-js-playwright-test-template/)
320
+ */
321
+ export const describe: typeof playwrightBaseTest.describe = api.describe;
322
+
323
+ export const beforeAll = api.beforeAll;
324
+
325
+ export const beforeEach = api.beforeEach;
326
+
327
+ export const afterEach = api.afterEach;
328
+
329
+ export const afterAll = api.afterAll;
330
+
331
+ export const expect = api.expect;
332
+
333
+ export const useFixtures = api.useFixtures;
327
334
 
328
335
  /**
329
336
  * Creates a Serenity/JS BDD-style test API around the given Playwright [base test](https://playwright.dev/docs/test-fixtures).
@@ -1,235 +0,0 @@
1
- import type { SuiteFunction } from './SuiteFunction';
2
- export type DescribeFunction = SuiteFunction & {
3
- /**
4
- * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
5
- * else.
6
- *
7
- * **Usage**
8
- *
9
- * ```js
10
- * test.describe.only('focused group', () => {
11
- * test('in the focused group', async ({ page }) => {
12
- * // This test will run
13
- * });
14
- * });
15
- * test('not in the focused group', async ({ page }) => {
16
- * // This test will not run
17
- * });
18
- * ```
19
- *
20
- * @param title Group title.
21
- * @param callback A callback that is run immediately when calling
22
- * [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests
23
- * added in this callback will belong to the group.
24
- */
25
- only: SuiteFunction;
26
- /**
27
- * Declares a skipped test group, similarly to
28
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in the skipped
29
- * group are never run.
30
- *
31
- * **Usage**
32
- *
33
- * ```js
34
- * test.describe.skip('skipped group', () => {
35
- * test('example', async ({ page }) => {
36
- * // This test will not run
37
- * });
38
- * });
39
- * ```
40
- *
41
- * @param title Group title.
42
- * @param callback A callback that is run immediately when calling
43
- * [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests
44
- * added in this callback will belong to the group, and will not be run.
45
- */
46
- skip: SuiteFunction;
47
- /**
48
- * Declares a test group similarly to
49
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in this group
50
- * are marked as "fixme" and will not be executed.
51
- *
52
- * **Usage**
53
- *
54
- * ```js
55
- * test.describe.fixme('broken tests', () => {
56
- * test('example', async ({ page }) => {
57
- * // This test will not run
58
- * });
59
- * });
60
- * ```
61
- *
62
- * @param title Group title.
63
- * @param callback A callback that is run immediately when calling
64
- * [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests
65
- * added in this callback will belong to the group, and will not be run.
66
- */
67
- fixme: SuiteFunction;
68
- /**
69
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
70
- * the preferred way of configuring the execution mode.
71
- *
72
- * Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
73
- * skipped. All tests in a group are retried together.
74
- *
75
- * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
76
- * independently.
77
- *
78
- * **Usage**
79
- *
80
- * ```js
81
- * test.describe.serial('group', () => {
82
- * test('runs first', async ({ page }) => {});
83
- * test('runs second', async ({ page }) => {});
84
- * });
85
- * ```
86
- *
87
- * @param title Group title.
88
- * @param callback A callback that is run immediately when calling
89
- * [test.describe.serial(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial). Any tests
90
- * added in this callback will belong to the group.
91
- */
92
- serial: SuiteFunction & {
93
- /**
94
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
95
- * the preferred way of configuring the execution mode.
96
- *
97
- * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
98
- * tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
99
- * them will be run but nothing else.
100
- *
101
- * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
102
- * independently.
103
- *
104
- * **Usage**
105
- *
106
- * ```js
107
- * test.describe.serial.only('group', () => {
108
- * test('runs first', async ({ page }) => {
109
- * });
110
- * test('runs second', async ({ page }) => {
111
- * });
112
- * });
113
- * ```
114
- *
115
- * @param title Group title.
116
- * @param callback A callback that is run immediately when calling
117
- * [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
118
- * Any tests added in this callback will belong to the group.
119
- */
120
- only: SuiteFunction;
121
- };
122
- /**
123
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
124
- * the preferred way of configuring the execution mode.
125
- *
126
- * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
127
- * another, but using
128
- * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel) allows
129
- * them to run in parallel.
130
- *
131
- * **Usage**
132
- *
133
- * ```js
134
- * test.describe.parallel('group', () => {
135
- * test('runs in parallel 1', async ({ page }) => {});
136
- * test('runs in parallel 2', async ({ page }) => {});
137
- * });
138
- * ```
139
- *
140
- * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
141
- * the parallel tests executes all relevant hooks.
142
- * @param title Group title.
143
- * @param callback A callback that is run immediately when calling
144
- * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any
145
- * tests added in this callback will belong to the group.
146
- */
147
- parallel: SuiteFunction & {
148
- /**
149
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
150
- * the preferred way of configuring the execution mode.
151
- *
152
- * Declares a focused group of tests that could be run in parallel. This is similar to
153
- * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel), but
154
- * focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
155
- *
156
- * **Usage**
157
- *
158
- * ```js
159
- * test.describe.parallel.only('group', () => {
160
- * test('runs in parallel 1', async ({ page }) => {});
161
- * test('runs in parallel 2', async ({ page }) => {});
162
- * });
163
- * ```
164
- *
165
- * @param title Group title.
166
- * @param callback A callback that is run immediately when calling
167
- * [test.describe.parallel.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
168
- * Any tests added in this callback will belong to the group.
169
- */
170
- only: SuiteFunction;
171
- };
172
- /**
173
- * Configures the enclosing scope. Can be executed either on the top level or inside a describe. Configuration applies
174
- * to the entire scope, regardless of whether it run before or after the test declaration.
175
- *
176
- * Learn more about the execution modes [here](https://playwright.dev/docs/test-parallel).
177
- *
178
- * **Usage**
179
- * - Running tests in parallel.
180
- *
181
- * ```js
182
- * // Run all the tests in the file concurrently using parallel workers.
183
- * test.describe.configure({ mode: 'parallel' });
184
- * test('runs in parallel 1', async ({ page }) => {});
185
- * test('runs in parallel 2', async ({ page }) => {});
186
- * ```
187
- *
188
- * - Running tests serially, retrying from the start.
189
- *
190
- * **NOTE** Running serially is not recommended. It is usually better to make your tests isolated, so they can be
191
- * run independently.
192
- *
193
- * ```js
194
- * // Annotate tests as inter-dependent.
195
- * test.describe.configure({ mode: 'serial' });
196
- * test('runs first', async ({ page }) => {});
197
- * test('runs second', async ({ page }) => {});
198
- * ```
199
- *
200
- * - Configuring retries and timeout for each test.
201
- *
202
- * ```js
203
- * // Each test in the file will be retried twice and have a timeout of 20 seconds.
204
- * test.describe.configure({ retries: 2, timeout: 20_000 });
205
- * test('runs first', async ({ page }) => {});
206
- * test('runs second', async ({ page }) => {});
207
- * ```
208
- *
209
- * - Run multiple describes in parallel, but tests inside each describe in order.
210
- *
211
- * ```js
212
- * test.describe.configure({ mode: 'parallel' });
213
- *
214
- * test.describe('A, runs in parallel with B', () => {
215
- * test.describe.configure({ mode: 'default' });
216
- * test('in order A1', async ({ page }) => {});
217
- * test('in order A2', async ({ page }) => {});
218
- * });
219
- *
220
- * test.describe('B, runs in parallel with A', () => {
221
- * test.describe.configure({ mode: 'default' });
222
- * test('in order B1', async ({ page }) => {});
223
- * test('in order B2', async ({ page }) => {});
224
- * });
225
- * ```
226
- *
227
- * @param options
228
- */
229
- configure: (options: {
230
- mode?: 'default' | 'parallel' | 'serial';
231
- retries?: number;
232
- timeout?: number;
233
- }) => void;
234
- };
235
- //# sourceMappingURL=DescribeFunction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DescribeFunction.d.ts","sourceRoot":"","sources":["../../src/api/DescribeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC3C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,EAAE,aAAa,GAAG;QACpB;;;;;;;;;;;;;;;;;;;;;;;;;;WA0BG;QACH,IAAI,EAAE,aAAa,CAAC;KACvB,CAAC;IACF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,QAAQ,EAAE,aAAa,GAAG;QACtB;;;;;;;;;;;;;;;;;;;;;WAqBG;QACH,IAAI,EAAE,aAAa,CAAC;KACvB,CAAC;IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClH,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=DescribeFunction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DescribeFunction.js","sourceRoot":"","sources":["../../src/api/DescribeFunction.ts"],"names":[],"mappings":""}
@@ -1,51 +0,0 @@
1
- export interface SuiteFunction {
2
- /**
3
- * Declares a group of tests.
4
- *
5
- * **Usage**
6
- *
7
- * ```js
8
- * test.describe('two tests', () => {
9
- * test('one', async ({ page }) => {
10
- * // ...
11
- * });
12
- *
13
- * test('two', async ({ page }) => {
14
- * // ...
15
- * });
16
- * });
17
- * ```
18
- *
19
- * @param title Group title.
20
- * @param callback A callback that is run immediately when calling
21
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
22
- * this callback will belong to the group.
23
- */
24
- (title: string, callback: () => void): void;
25
- /**
26
- * Declares an anonymous group of tests. This is convenient to give a group of tests a common option with
27
- * [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
28
- *
29
- * **Usage**
30
- *
31
- * ```js
32
- * test.describe(() => {
33
- * test.use({ colorScheme: 'dark' });
34
- *
35
- * test('one', async ({ page }) => {
36
- * // ...
37
- * });
38
- *
39
- * test('two', async ({ page }) => {
40
- * // ...
41
- * });
42
- * });
43
- * ```
44
- *
45
- * @param callback A callback that is run immediately when calling
46
- * [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this
47
- * callback will belong to the group.
48
- */
49
- (callback: () => void): void;
50
- }
51
- //# sourceMappingURL=SuiteFunction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuiteFunction.d.ts","sourceRoot":"","sources":["../../src/api/SuiteFunction.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC5C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAChC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=SuiteFunction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuiteFunction.js","sourceRoot":"","sources":["../../src/api/SuiteFunction.ts"],"names":[],"mappings":""}
@@ -1,233 +0,0 @@
1
- import type { SuiteFunction } from './SuiteFunction';
2
-
3
- // todo: temporary workaround to cater for Playwright Test not exporting all its public APIs
4
- // remove and use Playwright SuiteFunction when https://github.com/microsoft/playwright/pull/24146 is merged in
5
- export type DescribeFunction = SuiteFunction & {
6
- /**
7
- * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
8
- * else.
9
- *
10
- * **Usage**
11
- *
12
- * ```js
13
- * test.describe.only('focused group', () => {
14
- * test('in the focused group', async ({ page }) => {
15
- * // This test will run
16
- * });
17
- * });
18
- * test('not in the focused group', async ({ page }) => {
19
- * // This test will not run
20
- * });
21
- * ```
22
- *
23
- * @param title Group title.
24
- * @param callback A callback that is run immediately when calling
25
- * [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests
26
- * added in this callback will belong to the group.
27
- */
28
- only: SuiteFunction;
29
- /**
30
- * Declares a skipped test group, similarly to
31
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in the skipped
32
- * group are never run.
33
- *
34
- * **Usage**
35
- *
36
- * ```js
37
- * test.describe.skip('skipped group', () => {
38
- * test('example', async ({ page }) => {
39
- * // This test will not run
40
- * });
41
- * });
42
- * ```
43
- *
44
- * @param title Group title.
45
- * @param callback A callback that is run immediately when calling
46
- * [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests
47
- * added in this callback will belong to the group, and will not be run.
48
- */
49
- skip: SuiteFunction;
50
- /**
51
- * Declares a test group similarly to
52
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in this group
53
- * are marked as "fixme" and will not be executed.
54
- *
55
- * **Usage**
56
- *
57
- * ```js
58
- * test.describe.fixme('broken tests', () => {
59
- * test('example', async ({ page }) => {
60
- * // This test will not run
61
- * });
62
- * });
63
- * ```
64
- *
65
- * @param title Group title.
66
- * @param callback A callback that is run immediately when calling
67
- * [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests
68
- * added in this callback will belong to the group, and will not be run.
69
- */
70
- fixme: SuiteFunction;
71
- /**
72
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
73
- * the preferred way of configuring the execution mode.
74
- *
75
- * Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
76
- * skipped. All tests in a group are retried together.
77
- *
78
- * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
79
- * independently.
80
- *
81
- * **Usage**
82
- *
83
- * ```js
84
- * test.describe.serial('group', () => {
85
- * test('runs first', async ({ page }) => {});
86
- * test('runs second', async ({ page }) => {});
87
- * });
88
- * ```
89
- *
90
- * @param title Group title.
91
- * @param callback A callback that is run immediately when calling
92
- * [test.describe.serial(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial). Any tests
93
- * added in this callback will belong to the group.
94
- */
95
- serial: SuiteFunction & {
96
- /**
97
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
98
- * the preferred way of configuring the execution mode.
99
- *
100
- * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
101
- * tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
102
- * them will be run but nothing else.
103
- *
104
- * **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
105
- * independently.
106
- *
107
- * **Usage**
108
- *
109
- * ```js
110
- * test.describe.serial.only('group', () => {
111
- * test('runs first', async ({ page }) => {
112
- * });
113
- * test('runs second', async ({ page }) => {
114
- * });
115
- * });
116
- * ```
117
- *
118
- * @param title Group title.
119
- * @param callback A callback that is run immediately when calling
120
- * [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
121
- * Any tests added in this callback will belong to the group.
122
- */
123
- only: SuiteFunction;
124
- };
125
- /**
126
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
127
- * the preferred way of configuring the execution mode.
128
- *
129
- * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
130
- * another, but using
131
- * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel) allows
132
- * them to run in parallel.
133
- *
134
- * **Usage**
135
- *
136
- * ```js
137
- * test.describe.parallel('group', () => {
138
- * test('runs in parallel 1', async ({ page }) => {});
139
- * test('runs in parallel 2', async ({ page }) => {});
140
- * });
141
- * ```
142
- *
143
- * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
144
- * the parallel tests executes all relevant hooks.
145
- * @param title Group title.
146
- * @param callback A callback that is run immediately when calling
147
- * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any
148
- * tests added in this callback will belong to the group.
149
- */
150
- parallel: SuiteFunction & {
151
- /**
152
- * **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
153
- * the preferred way of configuring the execution mode.
154
- *
155
- * Declares a focused group of tests that could be run in parallel. This is similar to
156
- * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel), but
157
- * focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
158
- *
159
- * **Usage**
160
- *
161
- * ```js
162
- * test.describe.parallel.only('group', () => {
163
- * test('runs in parallel 1', async ({ page }) => {});
164
- * test('runs in parallel 2', async ({ page }) => {});
165
- * });
166
- * ```
167
- *
168
- * @param title Group title.
169
- * @param callback A callback that is run immediately when calling
170
- * [test.describe.parallel.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
171
- * Any tests added in this callback will belong to the group.
172
- */
173
- only: SuiteFunction;
174
- };
175
- /**
176
- * Configures the enclosing scope. Can be executed either on the top level or inside a describe. Configuration applies
177
- * to the entire scope, regardless of whether it run before or after the test declaration.
178
- *
179
- * Learn more about the execution modes [here](https://playwright.dev/docs/test-parallel).
180
- *
181
- * **Usage**
182
- * - Running tests in parallel.
183
- *
184
- * ```js
185
- * // Run all the tests in the file concurrently using parallel workers.
186
- * test.describe.configure({ mode: 'parallel' });
187
- * test('runs in parallel 1', async ({ page }) => {});
188
- * test('runs in parallel 2', async ({ page }) => {});
189
- * ```
190
- *
191
- * - Running tests serially, retrying from the start.
192
- *
193
- * **NOTE** Running serially is not recommended. It is usually better to make your tests isolated, so they can be
194
- * run independently.
195
- *
196
- * ```js
197
- * // Annotate tests as inter-dependent.
198
- * test.describe.configure({ mode: 'serial' });
199
- * test('runs first', async ({ page }) => {});
200
- * test('runs second', async ({ page }) => {});
201
- * ```
202
- *
203
- * - Configuring retries and timeout for each test.
204
- *
205
- * ```js
206
- * // Each test in the file will be retried twice and have a timeout of 20 seconds.
207
- * test.describe.configure({ retries: 2, timeout: 20_000 });
208
- * test('runs first', async ({ page }) => {});
209
- * test('runs second', async ({ page }) => {});
210
- * ```
211
- *
212
- * - Run multiple describes in parallel, but tests inside each describe in order.
213
- *
214
- * ```js
215
- * test.describe.configure({ mode: 'parallel' });
216
- *
217
- * test.describe('A, runs in parallel with B', () => {
218
- * test.describe.configure({ mode: 'default' });
219
- * test('in order A1', async ({ page }) => {});
220
- * test('in order A2', async ({ page }) => {});
221
- * });
222
- *
223
- * test.describe('B, runs in parallel with A', () => {
224
- * test.describe.configure({ mode: 'default' });
225
- * test('in order B1', async ({ page }) => {});
226
- * test('in order B2', async ({ page }) => {});
227
- * });
228
- * ```
229
- *
230
- * @param options
231
- */
232
- configure: (options: { mode?: 'default' | 'parallel' | 'serial', retries?: number, timeout?: number }) => void;
233
- }
@@ -1,52 +0,0 @@
1
- // todo: temporary workaround to cater for Playwright Test not exporting all its public APIs
2
- // remove and use Playwright SuiteFunction when https://github.com/microsoft/playwright/pull/24146 is merged in
3
- export interface SuiteFunction {
4
- /**
5
- * Declares a group of tests.
6
- *
7
- * **Usage**
8
- *
9
- * ```js
10
- * test.describe('two tests', () => {
11
- * test('one', async ({ page }) => {
12
- * // ...
13
- * });
14
- *
15
- * test('two', async ({ page }) => {
16
- * // ...
17
- * });
18
- * });
19
- * ```
20
- *
21
- * @param title Group title.
22
- * @param callback A callback that is run immediately when calling
23
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
24
- * this callback will belong to the group.
25
- */
26
- (title: string, callback: () => void): void;
27
- /**
28
- * Declares an anonymous group of tests. This is convenient to give a group of tests a common option with
29
- * [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
30
- *
31
- * **Usage**
32
- *
33
- * ```js
34
- * test.describe(() => {
35
- * test.use({ colorScheme: 'dark' });
36
- *
37
- * test('one', async ({ page }) => {
38
- * // ...
39
- * });
40
- *
41
- * test('two', async ({ page }) => {
42
- * // ...
43
- * });
44
- * });
45
- * ```
46
- *
47
- * @param callback A callback that is run immediately when calling
48
- * [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this
49
- * callback will belong to the group.
50
- */
51
- (callback: () => void): void;
52
- }