@gooddata/sdk-e2e-utils 11.61.0-alpha.0 → 11.61.0-alpha.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.
- package/esm/create-test/feature-hub/mock.d.ts +2 -2
- package/esm/create-test/feature-hub/mock.d.ts.map +1 -1
- package/esm/create-test/playwright/factory.d.ts +7 -0
- package/esm/create-test/playwright/factory.d.ts.map +1 -0
- package/esm/create-test/playwright/factory.js +85 -0
- package/esm/create-test/playwright/fixtures.d.ts +2 -2
- package/esm/create-test/playwright/fixtures.d.ts.map +1 -1
- package/esm/create-test/playwright/playwright-internals.d.ts +33 -0
- package/esm/create-test/playwright/playwright-internals.d.ts.map +1 -0
- package/esm/create-test/playwright/playwright-internals.js +56 -0
- package/esm/create-test/playwright/playwright-types.d.ts +6 -22
- package/esm/create-test/playwright/playwright-types.d.ts.map +1 -1
- package/esm/create-test/playwright/to-playwright-details.d.ts +5 -0
- package/esm/create-test/playwright/to-playwright-details.d.ts.map +1 -0
- package/esm/create-test/playwright/to-playwright-details.js +7 -0
- package/esm/create-test/playwright/types.d.ts +75 -1
- package/esm/create-test/playwright/types.d.ts.map +1 -1
- package/esm/create-test/playwright/with-describe-details.d.ts +3 -4
- package/esm/create-test/playwright/with-describe-details.d.ts.map +1 -1
- package/esm/index.d.ts +3 -7
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -1
- package/esm/sdk-e2e-utils.d.ts +59 -57
- package/package.json +3 -3
- package/esm/create-test/playwright/call-original-fn.d.ts +0 -17
- package/esm/create-test/playwright/call-original-fn.d.ts.map +0 -1
- package/esm/create-test/playwright/call-original-fn.js +0 -25
- package/esm/create-test/playwright/describe/factory.d.ts +0 -27
- package/esm/create-test/playwright/describe/factory.d.ts.map +0 -1
- package/esm/create-test/playwright/describe/factory.js +0 -18
- package/esm/create-test/playwright/test/factory.d.ts +0 -7
- package/esm/create-test/playwright/test/factory.d.ts.map +0 -1
- package/esm/create-test/playwright/test/factory.js +0 -42
- package/esm/create-test/playwright/test/types.d.ts +0 -27
- package/esm/create-test/playwright/test/types.d.ts.map +0 -1
- package/esm/create-test/playwright/test/types.js +0 -2
- package/esm/create-test/playwright/top-level-describe/build-suite-callback.d.ts +0 -9
- package/esm/create-test/playwright/top-level-describe/build-suite-callback.d.ts.map +0 -1
- package/esm/create-test/playwright/top-level-describe/build-suite-callback.js +0 -17
- package/esm/create-test/playwright/top-level-describe/factory.d.ts +0 -8
- package/esm/create-test/playwright/top-level-describe/factory.d.ts.map +0 -1
- package/esm/create-test/playwright/top-level-describe/factory.js +0 -12
- package/esm/create-test/playwright/top-level-describe/types.d.ts +0 -17
- package/esm/create-test/playwright/top-level-describe/types.d.ts.map +0 -1
- package/esm/create-test/playwright/top-level-describe/types.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PlaywrightTest } from "../playwright/playwright-types.js";
|
|
2
2
|
import type { IFeatureHubEnvironment } from "./types.js";
|
|
3
3
|
/** FeatureHub mock — each test gets a fresh page, so route dies with it. */
|
|
4
|
-
export declare function registerFeatureHubMock(testInstance:
|
|
4
|
+
export declare function registerFeatureHubMock(testInstance: PlaywrightTest, featureHubResponse: IFeatureHubEnvironment[]): void;
|
|
5
5
|
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/create-test/feature-hub/mock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/create-test/feature-hub/mock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAClC,YAAY,EAAE,cAAc,EAC5B,kBAAkB,EAAE,sBAAsB,EAAE,GAC7C,IAAI,CAYN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/factory.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAER,kBAAkB,EAElB,IAAI,EAGP,MAAM,YAAY,CAAC;AAGpB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CA8GxG"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
// oxlint-disable typescript-eslint/no-empty-object-type
|
|
3
|
+
import { test } from "@playwright/test";
|
|
4
|
+
import { registerFeatureHubMock } from "../feature-hub/mock.js";
|
|
5
|
+
import { registerGoodmockHooks } from "../goodmock/playwright.js";
|
|
6
|
+
import { getCallerLocation, getPlaywrightInternals, } from "./playwright-internals.js";
|
|
7
|
+
import { toPlaywrightDetails } from "./to-playwright-details.js";
|
|
8
|
+
import { withDescribeDetails } from "./with-describe-details.js";
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* @param options -
|
|
12
|
+
*/
|
|
13
|
+
export function createTest(options) {
|
|
14
|
+
// Tracks whether we're inside a topLevelDescribe during synchronous registration.
|
|
15
|
+
let insideTopLevelDescribe = false;
|
|
16
|
+
// Stacks track workspace settings / additionalWindowProperties hierarchy during
|
|
17
|
+
// synchronous describe registration. Each level merges on top of the parent's.
|
|
18
|
+
// The beforeEach at each level captures the fully-merged snapshot, so the
|
|
19
|
+
// innermost beforeEach (which runs last) wins.
|
|
20
|
+
const settingsStack = [];
|
|
21
|
+
const awpStack = [];
|
|
22
|
+
const testInstance = options.fixtures ? test.extend(options.fixtures) : test;
|
|
23
|
+
const internals = getPlaywrightInternals(testInstance);
|
|
24
|
+
const makeDescribe = (type, name) => {
|
|
25
|
+
return (title, details, callback) => {
|
|
26
|
+
if (!insideTopLevelDescribe) {
|
|
27
|
+
throw new Error(`${name}("${title}") must be nested inside a test.topLevelDescribe() block.`);
|
|
28
|
+
}
|
|
29
|
+
internals.describe(type, getCallerLocation(), title, toPlaywrightDetails(details), () => withDescribeDetails(testInstance, settingsStack, awpStack, details, callback));
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
// Spec files that already have a topLevelDescribe. Playwright loads each file once per process,
|
|
33
|
+
// so a second registration from the same file means a second topLevelDescribe in that file.
|
|
34
|
+
const filesWithTopLevelDescribe = new Set();
|
|
35
|
+
const makeTopLevelDescribe = (type) => {
|
|
36
|
+
return (suiteName, specName, details, fn) => {
|
|
37
|
+
const location = getCallerLocation();
|
|
38
|
+
if (filesWithTopLevelDescribe.has(location.file)) {
|
|
39
|
+
throw new Error(`test.topLevelDescribe("${suiteName}"): only one test.topLevelDescribe() is allowed per file (${location.file}).`);
|
|
40
|
+
}
|
|
41
|
+
filesWithTopLevelDescribe.add(location.file);
|
|
42
|
+
const suite = () => {
|
|
43
|
+
registerFeatureHubMock(testInstance, options.featureHubResponse);
|
|
44
|
+
if (options.goodmock) {
|
|
45
|
+
registerGoodmockHooks(testInstance, options.goodmock, specName);
|
|
46
|
+
}
|
|
47
|
+
// Workspace settings + additional window properties — merge with parent
|
|
48
|
+
// stack and inject beforeEach. Wraps fn() so nested describes inherit.
|
|
49
|
+
insideTopLevelDescribe = true;
|
|
50
|
+
withDescribeDetails(testInstance, settingsStack, awpStack, details, fn);
|
|
51
|
+
insideTopLevelDescribe = false;
|
|
52
|
+
};
|
|
53
|
+
const pwDetails = toPlaywrightDetails(details);
|
|
54
|
+
internals.describe(type, location, suiteName, pwDetails, suite);
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const makeTest = (name, register) => {
|
|
58
|
+
return (...args) => {
|
|
59
|
+
// Only the `(title, ...)` forms register a test; the title-less forms
|
|
60
|
+
// (`test.skip()`, `test.skip(condition)`, ...) are used inside tests and describes.
|
|
61
|
+
if (typeof args[0] === "string" && !insideTopLevelDescribe) {
|
|
62
|
+
throw new Error(`${name}("${args[0]}") must be nested inside a test.topLevelDescribe() block.`);
|
|
63
|
+
}
|
|
64
|
+
register(getCallerLocation(), ...args);
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
return Object.assign(makeTest("test", (location, ...args) => internals.createTest("default", location, ...args)), testInstance, {
|
|
68
|
+
only: makeTest("test.only", (location, ...args) => internals.createTest("only", location, ...args)),
|
|
69
|
+
skip: makeTest("test.skip", (location, ...args) => internals.modifier("skip", location, ...args)),
|
|
70
|
+
fixme: makeTest("test.fixme", (location, ...args) => internals.modifier("fixme", location, ...args)),
|
|
71
|
+
fail: Object.assign(makeTest("test.fail", (location, ...args) => internals.modifier("fail", location, ...args)), testInstance.fail, {
|
|
72
|
+
only: makeTest("test.fail.only", (location, ...args) => internals.createTest("fail.only", location, ...args)),
|
|
73
|
+
}),
|
|
74
|
+
/** Build the overridden `test.describe` (with its `.skip`, `.only`, `.fixme`) for a single `createTest` instance. */
|
|
75
|
+
describe: Object.assign(makeDescribe("default", "describe"), testInstance.describe, {
|
|
76
|
+
only: makeDescribe("only", "describe.only"),
|
|
77
|
+
fixme: makeDescribe("fixme", "describe.fixme"),
|
|
78
|
+
skip: makeDescribe("skip", "describe.skip"),
|
|
79
|
+
}),
|
|
80
|
+
/** Build `test.topLevelDescribe` (with its `.skip`) for a single `createTest` instance. */
|
|
81
|
+
topLevelDescribe: Object.assign(makeTopLevelDescribe("default"), {
|
|
82
|
+
skip: makeTopLevelDescribe("skip"),
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Fixtures as PlaywrightFixtures } from "@playwright/test";
|
|
2
|
-
import { type
|
|
2
|
+
import { type PlaywrightBaseTestArgs, type PlaywrightBaseWorkerArgs } from "./playwright-types.js";
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export type Fixtures<T extends {} = {}, W extends {} = {}> = PlaywrightFixtures<T, W,
|
|
6
|
+
export type Fixtures<T extends {} = {}, W extends {} = {}> = PlaywrightFixtures<T, W, PlaywrightBaseTestArgs, PlaywrightBaseWorkerArgs>;
|
|
7
7
|
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/fixtures.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/fixtures.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,kBAAkB,CAC3E,CAAC,EACD,CAAC,EACD,sBAAsB,EACtB,wBAAwB,CAC3B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PlaywrightTest } from "./playwright-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Source location Playwright records for tests, describes and modifiers.
|
|
4
|
+
*/
|
|
5
|
+
export interface IPlaywrightLocation {
|
|
6
|
+
file: string;
|
|
7
|
+
line: number;
|
|
8
|
+
column: number;
|
|
9
|
+
}
|
|
10
|
+
export type PlaywrightCreateTestType = "default" | "only" | "fail.only";
|
|
11
|
+
export type PlaywrightModifierType = "skip" | "fixme" | "fail";
|
|
12
|
+
export type PlaywrightDescribeType = "default" | "only" | "skip" | "fixme" | "serial" | "serial.only" | "parallel" | "parallel.only";
|
|
13
|
+
export interface IPlaywrightInternals {
|
|
14
|
+
/** Same as `test(...)`, `test.only(...)`, `test.fail.only(...)`. */
|
|
15
|
+
createTest(type: PlaywrightCreateTestType, location: IPlaywrightLocation, ...args: unknown[]): void;
|
|
16
|
+
/** Same as `test.skip(...)`, `test.fixme(...)`, `test.fail(...)`, in both their title and title-less forms. */
|
|
17
|
+
modifier(type: PlaywrightModifierType, location: IPlaywrightLocation, ...args: unknown[]): void;
|
|
18
|
+
/** Same as `test.describe(...)` and its variants. */
|
|
19
|
+
describe(type: PlaywrightDescribeType, location: IPlaywrightLocation, ...args: unknown[]): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the private `TestTypeImpl` behind a Playwright `test` function.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPlaywrightInternals(testInstance: PlaywrightTest): IPlaywrightInternals;
|
|
25
|
+
/**
|
|
26
|
+
* Location of the first stack frame outside this package, i.e. the spec file (or consumer helper)
|
|
27
|
+
* that called our wrapper. Same frame Playwright's public API would have recorded.
|
|
28
|
+
*
|
|
29
|
+
* Playwright installs source-map-support while loading test files, so the stack already shows
|
|
30
|
+
* the original TypeScript file and line.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getCallerLocation(): IPlaywrightLocation;
|
|
33
|
+
//# sourceMappingURL=playwright-internals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-internals.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/playwright-internals.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAU5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAC5B,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,aAAa,GACb,UAAU,GACV,eAAe,CAAC;AAEtB,MAAM,WAAW,oBAAoB;IACjC,oEAAoE;IACpE,UAAU,CAAC,IAAI,EAAE,wBAAwB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpG,+GAA+G;IAC/G,QAAQ,CAAC,IAAI,EAAE,sBAAsB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChG,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,sBAAsB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACnG;AAoBD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,cAAc,GAAG,oBAAoB,CAkBzF;AAWD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,CAkBvD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
function isTestTypeImpl(value) {
|
|
4
|
+
if (typeof value !== "object" || value === null) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const impl = value;
|
|
8
|
+
return (typeof impl._createTest === "function" &&
|
|
9
|
+
typeof impl._modifier === "function" &&
|
|
10
|
+
typeof impl._describe === "function");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get the private `TestTypeImpl` behind a Playwright `test` function.
|
|
14
|
+
*/
|
|
15
|
+
export function getPlaywrightInternals(testInstance) {
|
|
16
|
+
// Playwright stores it under a module-private `Symbol("testType")`, so look it up by description.
|
|
17
|
+
const symbol = Object.getOwnPropertySymbols(testInstance).find((s) => s.description === "testType");
|
|
18
|
+
const impl = symbol ? testInstance[symbol] : undefined;
|
|
19
|
+
if (!isTestTypeImpl(impl)) {
|
|
20
|
+
throw new Error("@gooddata/sdk-e2e-utils: Playwright internals (TestTypeImpl._createTest/_modifier/_describe) " +
|
|
21
|
+
"were not found. They changed in this @playwright/test version; update " +
|
|
22
|
+
"src/create-test/playwright/playwright-internals.ts.");
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
createTest: (type, location, ...args) => impl._createTest(type, location, ...args),
|
|
26
|
+
modifier: (type, location, ...args) => impl._modifier(type, location, ...args),
|
|
27
|
+
describe: (type, location, ...args) => impl._describe(type, location, ...args),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// This package's code: compiled (`esm/`) and, when source-mapped, original (`src/`). Frames from here are our own wrappers.
|
|
31
|
+
const OWN_CODE_DIRS = ["../../../esm/", "../../../src/"].map((dir) => fileURLToPath(new URL(dir, import.meta.url)));
|
|
32
|
+
// Matches the location at the end of a stack line: "at fn (/path/file.ts:12:3)", "at /path/file.ts:12:3",
|
|
33
|
+
// "at fn (file:///path/file.ts:12:3)".
|
|
34
|
+
const STACK_FRAME_LOCATION = /\(?((?:file:\/\/)?[^\s()]+):(\d+):(\d+)\)?$/;
|
|
35
|
+
/**
|
|
36
|
+
* Location of the first stack frame outside this package, i.e. the spec file (or consumer helper)
|
|
37
|
+
* that called our wrapper. Same frame Playwright's public API would have recorded.
|
|
38
|
+
*
|
|
39
|
+
* Playwright installs source-map-support while loading test files, so the stack already shows
|
|
40
|
+
* the original TypeScript file and line.
|
|
41
|
+
*/
|
|
42
|
+
export function getCallerLocation() {
|
|
43
|
+
const stack = new Error().stack ?? "";
|
|
44
|
+
for (const stackLine of stack.split("\n").slice(1)) {
|
|
45
|
+
const match = STACK_FRAME_LOCATION.exec(stackLine.trim());
|
|
46
|
+
if (!match) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const file = match[1].startsWith("file://") ? fileURLToPath(match[1]) : match[1];
|
|
50
|
+
if (OWN_CODE_DIRS.some((dir) => file.startsWith(dir)) || file.startsWith("node:")) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
return { file, line: Number(match[2]), column: Number(match[3]) };
|
|
54
|
+
}
|
|
55
|
+
throw new Error("@gooddata/sdk-e2e-utils: could not determine the caller location from the stack.");
|
|
56
|
+
}
|
|
@@ -2,41 +2,25 @@ import type { PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, P
|
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export type
|
|
5
|
+
export type PlaywrightBaseTestArgs = PlaywrightTestArgs & PlaywrightTestOptions;
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type PlaywrightBaseWorkerArgs = PlaywrightWorkerArgs & PlaywrightWorkerOptions;
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type PlaywrightTest = typeof test;
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export type
|
|
17
|
+
export type PlaywrightDescribeConfigure = typeof test.describe.configure;
|
|
18
18
|
/**
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
export type
|
|
21
|
+
export type PlaywrightDescribeSerial = typeof test.describe.serial;
|
|
22
22
|
/**
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
|
-
export type
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export type DescribeFixme = typeof test.describe.fixme;
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export type DescribeSerial = typeof test.describe.serial;
|
|
34
|
-
/**
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
export type DescribeParallel = typeof test.describe.parallel;
|
|
38
|
-
/**
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export type DescribeSkip = typeof test.describe.skip;
|
|
25
|
+
export type PlaywrightDescribeParallel = typeof test.describe.parallel;
|
|
42
26
|
//# sourceMappingURL=playwright-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-types.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/playwright-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,IAAI,EACP,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"playwright-types.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/playwright-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,IAAI,EACP,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG,uBAAuB,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,IAAI,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TestDetails } from "@playwright/test";
|
|
2
|
+
import type { ITestDetails } from "./types.js";
|
|
3
|
+
/** Strip custom fields before passing details to Playwright. */
|
|
4
|
+
export declare function toPlaywrightDetails(details: ITestDetails): TestDetails;
|
|
5
|
+
//# sourceMappingURL=to-playwright-details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-playwright-details.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/to-playwright-details.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,gEAAgE;AAChE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAItE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/** Strip custom fields before passing details to Playwright. */
|
|
3
|
+
export function toPlaywrightDetails(details) {
|
|
4
|
+
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
const { workspaceSettings: _ws, additionalWindowProperties: _awp, ...rest } = details;
|
|
6
|
+
return Object.keys(rest).length > 0 ? rest : {};
|
|
7
|
+
}
|
|
@@ -1,4 +1,55 @@
|
|
|
1
|
-
import type { TestDetails } from "@playwright/test";
|
|
1
|
+
import type { Fixtures, TestDetails } from "@playwright/test";
|
|
2
|
+
import type { IFeatureHubEnvironment } from "../feature-hub/types.js";
|
|
3
|
+
import type { IGoodmockOptions } from "../goodmock/types.js";
|
|
4
|
+
import type { PlaywrightDescribeConfigure, PlaywrightDescribeParallel, PlaywrightDescribeSerial, PlaywrightTest } from "./playwright-types.js";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export type Callback = () => void;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* Call signatures of the overridden `test.describe`, `test.describe.only`, `test.describe.skip` and `test.describe.fixme`.
|
|
12
|
+
*/
|
|
13
|
+
export interface IDescribeFunction {
|
|
14
|
+
(title: string, details: ITestDetails, callback: Callback): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export interface IDescribe extends IDescribeFunction {
|
|
20
|
+
skip: IDescribeFunction;
|
|
21
|
+
only: IDescribeFunction;
|
|
22
|
+
configure: PlaywrightDescribeConfigure;
|
|
23
|
+
fixme: IDescribeFunction;
|
|
24
|
+
serial: PlaywrightDescribeSerial;
|
|
25
|
+
parallel: PlaywrightDescribeParallel;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* Call signatures of the overridden `test.describe` and `test.describe.skip`.
|
|
30
|
+
*/
|
|
31
|
+
export interface ITopLevelDescribeFunction {
|
|
32
|
+
(suiteName: string, specName: string, details: ITestDetails, fn: Callback): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export interface ITopLevelDescribe extends ITopLevelDescribeFunction {
|
|
38
|
+
skip: ITopLevelDescribeFunction;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export interface ICustomCreateTestOptions {
|
|
44
|
+
featureHubResponse: IFeatureHubEnvironment[];
|
|
45
|
+
goodmock?: IGoodmockOptions;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export interface ICreateTestOptions<T extends {} = {}, W extends {} = {}> extends ICustomCreateTestOptions {
|
|
51
|
+
fixtures?: Fixtures<T, W>;
|
|
52
|
+
}
|
|
2
53
|
/**
|
|
3
54
|
* @internal
|
|
4
55
|
*/
|
|
@@ -14,4 +65,27 @@ export interface ITestDetails extends TestDetails {
|
|
|
14
65
|
workspaceSettings?: WorkspaceSettings;
|
|
15
66
|
additionalWindowProperties?: WindowProperties;
|
|
16
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
* Keep only the call signatures of an overloaded function type (Playwright's `test` has exactly two).
|
|
71
|
+
*/
|
|
72
|
+
export type CallSignatures<F> = F extends {
|
|
73
|
+
(...args: infer A1): infer R1;
|
|
74
|
+
(...args: infer A2): infer R2;
|
|
75
|
+
} ? {
|
|
76
|
+
(...args: A1): R1;
|
|
77
|
+
(...args: A2): R2;
|
|
78
|
+
} : never;
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
* Like `T & U`, but properties in `U` replace those in `T` instead of merging, and `T` stays callable.
|
|
82
|
+
*/
|
|
83
|
+
export type Override<T, U> = CallSignatures<T> & Omit<T, keyof U> & U;
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
export type Test = Override<PlaywrightTest, {
|
|
88
|
+
topLevelDescribe: ITopLevelDescribe;
|
|
89
|
+
describe: IDescribe;
|
|
90
|
+
}>;
|
|
17
91
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EACR,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,cAAc,EACjB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAChD,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,2BAA2B,CAAC;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,wBAAwB,CAAC;IACjC,QAAQ,EAAE,0BAA0B,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;CACpF;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,yBAAyB;IAChE,IAAI,EAAE,yBAAyB,CAAC;CAOnC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,kBAAkB,EAAE,sBAAsB,EAAE,CAAC;IAC7C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,wBAAwB;IACtG,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,0BAA0B,CAAC,EAAE,gBAAgB,CAAC;CACjD;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;CAAE,GACpG;IAAE,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC;IAAC,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,CAAA;CAAE,GACxC,KAAK,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,QAAQ,CACvB,cAAc,EACd;IACI,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACvB,CACJ,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { ITestDetails, WindowProperties, WorkspaceSettings } from "./types.js";
|
|
1
|
+
import type { PlaywrightTest } from "./playwright-types.js";
|
|
2
|
+
import type { Callback, ITestDetails, WindowProperties, WorkspaceSettings } from "./types.js";
|
|
4
3
|
/** Push merged settings/awp onto stacks, register a single beforeEach, call fn, pop. */
|
|
5
|
-
export declare function withDescribeDetails(testInstance:
|
|
4
|
+
export declare function withDescribeDetails(testInstance: PlaywrightTest, settingsStack: WorkspaceSettings[], awpStack: WindowProperties[], details: ITestDetails | undefined, fn: Callback): void;
|
|
6
5
|
//# sourceMappingURL=with-describe-details.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-describe-details.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/with-describe-details.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"with-describe-details.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/with-describe-details.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM9F,wFAAwF;AACxF,wBAAgB,mBAAmB,CAC/B,YAAY,EAAE,cAAc,EAC5B,aAAa,EAAE,iBAAiB,EAAE,EAClC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,EAAE,EAAE,QAAQ,QAmBf"}
|
package/esm/index.d.ts
CHANGED
|
@@ -5,13 +5,9 @@ export type { IGoodmockMapping, ILeakPattern, ISecretMapping, IWorkspaceIdMappin
|
|
|
5
5
|
export { loadMappings, resetMappings, resetScenarios, mockLogRequests, startRecording, } from "./create-test/goodmock/admin.js";
|
|
6
6
|
export { goodmockMode, GoodmockMode } from "./create-test/goodmock/mode.js";
|
|
7
7
|
export { snapshotAndSaveRecording, type ISnapshotAndSaveRecordingOptions, } from "./create-test/goodmock/snapshot/snapshot-and-save-recording.js";
|
|
8
|
-
export
|
|
9
|
-
export type { IDescribe, IDescribeFunction } from "./create-test/playwright/describe/factory.js";
|
|
8
|
+
export { createTest } from "./create-test/playwright/factory.js";
|
|
10
9
|
export type { Fixtures } from "./create-test/playwright/fixtures.js";
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
13
|
-
export type { ICreateTestOptions, ICustomCreateTestOptions, ITest, } from "./create-test/playwright/test/types.js";
|
|
14
|
-
export type { ITestDetails, WindowProperties, WorkspaceSettings } from "./create-test/playwright/types.js";
|
|
15
|
-
export type { ITopLevelDescribe, ITopLevelDescribeFunction, } from "./create-test/playwright/top-level-describe/types.js";
|
|
10
|
+
export type { PlaywrightBaseTestArgs, PlaywrightBaseWorkerArgs, PlaywrightDescribeConfigure, PlaywrightDescribeParallel, PlaywrightDescribeSerial, PlaywrightTest, } from "./create-test/playwright/playwright-types.js";
|
|
11
|
+
export type { CallSignatures, Callback, ICreateTestOptions, ICustomCreateTestOptions, IDescribe, IDescribeFunction, ITestDetails, ITopLevelDescribe, ITopLevelDescribeFunction, Override, Test, WindowProperties, WorkspaceSettings, } from "./create-test/playwright/types.js";
|
|
16
12
|
export { clickByBoundingBox, hoverByBoundingBox } from "./helpers/mouse-actions.js";
|
|
17
13
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG3E,OAAO,EACH,aAAa,EACb,SAAS,EACT,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGrG,YAAY,EACR,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,GACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EACH,wBAAwB,EACxB,KAAK,gCAAgC,GACxC,MAAM,gEAAgE,CAAC;AAGxE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG3E,OAAO,EACH,aAAa,EACb,SAAS,EACT,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGrG,YAAY,EACR,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,GACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EACH,wBAAwB,EACxB,KAAK,gCAAgC,GACxC,MAAM,gEAAgE,CAAC;AAGxE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,YAAY,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,YAAY,EACR,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,cAAc,GACjB,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACR,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { GOODMOCK_HOST, API_TOKEN, BACKEND_HOST, getBaseUrl, getEnvWithFallback,
|
|
|
7
7
|
export { loadMappings, resetMappings, resetScenarios, mockLogRequests, startRecording, } from "./create-test/goodmock/admin.js";
|
|
8
8
|
export { goodmockMode, GoodmockMode } from "./create-test/goodmock/mode.js";
|
|
9
9
|
export { snapshotAndSaveRecording, } from "./create-test/goodmock/snapshot/snapshot-and-save-recording.js";
|
|
10
|
-
|
|
10
|
+
// create-test - playwright
|
|
11
|
+
export { createTest } from "./create-test/playwright/factory.js";
|
|
11
12
|
// helpers
|
|
12
13
|
export { clickByBoundingBox, hoverByBoundingBox } from "./helpers/mouse-actions.js";
|
package/esm/sdk-e2e-utils.d.ts
CHANGED
|
@@ -38,17 +38,19 @@ export declare const BACKEND_HOST: string;
|
|
|
38
38
|
/**
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
|
-
export declare type
|
|
41
|
+
export declare type Callback = () => void;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* @internal
|
|
45
|
+
* Keep only the call signatures of an overloaded function type (Playwright's `test` has exactly two).
|
|
45
46
|
*/
|
|
46
|
-
export declare type
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
export declare type CallSignatures<F> = F extends {
|
|
48
|
+
(...args: infer A1): infer R1;
|
|
49
|
+
(...args: infer A2): infer R2;
|
|
50
|
+
} ? {
|
|
51
|
+
(...args: A1): R1;
|
|
52
|
+
(...args: A2): R2;
|
|
53
|
+
} : never;
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
56
|
* @internal
|
|
@@ -66,42 +68,12 @@ export declare function clickByBoundingBox(page: Page, locator: Locator, options
|
|
|
66
68
|
* @internal
|
|
67
69
|
* @param options -
|
|
68
70
|
*/
|
|
69
|
-
export declare function createTest<T extends {} = {}, W extends {} = {}>(options: ICreateTestOptions<T, W>):
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
export declare type DescribeConfigure = typeof test.describe.configure;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export declare type DescribeFixme = typeof test.describe.fixme;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
export declare type DescribeOnly = typeof test.describe.only;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
|
-
export declare type DescribeParallel = typeof test.describe.parallel;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
export declare type DescribeSerial = typeof test.describe.serial;
|
|
71
|
+
export declare function createTest<T extends {} = {}, W extends {} = {}>(options: ICreateTestOptions<T, W>): Test;
|
|
95
72
|
|
|
96
73
|
/**
|
|
97
74
|
* @internal
|
|
98
75
|
*/
|
|
99
|
-
export declare type
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @internal
|
|
103
|
-
*/
|
|
104
|
-
export declare type Fixtures<T extends {} = {}, W extends {} = {}> = Fixtures_2<T, W, BaseTestArgs, BaseWorkerArgs>;
|
|
76
|
+
export declare type Fixtures<T extends {} = {}, W extends {} = {}> = Fixtures_2<T, W, PlaywrightBaseTestArgs, PlaywrightBaseWorkerArgs>;
|
|
105
77
|
|
|
106
78
|
/**
|
|
107
79
|
* @internal
|
|
@@ -156,7 +128,7 @@ export declare function hoverByBoundingBox(page: Page, locator: Locator, options
|
|
|
156
128
|
* @internal
|
|
157
129
|
*/
|
|
158
130
|
export declare interface ICreateTestOptions<T extends {} = {}, W extends {} = {}> extends ICustomCreateTestOptions {
|
|
159
|
-
fixtures?:
|
|
131
|
+
fixtures?: Fixtures_2<T, W>;
|
|
160
132
|
}
|
|
161
133
|
|
|
162
134
|
/**
|
|
@@ -172,19 +144,18 @@ export declare interface ICustomCreateTestOptions {
|
|
|
172
144
|
*/
|
|
173
145
|
export declare interface IDescribe extends IDescribeFunction {
|
|
174
146
|
skip: IDescribeFunction;
|
|
175
|
-
only:
|
|
176
|
-
configure:
|
|
177
|
-
fixme:
|
|
178
|
-
serial:
|
|
179
|
-
parallel:
|
|
147
|
+
only: IDescribeFunction;
|
|
148
|
+
configure: PlaywrightDescribeConfigure;
|
|
149
|
+
fixme: IDescribeFunction;
|
|
150
|
+
serial: PlaywrightDescribeSerial;
|
|
151
|
+
parallel: PlaywrightDescribeParallel;
|
|
180
152
|
}
|
|
181
153
|
|
|
182
154
|
/**
|
|
183
155
|
* @internal
|
|
184
|
-
* Call signatures of the overridden `test.describe` and `test.describe.
|
|
156
|
+
* Call signatures of the overridden `test.describe`, `test.describe.only`, `test.describe.skip` and `test.describe.fixme`.
|
|
185
157
|
*/
|
|
186
158
|
export declare interface IDescribeFunction {
|
|
187
|
-
(title: string, callback: Callback): void;
|
|
188
159
|
(title: string, details: ITestDetails, callback: Callback): void;
|
|
189
160
|
}
|
|
190
161
|
|
|
@@ -307,14 +278,6 @@ export declare interface ISnapshotAndSaveRecordingOptions {
|
|
|
307
278
|
sanitizeMappings?: (mappings: IGoodmockMapping[]) => IGoodmockMapping[];
|
|
308
279
|
}
|
|
309
280
|
|
|
310
|
-
/**
|
|
311
|
-
* @internal
|
|
312
|
-
*/
|
|
313
|
-
export declare type ITest = Test & {
|
|
314
|
-
topLevelDescribe: ITopLevelDescribe;
|
|
315
|
-
describe: IDescribe;
|
|
316
|
-
};
|
|
317
|
-
|
|
318
281
|
/**
|
|
319
282
|
* @internal
|
|
320
283
|
*/
|
|
@@ -335,7 +298,6 @@ export declare interface ITopLevelDescribe extends ITopLevelDescribeFunction {
|
|
|
335
298
|
* Call signatures of the overridden `test.describe` and `test.describe.skip`.
|
|
336
299
|
*/
|
|
337
300
|
export declare interface ITopLevelDescribeFunction {
|
|
338
|
-
(suiteName: string, specName: string, fn: Callback): void;
|
|
339
301
|
(suiteName: string, specName: string, details: ITestDetails, fn: Callback): void;
|
|
340
302
|
}
|
|
341
303
|
|
|
@@ -363,6 +325,43 @@ export declare function loadMappings(host: string, mappingFilePath: string): Pro
|
|
|
363
325
|
*/
|
|
364
326
|
export declare function mockLogRequests(host: string): Promise<void>;
|
|
365
327
|
|
|
328
|
+
/**
|
|
329
|
+
* @internal
|
|
330
|
+
* Like `T & U`, but properties in `U` replace those in `T` instead of merging, and `T` stays callable.
|
|
331
|
+
*/
|
|
332
|
+
export declare type Override<T, U> = CallSignatures<T> & Omit<T, keyof U> & U;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @internal
|
|
336
|
+
*/
|
|
337
|
+
export declare type PlaywrightBaseTestArgs = PlaywrightTestArgs & PlaywrightTestOptions;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @internal
|
|
341
|
+
*/
|
|
342
|
+
export declare type PlaywrightBaseWorkerArgs = PlaywrightWorkerArgs & PlaywrightWorkerOptions;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* @internal
|
|
346
|
+
*/
|
|
347
|
+
export declare type PlaywrightDescribeConfigure = typeof test.describe.configure;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @internal
|
|
351
|
+
*/
|
|
352
|
+
export declare type PlaywrightDescribeParallel = typeof test.describe.parallel;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
export declare type PlaywrightDescribeSerial = typeof test.describe.serial;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @internal
|
|
361
|
+
*/
|
|
362
|
+
declare type PlaywrightTest_2 = typeof test;
|
|
363
|
+
export { PlaywrightTest_2 as PlaywrightTest }
|
|
364
|
+
|
|
366
365
|
/**
|
|
367
366
|
* @internal
|
|
368
367
|
* Clear all goodmock stub mappings.
|
|
@@ -403,7 +402,10 @@ export declare function startRecording(host: string, backendHost: string): Promi
|
|
|
403
402
|
/**
|
|
404
403
|
* @internal
|
|
405
404
|
*/
|
|
406
|
-
export declare type Test =
|
|
405
|
+
export declare type Test = Override<PlaywrightTest_2, {
|
|
406
|
+
topLevelDescribe: ITopLevelDescribe;
|
|
407
|
+
describe: IDescribe;
|
|
408
|
+
}>;
|
|
407
409
|
|
|
408
410
|
/**
|
|
409
411
|
* @internal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-e2e-utils",
|
|
3
|
-
"version": "11.61.0-alpha.
|
|
3
|
+
"version": "11.61.0-alpha.1",
|
|
4
4
|
"description": "GoodData utility functions for Playwright E2E tests",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"oxlint-plugin-eslint": "1.82.0",
|
|
50
50
|
"oxlint-tsgolint": "7.0.2001",
|
|
51
51
|
"typescript": "7.0.2",
|
|
52
|
-
"@gooddata/eslint-config": "11.61.0-alpha.
|
|
53
|
-
"@gooddata/oxlint-config": "11.61.0-alpha.
|
|
52
|
+
"@gooddata/eslint-config": "11.61.0-alpha.1",
|
|
53
|
+
"@gooddata/oxlint-config": "11.61.0-alpha.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"_phase:build": "npm run build",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TestDetails } from "@playwright/test";
|
|
2
|
-
import type { Describe, DescribeFixme, DescribeOnly, DescribeSkip } from "./playwright-types.js";
|
|
3
|
-
import type { ITestDetails } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export type Callback = () => void;
|
|
8
|
-
export type OriginalFn = Describe | DescribeFixme | DescribeOnly | DescribeSkip;
|
|
9
|
-
/** Call a Playwright describe function, passing details only when there are any. */
|
|
10
|
-
export declare function callOriginalFn(originalFn: OriginalFn, title: string, pwDetails: TestDetails | undefined, callback: Callback): void;
|
|
11
|
-
/** Strip custom fields before passing details to Playwright. */
|
|
12
|
-
export declare function toPlaywrightDetails(details: ITestDetails | undefined): TestDetails | undefined;
|
|
13
|
-
export declare function parseArgs(detailsOrFn: ITestDetails | Callback, func?: Callback): {
|
|
14
|
-
details: ITestDetails | undefined;
|
|
15
|
-
fn: Callback;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=call-original-fn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"call-original-fn.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/call-original-fn.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhF,oFAAoF;AACpF,wBAAgB,cAAc,CAC1B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,WAAW,GAAG,SAAS,EAClC,QAAQ,EAAE,QAAQ,GACnB,IAAI,CAMN;AAED,gEAAgE;AAChE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAK9F;AAED,wBAAgB,SAAS,CACrB,WAAW,EAAE,YAAY,GAAG,QAAQ,EACpC,IAAI,CAAC,EAAE,QAAQ,GAChB;IAAE,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;IAAC,EAAE,EAAE,QAAQ,CAAA;CAAE,CAMrD"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
/** Call a Playwright describe function, passing details only when there are any. */
|
|
3
|
-
export function callOriginalFn(originalFn, title, pwDetails, callback) {
|
|
4
|
-
if (pwDetails) {
|
|
5
|
-
originalFn(title, pwDetails, callback);
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
originalFn(title, callback);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/** Strip custom fields before passing details to Playwright. */
|
|
12
|
-
export function toPlaywrightDetails(details) {
|
|
13
|
-
if (!details)
|
|
14
|
-
return undefined;
|
|
15
|
-
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
-
const { workspaceSettings: _ws, additionalWindowProperties: _awp, ...rest } = details;
|
|
17
|
-
return Object.keys(rest).length > 0 ? rest : undefined;
|
|
18
|
-
}
|
|
19
|
-
export function parseArgs(detailsOrFn, func) {
|
|
20
|
-
const hasDetails = typeof detailsOrFn !== "function";
|
|
21
|
-
return {
|
|
22
|
-
details: hasDetails ? detailsOrFn : undefined,
|
|
23
|
-
fn: hasDetails ? func : detailsOrFn,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type Callback, type OriginalFn } from "../call-original-fn.js";
|
|
2
|
-
import type { DescribeConfigure, DescribeFixme, DescribeOnly, DescribeParallel, DescribeSerial, Test } from "../playwright-types.js";
|
|
3
|
-
import type { ITestDetails, WindowProperties, WorkspaceSettings } from "../types.js";
|
|
4
|
-
export interface IGetInsideTopLevelDescribe {
|
|
5
|
-
(): boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
* Call signatures of the overridden `test.describe` and `test.describe.skip`.
|
|
10
|
-
*/
|
|
11
|
-
export interface IDescribeFunction {
|
|
12
|
-
(title: string, callback: Callback): void;
|
|
13
|
-
(title: string, details: ITestDetails, callback: Callback): void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export interface IDescribe extends IDescribeFunction {
|
|
19
|
-
skip: IDescribeFunction;
|
|
20
|
-
only: DescribeOnly;
|
|
21
|
-
configure: DescribeConfigure;
|
|
22
|
-
fixme: DescribeFixme;
|
|
23
|
-
serial: DescribeSerial;
|
|
24
|
-
parallel: DescribeParallel;
|
|
25
|
-
}
|
|
26
|
-
export declare function makeDescribeFunction(originalFn: OriginalFn, testInstance: Test, settingsStack: WorkspaceSettings[], awpStack: WindowProperties[], getInsideTopLevelDescribe: IGetInsideTopLevelDescribe): IDescribeFunction;
|
|
27
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/create-test/playwright/describe/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,UAAU,EAIlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACR,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,IAAI,EACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrF,MAAM,WAAW,0BAA0B;IACvC,IAAI,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1C,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAChD,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;CAC9B;AAaD,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,IAAI,EAClB,aAAa,EAAE,iBAAiB,EAAE,EAClC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,yBAAyB,EAAE,0BAA0B,GACtD,iBAAiB,CAanB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { callOriginalFn, parseArgs, toPlaywrightDetails, } from "../call-original-fn.js";
|
|
3
|
-
import { withDescribeDetails } from "../with-describe-details.js";
|
|
4
|
-
/** Normalize the three describe overloads: `(title, cb)` and `(title, details, cb)`. */
|
|
5
|
-
function parseDescribeArgs(detailsOrCb, cb) {
|
|
6
|
-
const { details, fn } = parseArgs(detailsOrCb, cb);
|
|
7
|
-
return { details, callback: fn };
|
|
8
|
-
}
|
|
9
|
-
export function makeDescribeFunction(originalFn, testInstance, settingsStack, awpStack, getInsideTopLevelDescribe) {
|
|
10
|
-
return (title, detailsOrCb, cb) => {
|
|
11
|
-
const { details, callback } = parseDescribeArgs(detailsOrCb, cb);
|
|
12
|
-
if (!getInsideTopLevelDescribe()) {
|
|
13
|
-
const call = title === undefined ? "test.describe()" : `test.describe("${title}")`;
|
|
14
|
-
throw new Error(`${call} must be nested inside a test.topLevelDescribe() block.`);
|
|
15
|
-
}
|
|
16
|
-
callOriginalFn(originalFn, title, toPlaywrightDetails(details), () => withDescribeDetails(testInstance, settingsStack, awpStack, details, callback));
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/create-test/playwright/test/factory.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAyDzG"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
// oxlint-disable typescript-eslint/no-empty-object-type
|
|
3
|
-
import { test } from "@playwright/test";
|
|
4
|
-
import { makeDescribeFunction } from "../describe/factory.js";
|
|
5
|
-
import { makeTopLevelDescribeFunction } from "../top-level-describe/factory.js";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
* @param options -
|
|
9
|
-
*/
|
|
10
|
-
export function createTest(options) {
|
|
11
|
-
// Tracks whether we're inside a topLevelDescribe during synchronous registration.
|
|
12
|
-
let insideTopLevelDescribe = false;
|
|
13
|
-
function getInsideTopLevelDescribe() {
|
|
14
|
-
return insideTopLevelDescribe;
|
|
15
|
-
}
|
|
16
|
-
function setInsideTopLevelDescribe(value) {
|
|
17
|
-
insideTopLevelDescribe = value;
|
|
18
|
-
}
|
|
19
|
-
// Stacks track workspace settings / additionalWindowProperties hierarchy during
|
|
20
|
-
// synchronous describe registration. Each level merges on top of the parent's.
|
|
21
|
-
// The beforeEach at each level captures the fully-merged snapshot, so the
|
|
22
|
-
// innermost beforeEach (which runs last) wins.
|
|
23
|
-
const settingsStack = [];
|
|
24
|
-
const awpStack = [];
|
|
25
|
-
const testInstance = options.fixtures ? test.extend(options.fixtures) : test;
|
|
26
|
-
const makeDescribeWrapper = (originalFn) => makeDescribeFunction(originalFn, testInstance, settingsStack, awpStack, getInsideTopLevelDescribe);
|
|
27
|
-
const makeTopLevelDescribeWrapper = (originalFn) => makeTopLevelDescribeFunction(originalFn, testInstance, options, settingsStack, awpStack, setInsideTopLevelDescribe);
|
|
28
|
-
const describe = Object.assign(makeDescribeWrapper(testInstance.describe), testInstance.describe, {
|
|
29
|
-
only: makeDescribeWrapper(testInstance.describe.only),
|
|
30
|
-
fixme: makeDescribeWrapper(testInstance.describe.fixme),
|
|
31
|
-
skip: makeDescribeWrapper(testInstance.describe.skip),
|
|
32
|
-
});
|
|
33
|
-
const topLevelDescribe = Object.assign(makeTopLevelDescribeWrapper(testInstance.describe), {
|
|
34
|
-
skip: makeTopLevelDescribeWrapper(testInstance.describe.skip),
|
|
35
|
-
});
|
|
36
|
-
return Object.assign(testInstance.bind(undefined), testInstance, {
|
|
37
|
-
/** Build the overridden `test.describe` (with its `.skip`, `.only`, `.fixme`) for a single `createTest` instance. */
|
|
38
|
-
describe,
|
|
39
|
-
/** Build `test.topLevelDescribe` (with its `.skip`) for a single `createTest` instance. */
|
|
40
|
-
topLevelDescribe,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { IFeatureHubEnvironment } from "../../feature-hub/types.js";
|
|
2
|
-
import type { IGoodmockOptions } from "../../goodmock/types.js";
|
|
3
|
-
import type { IDescribe } from "../describe/factory.js";
|
|
4
|
-
import type { Fixtures } from "../fixtures.js";
|
|
5
|
-
import type { Test } from "../playwright-types.js";
|
|
6
|
-
import type { ITopLevelDescribe } from "../top-level-describe/types.js";
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export interface ICustomCreateTestOptions {
|
|
11
|
-
featureHubResponse: IFeatureHubEnvironment[];
|
|
12
|
-
goodmock?: IGoodmockOptions;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export interface ICreateTestOptions<T extends {} = {}, W extends {} = {}> extends ICustomCreateTestOptions {
|
|
18
|
-
fixtures?: Fixtures<T, W>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export type ITest = Test & {
|
|
24
|
-
topLevelDescribe: ITopLevelDescribe;
|
|
25
|
-
describe: IDescribe;
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/create-test/playwright/test/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,kBAAkB,EAAE,sBAAsB,EAAE,CAAC;IAC7C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,wBAAwB;IACtG,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,IAAI,GAAG;IACvB,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACvB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Callback } from "../call-original-fn.js";
|
|
2
|
-
import type { Test } from "../playwright-types.js";
|
|
3
|
-
import type { ICustomCreateTestOptions } from "../test/types.js";
|
|
4
|
-
import type { ITestDetails, WindowProperties, WorkspaceSettings } from "../types.js";
|
|
5
|
-
export interface ISetInsideTopLevelDescribe {
|
|
6
|
-
(value: boolean): void;
|
|
7
|
-
}
|
|
8
|
-
export declare function buildSuiteCallback(testInstance: Test, options: ICustomCreateTestOptions, settingsStack: WorkspaceSettings[], awpStack: WindowProperties[], setInsideTopLevelDescribe: ISetInsideTopLevelDescribe, specName: string, details: ITestDetails | undefined, fn: Callback): Callback;
|
|
9
|
-
//# sourceMappingURL=build-suite-callback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-suite-callback.d.ts","sourceRoot":"","sources":["../../../../src/create-test/playwright/top-level-describe/build-suite-callback.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrF,MAAM,WAAW,0BAA0B;IACvC,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B;AAED,wBAAgB,kBAAkB,CAC9B,YAAY,EAAE,IAAI,EAClB,OAAO,EAAE,wBAAwB,EACjC,aAAa,EAAE,iBAAiB,EAAE,EAClC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,yBAAyB,EAAE,0BAA0B,EACrD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,EAAE,EAAE,QAAQ,GACb,QAAQ,CAcV"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { registerFeatureHubMock } from "../../feature-hub/mock.js";
|
|
3
|
-
import { registerGoodmockHooks } from "../../goodmock/playwright.js";
|
|
4
|
-
import { withDescribeDetails } from "../with-describe-details.js";
|
|
5
|
-
export function buildSuiteCallback(testInstance, options, settingsStack, awpStack, setInsideTopLevelDescribe, specName, details, fn) {
|
|
6
|
-
return () => {
|
|
7
|
-
registerFeatureHubMock(testInstance, options.featureHubResponse);
|
|
8
|
-
if (options.goodmock?.host) {
|
|
9
|
-
registerGoodmockHooks(testInstance, options.goodmock, specName);
|
|
10
|
-
}
|
|
11
|
-
// Workspace settings + additional window properties — merge with parent
|
|
12
|
-
// stack and inject beforeEach. Wraps fn() so nested describes inherit.
|
|
13
|
-
setInsideTopLevelDescribe(true);
|
|
14
|
-
withDescribeDetails(testInstance, settingsStack, awpStack, details, fn);
|
|
15
|
-
setInsideTopLevelDescribe(false);
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type OriginalFn } from "../call-original-fn.js";
|
|
2
|
-
import type { Test } from "../playwright-types.js";
|
|
3
|
-
import type { ICreateTestOptions } from "../test/types.js";
|
|
4
|
-
import type { WorkspaceSettings } from "../types.js";
|
|
5
|
-
import { type ISetInsideTopLevelDescribe } from "./build-suite-callback.js";
|
|
6
|
-
import type { ITopLevelDescribeFunction } from "./types.js";
|
|
7
|
-
export declare function makeTopLevelDescribeFunction<T extends {} = {}, W extends {} = {}>(originalFn: OriginalFn, testInstance: Test, options: ICreateTestOptions<T, W>, settingsStack: WorkspaceSettings[], awpStack: WorkspaceSettings[], setInsideTopLevelDescribe: ISetInsideTopLevelDescribe): ITopLevelDescribeFunction;
|
|
8
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/create-test/playwright/top-level-describe/factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,UAAU,EAIlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,KAAK,0BAA0B,EAAsB,MAAM,2BAA2B,CAAC;AAChG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,EAC7E,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,IAAI,EAClB,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EACjC,aAAa,EAAE,iBAAiB,EAAE,EAClC,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,yBAAyB,EAAE,0BAA0B,GACtD,yBAAyB,CAiB3B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
// oxlint-disable typescript/no-empty-object-type
|
|
3
|
-
import { callOriginalFn, parseArgs, toPlaywrightDetails, } from "../call-original-fn.js";
|
|
4
|
-
import { buildSuiteCallback } from "./build-suite-callback.js";
|
|
5
|
-
export function makeTopLevelDescribeFunction(originalFn, testInstance, options, settingsStack, awpStack, setInsideTopLevelDescribe) {
|
|
6
|
-
return (suiteName, specName, detailsOrFn, func) => {
|
|
7
|
-
const { details, fn } = parseArgs(detailsOrFn, func);
|
|
8
|
-
const suite = buildSuiteCallback(testInstance, options, settingsStack, awpStack, setInsideTopLevelDescribe, specName, details, fn);
|
|
9
|
-
const pwDetails = toPlaywrightDetails(details);
|
|
10
|
-
callOriginalFn(originalFn, suiteName, pwDetails, suite);
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Callback } from "../call-original-fn.js";
|
|
2
|
-
import type { ITestDetails } from "../types.js";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
* Call signatures of the overridden `test.describe` and `test.describe.skip`.
|
|
6
|
-
*/
|
|
7
|
-
export interface ITopLevelDescribeFunction {
|
|
8
|
-
(suiteName: string, specName: string, fn: Callback): void;
|
|
9
|
-
(suiteName: string, specName: string, details: ITestDetails, fn: Callback): void;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export interface ITopLevelDescribe extends ITopLevelDescribeFunction {
|
|
15
|
-
skip: ITopLevelDescribeFunction;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/create-test/playwright/top-level-describe/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1D,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;CACpF;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,yBAAyB;IAChE,IAAI,EAAE,yBAAyB,CAAC;CAOnC"}
|