@gooddata/sdk-e2e-utils 11.62.0-alpha.3 → 11.62.0-alpha.4

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.
@@ -1,8 +1,5 @@
1
1
  import type { Page } from "@playwright/test";
2
2
  import type { IFeatureHubEnvironment, IFeatureHubFeature } from "./types.js";
3
- /**
4
- * @internal
5
- */
6
3
  export declare function makeFeatureHubResponse(features: IFeatureHubFeature[]): IFeatureHubEnvironment[];
7
4
  /** FeatureHub mock — each test gets a fresh page, so route dies with it. */
8
5
  export declare function registerFeatureHubMock(page: Page, features: IFeatureHubFeature[]): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/create-test/feature-hub/mock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAI7E;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,sBAAsB,EAAE,CAO/F;AAED,4EAA4E;AAC5E,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWtG;AAED,+EAA+E;AAC/E,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE;AAED,iFAAiF;AACjF,wBAAsB,wBAAwB,CAC1C,IAAI,EAAE,IAAI,EACV,kBAAkB,EAAE,kBAAkB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CAGf"}
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/create-test/feature-hub/mock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAI7E,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,sBAAsB,EAAE,CAO/F;AAED,4EAA4E;AAC5E,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWtG;AAED,+EAA+E;AAC/E,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE;AAED,iFAAiF;AACjF,wBAAsB,wBAAwB,CAC1C,IAAI,EAAE,IAAI,EACV,kBAAkB,EAAE,kBAAkB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -1,8 +1,5 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  const FEATURE_HUB_ROUTE = "**/features*";
3
- /**
4
- * @internal
5
- */
6
3
  export function makeFeatureHubResponse(features) {
7
4
  return [
8
5
  {
@@ -15,9 +15,6 @@ export interface IFeatureHubFeature {
15
15
  strategies?: unknown[];
16
16
  v?: string;
17
17
  }
18
- /**
19
- * @internal
20
- */
21
18
  export interface IFeatureHubEnvironment {
22
19
  id: string;
23
20
  features: IFeatureHubFeature[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/create-test/feature-hub/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,OAAO,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/create-test/feature-hub/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,OAAO,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/factory.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACR,sBAAsB,EACtB,wBAAwB,EAE3B,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAER,kBAAkB,EAElB,IAAI,EACJ,6BAA6B,EAGhC,MAAM,YAAY,CAAC;AAGpB;;;GAGG;AACH,wBAAgB,UAAU,CACtB,mBAAmB,SAAS,6BAA6B,GAAG,KAAK,EACjE,CAAC,SAAS,EAAE,GAAG,EAAE,EACjB,CAAC,SAAS,EAAE,GAAG,EAAE,EAEjB,OAAO,EAAE,kBAAkB,CAAC,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC,GACvD,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,GAAG,CAAC,EAAE,wBAAwB,GAAG,CAAC,CAAC,CAwNrF"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/factory.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACR,sBAAsB,EACtB,wBAAwB,EAE3B,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAGR,kBAAkB,EAElB,IAAI,EACJ,6BAA6B,EAEhC,MAAM,YAAY,CAAC;AAGpB;;;GAGG;AACH,wBAAgB,UAAU,CACtB,mBAAmB,SAAS,6BAA6B,GAAG,KAAK,EACjE,CAAC,SAAS,EAAE,GAAG,EAAE,EACjB,CAAC,SAAS,EAAE,GAAG,EAAE,EAEjB,OAAO,EAAE,kBAAkB,CAAC,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC,GACvD,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,GAAG,CAAC,EAAE,wBAAwB,GAAG,CAAC,CAAC,CAgOrF"}
@@ -15,14 +15,14 @@ import { withDescribeDetails, withTestDetails } from "./with-describe-details.js
15
15
  export function createTest(options) {
16
16
  // Tracks whether we're inside the outermost describe of a spec file during synchronous registration.
17
17
  let insideRootDescribe = false;
18
- // Stacks track workspace settings / additionalWindowProperties / FeatureHub features hierarchy
19
- // during synchronous describe registration. Each level merges on top of the parent's.
18
+ // Stacks track additionalWindowProperties / feature flags hierarchy during synchronous
19
+ // describe registration. Each level merges on top of the parent's.
20
20
  // The beforeEach at each level captures the fully-merged snapshot, so the
21
21
  // innermost beforeEach (which runs last) wins.
22
- // The features stack starts with the defaults, so every level merges on top of them.
23
- const settingsStack = [];
22
+ // The flags stack holds raw flag records; they are converted to FeatureHub features and merged
23
+ // onto the defaults only when applied.
24
24
  const awpStack = [];
25
- const featuresStack = [options.featureHubFeatures];
25
+ const flagsStack = [];
26
26
  // Combined test conditions and titles of the enclosing describes, during synchronous registration.
27
27
  // Describes only feed these; each test decides for itself whether it runs (a describe whose own
28
28
  // conditions are false may still contain tests whose combined conditions are true).
@@ -55,7 +55,7 @@ export function createTest(options) {
55
55
  assertValidConditions(details.conditions, `${name}("${title}")`);
56
56
  const pwDetails = toPlaywrightDetails(details);
57
57
  if (insideRootDescribe) {
58
- internals.describe(type, location, title, pwDetails, () => withDescribeScope(title, details, () => withDescribeDetails(testInstance, settingsStack, awpStack, featuresStack, details, callback)));
58
+ internals.describe(type, location, title, pwDetails, () => withDescribeScope(title, details, () => withDescribeDetails(testInstance, options.featureHubFeatures, awpStack, flagsStack, details, callback)));
59
59
  return;
60
60
  }
61
61
  // Outermost describe of the spec file: it also sets up the spec.
@@ -76,11 +76,11 @@ export function createTest(options) {
76
76
  if (options.goodmock) {
77
77
  registerGoodmockHooks(testInstance, options.goodmock, specName);
78
78
  }
79
- // Workspace settings + additional window properties — merge with parent
79
+ // Feature flags + additional window properties — merge with parent
80
80
  // stack and inject beforeEach. Wraps the callback so nested describes inherit.
81
81
  insideRootDescribe = true;
82
82
  try {
83
- withDescribeScope(title, details, () => withDescribeDetails(testInstance, settingsStack, awpStack, featuresStack, details, callback));
83
+ withDescribeScope(title, details, () => withDescribeDetails(testInstance, options.featureHubFeatures, awpStack, flagsStack, details, callback));
84
84
  }
85
85
  finally {
86
86
  // Reset even if the body throws, so the next spec file starts outside again.
@@ -119,7 +119,7 @@ export function createTest(options) {
119
119
  register(location, title, body);
120
120
  return;
121
121
  }
122
- withTestDetails(testInstance, settingsStack, awpStack, featuresStack, location, title, details);
122
+ withTestDetails(testInstance, options.featureHubFeatures, awpStack, flagsStack, location, title, details);
123
123
  register(location, title, toPlaywrightDetails(details), body);
124
124
  };
125
125
  return testFunction;
@@ -1 +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,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAE9E,gEAAgE;AAChE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,WAAW,CAUrG"}
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,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAE9E,gEAAgE;AAChE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,WAAW,CAIrG"}
@@ -2,6 +2,6 @@
2
2
  /** Strip custom fields before passing details to Playwright. */
3
3
  export function toPlaywrightDetails(details) {
4
4
  // oxlint-disable-next-line @typescript-eslint/no-unused-vars
5
- const { workspaceSettings: _ws, additionalWindowProperties: _awp, featureFlags: _ff, conditions: _c, ...rest } = details;
5
+ const { additionalWindowProperties: _awp, featureFlags: _ff, conditions: _c, ...rest } = details;
6
6
  return Object.keys(rest).length > 0 ? rest : {};
7
7
  }
@@ -92,10 +92,6 @@ export type ICreateTestOptions<TestConditionsValue extends TestConditionsValueCo
92
92
  } & ([TestConditionsValue] extends [never] ? {} : {
93
93
  testConditions: ITestConditions<TestConditionsValue>;
94
94
  });
95
- /**
96
- * @internal
97
- */
98
- export type WorkspaceSettings = Record<string, unknown>;
99
95
  /**
100
96
  * @internal
101
97
  */
@@ -107,12 +103,11 @@ export type FeatureFlagValue = FeatureHubFeatureValue | object;
107
103
  /**
108
104
  * @internal
109
105
  */
110
- export type FeatureFlags = Record<string, FeatureHubFeatureValue>;
106
+ export type FeatureFlags = Record<string, FeatureFlagValue>;
111
107
  /**
112
108
  * @internal
113
109
  */
114
110
  export interface ITestDetails<TestConditionsValue extends TestConditionsValueConstraint = never> extends TestDetails {
115
- workspaceSettings?: WorkspaceSettings;
116
111
  additionalWindowProperties?: WindowProperties;
117
112
  /** Feature flags for this describe/test, merged on top of the enclosing describes' (own keys win). */
118
113
  featureFlags?: FeatureFlags;
@@ -122,8 +117,7 @@ export interface ITestDetails<TestConditionsValue extends TestConditionsValueCon
122
117
  /**
123
118
  * @internal
124
119
  * Call signatures that register a test: `test`, `test.only`, `test.fail.only`.
125
- * Same as Playwright's, except `details` also accepts `workspaceSettings` / `additionalWindowProperties` /
126
- * `featureFlags` / `conditions`.
120
+ * Same as Playwright's, except `details` also accepts `featureFlags` / `additionalWindowProperties` / `conditions`.
127
121
  */
128
122
  export interface ITestFunction<TestConditionsValue extends TestConditionsValueConstraint, TestArgs extends {}, WorkerArgs extends {}> {
129
123
  (title: string, body: PlaywrightTestBody<TestArgs & WorkerArgs>): void;
@@ -1 +1 @@
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,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EACR,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EACrB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,mBAAmB,SAAS,6BAA6B,GAAG,KAAK;IAChG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,mBAAmB,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzF;AAED;;;G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AAE,UAAU,CAAC,CAAC;IACvE,KAAK,EAAE,qBAAqB,CAAC,mBAAmB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IACxE,IAAI,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IACnE,QAAQ,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;CAC5C,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import type { IFeatureHubFeature } from "../feature-hub/types.js";
2
2
  import type { IPlaywrightLocation } from "./playwright-internals.js";
3
3
  import type { PlaywrightTestInstance } from "./playwright-types.js";
4
- import type { Callback, ITestDetails, TestConditionsValueConstraint, WindowProperties, WorkspaceSettings } from "./types.js";
5
- /** Push merged settings/awp/features onto stacks, register the beforeEach hooks, call fn, pop. */
6
- export declare function withDescribeDetails(testInstance: PlaywrightTestInstance, settingsStack: WorkspaceSettings[], awpStack: WindowProperties[], featuresStack: IFeatureHubFeature[][], details: ITestDetails<TestConditionsValueConstraint> | undefined, fn: Callback): void;
4
+ import type { Callback, FeatureFlags, ITestDetails, TestConditionsValueConstraint, WindowProperties } from "./types.js";
5
+ /** Push merged awp/flags onto stacks, register the beforeEach hooks, call fn, pop. */
6
+ export declare function withDescribeDetails(testInstance: PlaywrightTestInstance, defaultFeatures: IFeatureHubFeature[], awpStack: WindowProperties[], flagsStack: FeatureFlags[], details: ITestDetails<TestConditionsValueConstraint> | undefined, fn: Callback): void;
7
7
  /**
8
- * Register a single test's own settings/awp/features, merged on top of the enclosing describes'.
8
+ * Register a single test's own awp/flags, merged on top of the enclosing describes'.
9
9
  * The beforeEach is registered next to the test, after the enclosing describes' injection hooks,
10
10
  * so it runs last and its values win.
11
11
  */
12
- export declare function withTestDetails(testInstance: PlaywrightTestInstance, settingsStack: WorkspaceSettings[], awpStack: WindowProperties[], featuresStack: IFeatureHubFeature[][], location: IPlaywrightLocation, title: string, details: ITestDetails<TestConditionsValueConstraint> | undefined): void;
12
+ export declare function withTestDetails(testInstance: PlaywrightTestInstance, defaultFeatures: IFeatureHubFeature[], awpStack: WindowProperties[], flagsStack: FeatureFlags[], location: IPlaywrightLocation, title: string, details: ITestDetails<TestConditionsValueConstraint> | undefined): void;
13
13
  //# 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":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EACR,QAAQ,EACR,YAAY,EACZ,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,YAAY,CAAC;AAUpB,kGAAkG;AAClG,wBAAgB,mBAAmB,CAC/B,YAAY,EAAE,sBAAsB,EACpC,aAAa,EAAE,iBAAiB,EAAE,EAClC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,aAAa,EAAE,kBAAkB,EAAE,EAAE,EACrC,OAAO,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAChE,EAAE,EAAE,QAAQ,QAiCf;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,YAAY,EAAE,sBAAsB,EACpC,aAAa,EAAE,iBAAiB,EAAE,EAClC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,aAAa,EAAE,kBAAkB,EAAE,EAAE,EACrC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,GACjE,IAAI,CA+BN"}
1
+ {"version":3,"file":"with-describe-details.d.ts","sourceRoot":"","sources":["../../../src/create-test/playwright/with-describe-details.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,6BAA6B,EAC7B,gBAAgB,EACnB,MAAM,YAAY,CAAC;AAMpB,sFAAsF;AACtF,wBAAgB,mBAAmB,CAC/B,YAAY,EAAE,sBAAsB,EACpC,eAAe,EAAE,kBAAkB,EAAE,EACrC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAChE,EAAE,EAAE,QAAQ,QA2Bf;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,YAAY,EAAE,sBAAsB,EACpC,eAAe,EAAE,kBAAkB,EAAE,EACrC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,UAAU,EAAE,YAAY,EAAE,EAC1B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,GACjE,IAAI,CA2BN"}
@@ -5,34 +5,25 @@ import { flagsToFeatures } from "./flag-to-feature.js";
5
5
  function peekOrEmpty(stack) {
6
6
  return stack.length > 0 ? stack[stack.length - 1] : {};
7
7
  }
8
- function peekFeatures(stack) {
9
- return stack.length > 0 ? stack[stack.length - 1] : [];
10
- }
11
- /** Push merged settings/awp/features onto stacks, register the beforeEach hooks, call fn, pop. */
12
- export function withDescribeDetails(testInstance, settingsStack, awpStack, featuresStack, details, fn) {
13
- const ws = details?.workspaceSettings;
8
+ /** Push merged awp/flags onto stacks, register the beforeEach hooks, call fn, pop. */
9
+ export function withDescribeDetails(testInstance, defaultFeatures, awpStack, flagsStack, details, fn) {
14
10
  const awp = details?.additionalWindowProperties;
15
11
  const ff = details?.featureFlags;
16
- if (!ws && !awp && !ff) {
12
+ if (!awp && !ff) {
17
13
  fn();
18
14
  return;
19
15
  }
20
- const mergedSettings = ws ? { ...peekOrEmpty(settingsStack), ...ws } : peekOrEmpty(settingsStack);
21
16
  const mergedAwp = awp ? { ...peekOrEmpty(awpStack), ...awp } : peekOrEmpty(awpStack);
22
- const mergedFeatures = ff
23
- ? mergeFeatureHubFeatures(peekFeatures(featuresStack), flagsToFeatures(ff))
24
- : peekFeatures(featuresStack);
25
- if (ws)
26
- settingsStack.push(mergedSettings);
17
+ const mergedFlags = ff ? { ...peekOrEmpty(flagsStack), ...ff } : peekOrEmpty(flagsStack);
27
18
  if (awp)
28
19
  awpStack.push(mergedAwp);
29
20
  if (ff)
30
- featuresStack.push(mergedFeatures);
31
- if (ws || awp) {
32
- injectWindowProperties(testInstance, mergedSettings, mergedAwp);
21
+ flagsStack.push(mergedFlags);
22
+ if (awp) {
23
+ injectWindowProperties(testInstance, mergedAwp);
33
24
  }
34
25
  if (ff) {
35
- injectFeatureHubMock(testInstance, mergedFeatures);
26
+ injectFeatureFlags(testInstance, defaultFeatures, mergedFlags);
36
27
  }
37
28
  try {
38
29
  fn();
@@ -40,30 +31,24 @@ export function withDescribeDetails(testInstance, settingsStack, awpStack, featu
40
31
  finally {
41
32
  // Pop even if the body throws, so later describes don't inherit this level's entries.
42
33
  if (ff)
43
- featuresStack.pop();
34
+ flagsStack.pop();
44
35
  if (awp)
45
36
  awpStack.pop();
46
- if (ws)
47
- settingsStack.pop();
48
37
  }
49
38
  }
50
39
  /**
51
- * Register a single test's own settings/awp/features, merged on top of the enclosing describes'.
40
+ * Register a single test's own awp/flags, merged on top of the enclosing describes'.
52
41
  * The beforeEach is registered next to the test, after the enclosing describes' injection hooks,
53
42
  * so it runs last and its values win.
54
43
  */
55
- export function withTestDetails(testInstance, settingsStack, awpStack, featuresStack, location, title, details) {
56
- const ws = details?.workspaceSettings;
44
+ export function withTestDetails(testInstance, defaultFeatures, awpStack, flagsStack, location, title, details) {
57
45
  const awp = details?.additionalWindowProperties;
58
46
  const ff = details?.featureFlags;
59
- if (!ws && !awp && !ff) {
47
+ if (!awp && !ff) {
60
48
  return;
61
49
  }
62
- const mergedSettings = ws ? { ...peekOrEmpty(settingsStack), ...ws } : peekOrEmpty(settingsStack);
63
50
  const mergedAwp = awp ? { ...peekOrEmpty(awpStack), ...awp } : peekOrEmpty(awpStack);
64
- const mergedFeatures = ff
65
- ? mergeFeatureHubFeatures(peekFeatures(featuresStack), flagsToFeatures(ff))
66
- : peekFeatures(featuresStack);
51
+ const mergedFlags = ff ? { ...peekOrEmpty(flagsStack), ...ff } : peekOrEmpty(flagsStack);
67
52
  testInstance.beforeEach(async ({ page }, testInfo) => {
68
53
  // A beforeEach applies to every test in its describe; only act for this test. Title is part
69
54
  // of the match because tests generated in a loop share one location.
@@ -73,34 +58,45 @@ export function withTestDetails(testInstance, settingsStack, awpStack, featuresS
73
58
  testInfo.column !== location.column) {
74
59
  return;
75
60
  }
76
- if (ws || awp) {
77
- await addWindowPropertiesInitScript(page, mergedSettings, mergedAwp);
61
+ if (awp) {
62
+ await addWindowPropertiesInitScript(page, mergedAwp);
78
63
  }
79
64
  if (ff) {
80
- await reregisterFeatureHubMock(page, mergedFeatures);
65
+ await applyFeatureFlags(page, defaultFeatures, mergedFlags);
81
66
  }
82
67
  });
83
68
  }
84
- /** Inject workspace settings and additional window properties via a single addInitScript. */
85
- function injectWindowProperties(testInst, settings, awp) {
69
+ /** Inject additional window properties via a single addInitScript. */
70
+ function injectWindowProperties(testInst, awp) {
86
71
  testInst.beforeEach(async ({ page }) => {
87
- await addWindowPropertiesInitScript(page, settings, awp);
72
+ await addWindowPropertiesInitScript(page, awp);
88
73
  });
89
74
  }
90
- /** Replace the FeatureHub mock registered by the root describe with one serving `features`. */
91
- function injectFeatureHubMock(testInst, features) {
75
+ /** Apply the merged feature flags of a describe level to every test in it. */
76
+ function injectFeatureFlags(testInst, defaultFeatures, flags) {
92
77
  testInst.beforeEach(async ({ page }) => {
93
- await reregisterFeatureHubMock(page, features);
78
+ await applyFeatureFlags(page, defaultFeatures, flags);
94
79
  });
95
80
  }
96
- async function addWindowPropertiesInitScript(page, settings, awp) {
97
- await page.addInitScript((args) => {
81
+ /**
82
+ * Serve `flags` on top of `defaultFeatures` from the FeatureHub mock and expose the raw flags as
83
+ * `window.customWorkspaceSettings`. Init scripts cannot be removed, but each one assigns the whole
84
+ * object, so the last registered level (the innermost) wins.
85
+ */
86
+ async function applyFeatureFlags(page, defaultFeatures, flags) {
87
+ await reregisterFeatureHubMock(page, mergeFeatureHubFeatures(defaultFeatures, flagsToFeatures(flags)));
88
+ await addCustomWorkspaceSettingsInitScript(page, flags);
89
+ }
90
+ async function addCustomWorkspaceSettingsInitScript(page, flags) {
91
+ await page.addInitScript((s) => {
92
+ window["customWorkspaceSettings"] = s;
93
+ }, flags);
94
+ }
95
+ async function addWindowPropertiesInitScript(page, awp) {
96
+ await page.addInitScript((a) => {
98
97
  const w = window;
99
- if (Object.keys(args.s).length > 0) {
100
- w["customWorkspaceSettings"] = args.s;
101
- }
102
- for (const [key, value] of Object.entries(args.a)) {
98
+ for (const [key, value] of Object.entries(a)) {
103
99
  w[key] = value;
104
100
  }
105
- }, { s: settings, a: awp });
101
+ }, awp);
106
102
  }
package/esm/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { authHeader, authedRouteFetch, injectAuthHeader } from "./auth.js";
2
2
  export { GOODMOCK_HOST, API_TOKEN, BACKEND_HOST, getBaseUrl, getEnvWithFallback, getWorkspaceId, getDangerWorkspaceId, } from "./constants.js";
3
- export type { IFeatureHubEnvironment, IFeatureHubFeature, FeatureHubFeatureValue, } from "./create-test/feature-hub/types.js";
4
- export { makeFeatureHubResponse } from "./create-test/feature-hub/mock.js";
3
+ export type { IFeatureHubFeature, FeatureHubFeatureValue } from "./create-test/feature-hub/types.js";
5
4
  export type { IGoodmockMapping, ILeakPattern, ISecretMapping, IWorkspaceIdMapping, IGoodmockOptions, } from "./create-test/goodmock/types.js";
6
5
  export { loadMappings, resetMappings, resetScenarios, mockLogRequests, startRecording, } from "./create-test/goodmock/admin.js";
7
6
  export { goodmockMode, GoodmockMode } from "./create-test/goodmock/mode.js";
@@ -9,6 +8,6 @@ export { snapshotAndSaveRecording, type ISnapshotAndSaveRecordingOptions, } from
9
8
  export { createTest } from "./create-test/playwright/factory.js";
10
9
  export type { Fixtures } from "./create-test/playwright/fixtures.js";
11
10
  export type { PlaywrightBaseTestArgs, PlaywrightBaseWorkerArgs, PlaywrightDescribeConfigure, PlaywrightConditionBody, PlaywrightTestBody, PlaywrightTestType, PlaywrightTestInstance, } from "./create-test/playwright/playwright-types.js";
12
- export type { Callback, FeatureFlags, ICreateTestOptions, ICustomCreateTestOptions, IDescribe, IDescribeFunction, IDescribeModeFunction, ITestConditions, ITestConditionsContext, ITestDetails, ITestFailFunction, ITestFunction, ITestModifierFunction, Test, TestConditionsValueConstraint, WindowProperties, WorkspaceSettings, } from "./create-test/playwright/types.js";
11
+ export type { Callback, FeatureFlags, FeatureFlagValue, ICreateTestOptions, ICustomCreateTestOptions, IDescribe, IDescribeFunction, IDescribeModeFunction, ITestConditions, ITestConditionsContext, ITestDetails, ITestFailFunction, ITestFunction, ITestModifierFunction, Test, TestConditionsValueConstraint, WindowProperties, } from "./create-test/playwright/types.js";
13
12
  export { clickByBoundingBox, hoverByBoundingBox } from "./helpers/mouse-actions.js";
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -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,Y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,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,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,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACzB,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACR,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,IAAI,EACJ,6BAA6B,EAC7B,gBAAgB,GACnB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
package/esm/index.js CHANGED
@@ -4,7 +4,6 @@
4
4
  export { authHeader, authedRouteFetch, injectAuthHeader } from "./auth.js";
5
5
  // constants
6
6
  export { GOODMOCK_HOST, API_TOKEN, BACKEND_HOST, getBaseUrl, getEnvWithFallback, getWorkspaceId, getDangerWorkspaceId, } from "./constants.js";
7
- export { makeFeatureHubResponse } from "./create-test/feature-hub/mock.js";
8
7
  export { loadMappings, resetMappings, resetScenarios, mockLogRequests, startRecording, } from "./create-test/goodmock/admin.js";
9
8
  export { goodmockMode, GoodmockMode } from "./create-test/goodmock/mode.js";
10
9
  export { snapshotAndSaveRecording, } from "./create-test/goodmock/snapshot/snapshot-and-save-recording.js";
@@ -62,7 +62,12 @@ export declare function createTest<TestConditionsValue extends TestConditionsVal
62
62
  /**
63
63
  * @internal
64
64
  */
65
- export declare type FeatureFlags = Record<string, FeatureHubFeatureValue>;
65
+ export declare type FeatureFlags = Record<string, FeatureFlagValue>;
66
+
67
+ /**
68
+ * @internal
69
+ */
70
+ export declare type FeatureFlagValue = FeatureHubFeatureValue | object;
66
71
 
67
72
  /**
68
73
  * @internal
@@ -171,14 +176,6 @@ export declare interface IDescribeModeFunction<TestConditionsValue extends TestC
171
176
  only: IDescribeFunction<TestConditionsValue>;
172
177
  }
173
178
 
174
- /**
175
- * @internal
176
- */
177
- export declare interface IFeatureHubEnvironment {
178
- id: string;
179
- features: IFeatureHubFeature[];
180
- }
181
-
182
179
  /**
183
180
  * @internal
184
181
  */
@@ -338,7 +335,6 @@ export declare interface ITestConditionsContext {
338
335
  * @internal
339
336
  */
340
337
  export declare interface ITestDetails<TestConditionsValue extends TestConditionsValueConstraint = never> extends TestDetails {
341
- workspaceSettings?: WorkspaceSettings;
342
338
  additionalWindowProperties?: WindowProperties;
343
339
  /** Feature flags for this describe/test, merged on top of the enclosing describes' (own keys win). */
344
340
  featureFlags?: FeatureFlags;
@@ -357,8 +353,7 @@ export declare interface ITestFailFunction<TestConditionsValue extends TestCondi
357
353
  /**
358
354
  * @internal
359
355
  * Call signatures that register a test: `test`, `test.only`, `test.fail.only`.
360
- * Same as Playwright's, except `details` also accepts `workspaceSettings` / `additionalWindowProperties` /
361
- * `featureFlags` / `conditions`.
356
+ * Same as Playwright's, except `details` also accepts `featureFlags` / `additionalWindowProperties` / `conditions`.
362
357
  */
363
358
  export declare interface ITestFunction<TestConditionsValue extends TestConditionsValueConstraint, TestArgs extends {}, WorkerArgs extends {}> {
364
359
  (title: string, body: PlaywrightTestBody<TestArgs & WorkerArgs>): void;
@@ -392,11 +387,6 @@ export declare interface IWorkspaceIdMapping {
392
387
  */
393
388
  export declare function loadMappings(host: string, mappingFilePath: string): Promise<void>;
394
389
 
395
- /**
396
- * @internal
397
- */
398
- export declare function makeFeatureHubResponse(features: IFeatureHubFeature[]): IFeatureHubEnvironment[];
399
-
400
390
  /**
401
391
  * @internal
402
392
  * Add a goodmock stub that mocks log requests (POST /gdc/app/projects/.../log).
@@ -502,9 +492,4 @@ export declare type TestConditionsValueConstraint = object | string | number;
502
492
  */
503
493
  export declare type WindowProperties = Record<string, unknown>;
504
494
 
505
- /**
506
- * @internal
507
- */
508
- export declare type WorkspaceSettings = Record<string, unknown>;
509
-
510
495
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-e2e-utils",
3
- "version": "11.62.0-alpha.3",
3
+ "version": "11.62.0-alpha.4",
4
4
  "description": "GoodData utility functions for Playwright E2E tests",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -50,8 +50,8 @@
50
50
  "oxlint-plugin-eslint": "1.82.0",
51
51
  "oxlint-tsgolint": "7.0.2001",
52
52
  "typescript": "7.0.2",
53
- "@gooddata/eslint-config": "11.62.0-alpha.3",
54
- "@gooddata/oxlint-config": "11.62.0-alpha.3"
53
+ "@gooddata/eslint-config": "11.62.0-alpha.4",
54
+ "@gooddata/oxlint-config": "11.62.0-alpha.4"
55
55
  },
56
56
  "scripts": {
57
57
  "_phase:build": "npm run build",