playwright-cucumber-ts-steps 1.0.1 → 1.0.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.
Files changed (132) hide show
  1. package/README.md +195 -256
  2. package/dist/backend/actions/index.js +4 -0
  3. package/dist/backend/actions/interactions.js +23 -0
  4. package/dist/backend/actions/navigation.js +19 -0
  5. package/dist/backend/api/assertions.js +26 -0
  6. package/dist/backend/api/index.js +4 -0
  7. package/dist/backend/api/requests.js +24 -0
  8. package/dist/backend/api/state.js +15 -0
  9. package/dist/backend/assertions/expectVisible.js +8 -0
  10. package/dist/backend/assertions/index.js +5 -0
  11. package/dist/backend/assertions/pageState.js +25 -0
  12. package/dist/backend/assertions/text.js +20 -0
  13. package/dist/backend/assertions/visibility.js +20 -0
  14. package/dist/backend/auth/index.js +71 -0
  15. package/dist/backend/elements/alerts.js +21 -0
  16. package/dist/backend/elements/forms.js +59 -0
  17. package/dist/backend/elements/frames.js +25 -0
  18. package/dist/backend/elements/index.js +5 -0
  19. package/dist/core/registry.js +20 -0
  20. package/dist/core/runner.js +136 -0
  21. package/dist/index.js +10 -0
  22. package/dist/reporting/index.js +43 -0
  23. package/package.json +19 -101
  24. package/LICENSE +0 -21
  25. package/lib/actions/clickSteps.d.ts +0 -251
  26. package/lib/actions/clickSteps.js +0 -415
  27. package/lib/actions/cookieSteps.d.ts +0 -18
  28. package/lib/actions/cookieSteps.js +0 -93
  29. package/lib/actions/debugSteps.d.ts +0 -14
  30. package/lib/actions/debugSteps.js +0 -23
  31. package/lib/actions/elementFindSteps.d.ts +0 -668
  32. package/lib/actions/elementFindSteps.js +0 -931
  33. package/lib/actions/fillFormSteps.d.ts +0 -69
  34. package/lib/actions/fillFormSteps.js +0 -237
  35. package/lib/actions/index.d.ts +0 -11
  36. package/lib/actions/index.js +0 -28
  37. package/lib/actions/inputSteps.d.ts +0 -218
  38. package/lib/actions/inputSteps.js +0 -343
  39. package/lib/actions/interceptionSteps.d.ts +0 -169
  40. package/lib/actions/interceptionSteps.js +0 -291
  41. package/lib/actions/miscSteps.d.ts +0 -645
  42. package/lib/actions/miscSteps.js +0 -1061
  43. package/lib/actions/mouseSteps.d.ts +0 -143
  44. package/lib/actions/mouseSteps.js +0 -234
  45. package/lib/actions/scrollSteps.d.ts +0 -82
  46. package/lib/actions/scrollSteps.js +0 -123
  47. package/lib/actions/storageSteps.d.ts +0 -174
  48. package/lib/actions/storageSteps.js +0 -292
  49. package/lib/assertions/buttonAndTextVisibilitySteps.d.ts +0 -245
  50. package/lib/assertions/buttonAndTextVisibilitySteps.js +0 -401
  51. package/lib/assertions/cookieSteps.d.ts +0 -75
  52. package/lib/assertions/cookieSteps.js +0 -113
  53. package/lib/assertions/elementSteps.d.ts +0 -264
  54. package/lib/assertions/elementSteps.js +0 -388
  55. package/lib/assertions/formInputSteps.d.ts +0 -248
  56. package/lib/assertions/formInputSteps.js +0 -350
  57. package/lib/assertions/index.d.ts +0 -10
  58. package/lib/assertions/index.js +0 -27
  59. package/lib/assertions/interceptionRequestsSteps.d.ts +0 -353
  60. package/lib/assertions/interceptionRequestsSteps.js +0 -593
  61. package/lib/assertions/locationSteps.d.ts +0 -217
  62. package/lib/assertions/locationSteps.js +0 -310
  63. package/lib/assertions/roleTestIdSteps.d.ts +0 -159
  64. package/lib/assertions/roleTestIdSteps.js +0 -221
  65. package/lib/assertions/semanticSteps.d.ts +0 -176
  66. package/lib/assertions/semanticSteps.js +0 -252
  67. package/lib/assertions/storageSteps.d.ts +0 -149
  68. package/lib/assertions/storageSteps.js +0 -210
  69. package/lib/assertions/visualSteps.d.ts +0 -74
  70. package/lib/assertions/visualSteps.js +0 -209
  71. package/lib/custom_setups/loginHooks.d.ts +0 -1
  72. package/lib/custom_setups/loginHooks.js +0 -130
  73. package/lib/helpers/checkPeerDeps.d.ts +0 -1
  74. package/lib/helpers/checkPeerDeps.js +0 -19
  75. package/lib/helpers/compareSnapshots.d.ts +0 -6
  76. package/lib/helpers/compareSnapshots.js +0 -20
  77. package/lib/helpers/hooks.d.ts +0 -1
  78. package/lib/helpers/hooks.js +0 -210
  79. package/lib/helpers/utils/fakerUtils.d.ts +0 -1
  80. package/lib/helpers/utils/fakerUtils.js +0 -60
  81. package/lib/helpers/utils/index.d.ts +0 -4
  82. package/lib/helpers/utils/index.js +0 -20
  83. package/lib/helpers/utils/optionsUtils.d.ts +0 -24
  84. package/lib/helpers/utils/optionsUtils.js +0 -88
  85. package/lib/helpers/utils/resolveUtils.d.ts +0 -6
  86. package/lib/helpers/utils/resolveUtils.js +0 -72
  87. package/lib/helpers/utils/sessionUtils.d.ts +0 -3
  88. package/lib/helpers/utils/sessionUtils.js +0 -40
  89. package/lib/helpers/world.d.ts +0 -34
  90. package/lib/helpers/world.js +0 -110
  91. package/lib/iframes/frames.d.ts +0 -1
  92. package/lib/iframes/frames.js +0 -11
  93. package/lib/index.d.ts +0 -10
  94. package/lib/index.js +0 -28
  95. package/lib/register.d.ts +0 -1
  96. package/lib/register.js +0 -6
  97. package/src/actions/clickSteps.ts +0 -429
  98. package/src/actions/cookieSteps.ts +0 -95
  99. package/src/actions/debugSteps.ts +0 -21
  100. package/src/actions/elementFindSteps.ts +0 -961
  101. package/src/actions/fillFormSteps.ts +0 -270
  102. package/src/actions/index.ts +0 -12
  103. package/src/actions/inputSteps.ts +0 -354
  104. package/src/actions/interceptionSteps.ts +0 -325
  105. package/src/actions/miscSteps.ts +0 -1144
  106. package/src/actions/mouseSteps.ts +0 -256
  107. package/src/actions/scrollSteps.ts +0 -122
  108. package/src/actions/storageSteps.ts +0 -308
  109. package/src/assertions/buttonAndTextVisibilitySteps.ts +0 -436
  110. package/src/assertions/cookieSteps.ts +0 -131
  111. package/src/assertions/elementSteps.ts +0 -432
  112. package/src/assertions/formInputSteps.ts +0 -377
  113. package/src/assertions/index.ts +0 -11
  114. package/src/assertions/interceptionRequestsSteps.ts +0 -640
  115. package/src/assertions/locationSteps.ts +0 -315
  116. package/src/assertions/roleTestIdSteps.ts +0 -254
  117. package/src/assertions/semanticSteps.ts +0 -267
  118. package/src/assertions/storageSteps.ts +0 -250
  119. package/src/assertions/visualSteps.ts +0 -275
  120. package/src/custom_setups/loginHooks.ts +0 -154
  121. package/src/helpers/checkPeerDeps.ts +0 -19
  122. package/src/helpers/compareSnapshots.ts +0 -35
  123. package/src/helpers/hooks.ts +0 -212
  124. package/src/helpers/utils/fakerUtils.ts +0 -64
  125. package/src/helpers/utils/index.ts +0 -4
  126. package/src/helpers/utils/optionsUtils.ts +0 -104
  127. package/src/helpers/utils/resolveUtils.ts +0 -74
  128. package/src/helpers/utils/sessionUtils.ts +0 -36
  129. package/src/helpers/world.ts +0 -119
  130. package/src/iframes/frames.ts +0 -15
  131. package/src/index.ts +0 -18
  132. package/src/register.ts +0 -4
@@ -1,64 +0,0 @@
1
- import { faker } from "@faker-js/faker";
2
- import dayjs from "dayjs";
3
-
4
- // Supports optional parameters
5
- type FakerMapping = Record<string, ((param?: string) => string) | (() => string)>;
6
-
7
- const fakerMapping: FakerMapping = {
8
- "First Name": () => faker.person.middleName(),
9
- Name: () => faker.person.middleName(),
10
- "Last Name": () => faker.person.middleName(),
11
- Email: () => faker.internet.email(),
12
- "Phone Number": () => faker.string.numeric(10),
13
- Number: () => faker.string.numeric(11),
14
- "Complete Number": () => faker.string.numeric(11),
15
- "App Colour": () => faker.color.rgb(),
16
- "App Name": () => faker.commerce.productName(),
17
- "Role Name": () => faker.person.jobTitle(),
18
- "Company Name": () => faker.company.name(),
19
- "Full Name": () => faker.person.fullName(),
20
- "Disposable Email": () => faker.internet.email({ provider: "inboxkitten.com" }),
21
- "ALpha Numeric": () => faker.string.numeric(11) + "e",
22
- "Lorem Word": () => faker.lorem.sentences({ min: 1, max: 3 }),
23
- Word: () => faker.lorem.word({ length: { min: 5, max: 11 } }),
24
- "Current Date": () => dayjs().format("YYYY-MM-DD"),
25
- "Current Date2": () => new Date().toISOString().split("T")[0],
26
-
27
- MonthsFromNow: (months?: string) => {
28
- const monthsToAdd = parseInt(months || "0", 10);
29
- return dayjs().add(monthsToAdd, "month").format("YYYY-MM-DD");
30
- },
31
- MonthsAgo: (months?: string) => {
32
- const monthsToSubtract = parseInt(months || "0", 10);
33
- return dayjs().subtract(monthsToSubtract, "month").format("YYYY-MM-DD");
34
- },
35
-
36
- WeeksFromNow: (weeks?: string) => {
37
- const weeksToAdd = parseInt(weeks || "0", 10);
38
- return dayjs().add(weeksToAdd, "week").format("YYYY-MM-DD");
39
- },
40
- WeeksAgo: (weeks?: string) => {
41
- const weeksToSubtract = parseInt(weeks || "0", 10);
42
- return dayjs().subtract(weeksToSubtract, "week").format("YYYY-MM-DD");
43
- },
44
-
45
- DaysFromNow: (days?: string) => {
46
- const daysToAdd = parseInt(days || "0", 10);
47
- return dayjs().add(daysToAdd, "day").format("YYYY-MM-DD");
48
- },
49
- DaysAgo: (days?: string) => {
50
- const daysToSubtract = parseInt(days || "0", 10);
51
- return dayjs().subtract(daysToSubtract, "day").format("YYYY-MM-DD");
52
- },
53
- };
54
-
55
- export function evaluateFaker(value: string): string {
56
- const [key, param] = value.split(":");
57
-
58
- const fn = fakerMapping[key];
59
- if (typeof fn === "function") {
60
- return fn(param);
61
- }
62
-
63
- return value; // fallback to raw value if not mapped
64
- }
@@ -1,4 +0,0 @@
1
- export * from "./fakerUtils";
2
- export * from "./optionsUtils";
3
- export * from "./resolveUtils";
4
- export * from "./sessionUtils";
@@ -1,104 +0,0 @@
1
- //optionsUtils.ts
2
- import type { DataTable } from "@cucumber/cucumber";
3
- import type { Locator } from "@playwright/test";
4
-
5
- type ClickOptions = Parameters<Locator["click"]>[0];
6
- type DblClickOptions = Parameters<Locator["dblclick"]>[0];
7
- type HoverOptions = Parameters<Locator["hover"]>[0];
8
- type FillOptions = Parameters<Locator["fill"]>[1];
9
- type TypeOptions = Parameters<Locator["type"]>[1];
10
- type CheckOptions = Parameters<Locator["check"]>[0];
11
- type UncheckOptions = Parameters<Locator["uncheck"]>[0];
12
- type SelectOptionOptions = Parameters<Locator["selectOption"]>[1];
13
-
14
- type KeyboardModifier = NonNullable<NonNullable<ClickOptions>["modifiers"]>[number];
15
-
16
- export function parseClickOptions(table?: DataTable): Partial<ClickOptions> {
17
- return parseGenericOptions(table) as Partial<ClickOptions>;
18
- }
19
-
20
- export function parseDblClickOptions(table?: DataTable): Partial<DblClickOptions> {
21
- return parseGenericOptions(table) as Partial<DblClickOptions>;
22
- }
23
-
24
- export function parseHoverOptions(table?: DataTable): Partial<HoverOptions> {
25
- return parseGenericOptions(table) as Partial<HoverOptions>;
26
- }
27
-
28
- export function parseTypeOptions(table?: DataTable): Partial<TypeOptions> {
29
- return parseGenericOptions(table) as unknown as Partial<TypeOptions>;
30
- }
31
-
32
- export function parseFillOptions(table?: DataTable): Partial<FillOptions> {
33
- return parseGenericOptions(table) as Partial<FillOptions>;
34
- }
35
-
36
- export function parseCheckOptions(table?: DataTable): Partial<CheckOptions> {
37
- return parseGenericOptions(table) as Partial<CheckOptions>;
38
- }
39
-
40
- export function parseUncheckOptions(table?: DataTable): Partial<UncheckOptions> {
41
- return parseGenericOptions(table) as Partial<UncheckOptions>;
42
- }
43
-
44
- export function parseSelectOptions(table?: DataTable): Partial<SelectOptionOptions> {
45
- return parseGenericOptions(table) as Partial<SelectOptionOptions>;
46
- }
47
-
48
- export function parseGenericOptions(table?: DataTable): Record<string, any> {
49
- if (!table) return {};
50
-
51
- const options: Record<string, any> = {};
52
- const rows = table.raw();
53
-
54
- for (const [key, value] of rows) {
55
- switch (key) {
56
- case "timeout":
57
- case "delay":
58
- case "clickCount":
59
- options[key] = Number(value);
60
- break;
61
-
62
- case "force":
63
- case "noWaitAfter":
64
- case "strict":
65
- case "trial":
66
- options[key] = value === "true";
67
- break;
68
-
69
- case "modifiers":
70
- options.modifiers = value.split(",").map((v) => v.trim() as KeyboardModifier);
71
- break;
72
-
73
- case "button":
74
- if (["left", "middle", "right"].includes(value)) {
75
- options.button = value;
76
- } else {
77
- throw new Error(`Invalid button option: "${value}"`);
78
- }
79
- break;
80
-
81
- case "position":
82
- const [x, y] = value.split(",").map((n) => Number(n.trim()));
83
- if (isNaN(x) || isNaN(y)) {
84
- throw new Error(`Invalid position format: "${value}"`);
85
- }
86
- options.position = { x, y };
87
- break;
88
-
89
- default:
90
- console.warn(`[⚠️ parseGenericOptions] Unknown option "${key}"`);
91
- break;
92
- }
93
- }
94
-
95
- return options;
96
- }
97
- export function parseExpectOptions(table?: DataTable): { timeout?: number; log?: boolean } {
98
- if (!table) return {};
99
- const obj = Object.fromEntries(table.rows());
100
- return {
101
- timeout: obj.timeout ? Number(obj.timeout) : undefined,
102
- log: obj.log === "true",
103
- };
104
- }
@@ -1,74 +0,0 @@
1
- // src/helpers/utils/resolveUtils.ts
2
- import fs from "fs";
3
- import path from "path";
4
- import { devices } from "@playwright/test";
5
- import type { CustomWorld } from "../world";
6
- // Dynamic resolver
7
- export function resolveValue(input: string): string {
8
- // Uppercase = environment variable (e.g. TEST_USER)
9
- if (/^[A-Z0-9_]+$/.test(input)) {
10
- const envVal = process.env[input];
11
- if (!envVal) {
12
- throw new Error(`Environment variable ${input} not found.`);
13
- }
14
- return envVal;
15
- }
16
-
17
- // Dot = JSON reference (e.g. userData.email)
18
- if (input.includes(".")) {
19
- const [fileName, fieldName] = input.split(".");
20
- const jsonPath = path.resolve("e2e/support/helper/test-data", `${fileName}.json`);
21
- if (fs.existsSync(jsonPath)) {
22
- const json = JSON.parse(fs.readFileSync(jsonPath, "utf-8"));
23
- const value = json[fieldName];
24
- if (value !== undefined) return value;
25
- throw new Error(`Field "${fieldName}" not found in ${fileName}.json`);
26
- }
27
- }
28
-
29
- // Default to hardcoded value
30
- return input;
31
- }
32
-
33
- export function resolveLoginValue(raw: string, world: CustomWorld): string | undefined {
34
- // ✅ Alias: @aliasName
35
- if (raw.startsWith("@")) {
36
- return world.data[raw.slice(1)];
37
- }
38
-
39
- // ✅ JSON: user.json:key
40
- if (raw.includes(".json:")) {
41
- const [filename, key] = raw.split(".json:");
42
- const filePath = path.resolve("test-data", `${filename}.json`);
43
- if (!fs.existsSync(filePath)) {
44
- throw new Error(`JSON fixture not found: ${filename}.json`);
45
- }
46
- const fileData = JSON.parse(fs.readFileSync(filePath, "utf-8"));
47
- return fileData[key];
48
- }
49
-
50
- // ✅ Fallback to raw value
51
- return raw;
52
- }
53
- // Determine session name from email or username
54
- export function deriveSessionName(emailOrUser: string, fallback = "default"): string {
55
- if (!emailOrUser) return `${fallback}User`;
56
-
57
- const base = emailOrUser.includes("@") ? emailOrUser.split("@")[0] : emailOrUser;
58
-
59
- return `${base}User`;
60
- }
61
-
62
- export function resolveSessionPath(world: CustomWorld, name: string) {
63
- const dir = path.resolve(world.data.artifactDir || "test-artifacts", "auth-cookies");
64
- fs.mkdirSync(dir, { recursive: true });
65
- return path.resolve(dir, name.endsWith(".json") ? name : `${name}.json`);
66
- }
67
- export function normalizeDeviceName(name: string): string {
68
- return (
69
- Object.keys(devices).find(
70
- (device) =>
71
- device.toLowerCase().replace(/\s+/g, "") === name.toLowerCase().replace(/[-_\s]+/g, "")
72
- ) || ""
73
- );
74
- }
@@ -1,36 +0,0 @@
1
- //sessionUtils.ts
2
- import fs from "fs";
3
- import path from "path";
4
- import { BrowserContext } from "playwright";
5
-
6
- export async function injectStorage(world: any, type: string, key: string, value: string) {
7
- const page = world.page;
8
-
9
- if (type === "localStorage") {
10
- await page.evaluate(([k, v]: [string, string]) => localStorage.setItem(k, v), [key, value]);
11
- } else if (type === "sessionStorage") {
12
- await page.evaluate(([k, v]: [string, string]) => sessionStorage.setItem(k, v), [key, value]);
13
- } else if (type === "cookie") {
14
- await page.context.addCookies([
15
- {
16
- name: key,
17
- value,
18
- domain: new URL(page.url()).hostname,
19
- path: "/",
20
- httpOnly: false,
21
- secure: true,
22
- sameSite: "Lax",
23
- },
24
- ]);
25
- }
26
- }
27
-
28
- export async function saveSessionData(context: BrowserContext, file: string) {
29
- const storageState = await context.storageState();
30
- const outDir = "test-artifacts/auth-cookies";
31
- const outPath = path.resolve(outDir, file);
32
-
33
- fs.mkdirSync(outDir, { recursive: true });
34
- fs.writeFileSync(outPath, JSON.stringify(storageState, null, 2));
35
- console.log(`💾 Saved session to ${outPath}`);
36
- }
@@ -1,119 +0,0 @@
1
- import { setWorldConstructor, World, ITestCaseHookParameter } from "@cucumber/cucumber";
2
- import { Browser, Page, BrowserContext, Locator, FrameLocator, devices } from "@playwright/test";
3
- import * as dotenv from "dotenv";
4
- import { chromium } from "playwright";
5
-
6
- dotenv.config();
7
-
8
- const isHeadless = process.env.HEADLESS !== "false";
9
- const slowMo = process.env.SLOWMO ? Number(process.env.SLOWMO) : 0;
10
-
11
- // Define a minimal interface for the clock object you expect
12
- // This is to help TypeScript understand the shape of context.clock
13
- // interface PlaywrightClock {
14
- // setFixedTime(time: number | Date): Promise<void>;
15
- // tick(ms: number): Promise<void>;
16
- // restore(): Promise<void>;
17
- // }
18
-
19
- // If you need to extend the Clock type, do it via module augmentation with compatible types.
20
- // Otherwise, do not redeclare the 'clock' property to avoid type conflicts.
21
- // Remove the BrowserContext augmentation for 'clock' to resolve the type error.
22
-
23
- export interface TestConfig {
24
- enableScreenshots: boolean;
25
- enableVisualTest: boolean;
26
- artifactDir: string;
27
- }
28
-
29
- export class CustomWorld extends World {
30
- browser!: Browser;
31
- context!: BrowserContext;
32
- page!: Page;
33
-
34
- elements?: Locator;
35
- element?: Locator;
36
- frame?: FrameLocator;
37
- currentLocator?: Locator;
38
-
39
- data: Record<string, any> = {};
40
- logs: string[] = [];
41
- testName?: string;
42
-
43
- fakeTimersActive: boolean;
44
-
45
- config: TestConfig = {
46
- enableScreenshots: true,
47
- enableVisualTest: false,
48
- artifactDir: "test-artifacts",
49
- };
50
-
51
- constructor(options: import("@cucumber/cucumber").IWorldOptions) {
52
- super(options);
53
- this.fakeTimersActive = false;
54
- }
55
-
56
- async init(testInfo?: ITestCaseHookParameter) {
57
- const info =
58
- testInfo ?? ((this as any).parameters?.testInfo as ITestCaseHookParameter | undefined);
59
- const isMobile = info?.pickle.tags.some((tag) => tag.name === "@mobile");
60
- const device = isMobile ? devices["Pixel 5"] : undefined;
61
-
62
- this.browser = await chromium.launch({ headless: isHeadless, slowMo });
63
-
64
- this.context = await this.browser.newContext({
65
- ...(device || {}),
66
- recordVideo: { dir: `${this.config.artifactDir}/videos` },
67
- });
68
-
69
- // Important: Initialize clock mocking *before* navigating or interacting with the page
70
- // if you intend to use page.clock. This typically involves addInitScript.
71
- // However, the context.clock API does not usually require an init script for its methods.
72
- // If you explicitly loaded a mocking library, you'd do it here.
73
- // For just context.clock methods, they should be available.
74
-
75
- this.page = await this.context.newPage();
76
- this.testName = info?.pickle.name;
77
- this.log(`🧪 Initialized context${isMobile ? " (mobile)" : ""}`);
78
- }
79
-
80
- /**
81
- * Returns the current interaction scope: either the main page or active frame.
82
- */
83
- getScope(): Page | FrameLocator {
84
- return this.frame ?? this.page;
85
- }
86
-
87
- /**
88
- * Returns a Locator scoped to the current iframe or page.
89
- */
90
- getLocator(selector: string): Locator {
91
- return this.getScope().locator(selector);
92
- }
93
-
94
- exitIframe() {
95
- this.frame = undefined;
96
- this.log("⬅️ Exited iframe, scope is now main page");
97
- }
98
-
99
- log = (message: string) => {
100
- this.logs.push(message);
101
- console.log(`[LOG] ${message}`);
102
- };
103
-
104
- async cleanup(testInfo?: ITestCaseHookParameter) {
105
- try {
106
- await this.page?.close();
107
- } catch (err) {
108
- this.log(`⚠️ Error closing page: ${(err as Error).message}`);
109
- }
110
-
111
- try {
112
- await this.context?.close();
113
- } catch (err) {
114
- this.log(`⚠️ Error closing context: ${(err as Error).message}`);
115
- }
116
- }
117
- }
118
-
119
- setWorldConstructor(CustomWorld);
@@ -1,15 +0,0 @@
1
- import { When } from "@cucumber/cucumber";
2
- // import { expect } from "@playwright/test";
3
- import type { CustomWorld } from "../helpers/world";
4
-
5
- When(
6
- "I find href in iframe {string} and store as {string}",
7
- async function (this: CustomWorld, iframeSelector: string, key: string) {
8
- const iframe = this.page.frameLocator(iframeSelector);
9
- const link = await iframe.locator("a[href]").first();
10
- const href = await link.getAttribute("href");
11
-
12
- if (!href) throw new Error("No link found in iframe.");
13
- this.data[key] = href;
14
- }
15
- );
package/src/index.ts DELETED
@@ -1,18 +0,0 @@
1
- // Iframes
2
- export * from "./iframes/frames";
3
-
4
- // Setup (custom hooks, login, etc.)
5
- export * from "./custom_setups/loginHooks";
6
-
7
- // Core helpers and utilities
8
- export * from "./helpers/compareSnapshots";
9
- export * from "./helpers/hooks";
10
- export * from "./helpers/utils";
11
- export * from "./helpers/world";
12
-
13
- // Types
14
- export type { CustomWorld } from "./helpers/world";
15
-
16
- export * from "./actions";
17
- export * from "./assertions";
18
- export * from "./custom_setups/loginHooks";
package/src/register.ts DELETED
@@ -1,4 +0,0 @@
1
- // src/register.ts
2
- import { checkPeerDependencies } from "./helpers/checkPeerDeps";
3
- checkPeerDependencies(["@cucumber/cucumber", "@playwright/test", "@faker-js/faker"]);
4
- import "./index";