playwright-cucumber-ts-steps 1.3.1 → 1.3.3

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 (77) hide show
  1. package/README.md +358 -671
  2. package/dist/backend/actions/click.d.ts +29 -29
  3. package/dist/backend/actions/click.js +59 -59
  4. package/dist/backend/actions/form.d.ts +2 -2
  5. package/dist/backend/actions/form.js +4 -4
  6. package/dist/backend/actions/formTable.d.ts +1 -1
  7. package/dist/backend/actions/formTable.js +2 -2
  8. package/dist/backend/actions/frames.d.ts +3 -3
  9. package/dist/backend/actions/frames.js +6 -6
  10. package/dist/backend/actions/inputs.d.ts +14 -14
  11. package/dist/backend/actions/inputs.js +32 -32
  12. package/dist/backend/actions/interactions.d.ts +7 -7
  13. package/dist/backend/actions/interactions.js +13 -13
  14. package/dist/backend/actions/keyboard.d.ts +6 -6
  15. package/dist/backend/actions/keyboard.js +12 -12
  16. package/dist/backend/actions/misc.d.ts +15 -15
  17. package/dist/backend/actions/misc.js +30 -30
  18. package/dist/backend/actions/mobile.d.ts +7 -7
  19. package/dist/backend/actions/mobile.js +14 -14
  20. package/dist/backend/actions/mouse.d.ts +9 -9
  21. package/dist/backend/actions/mouse.js +18 -18
  22. package/dist/backend/actions/navigation.d.ts +5 -5
  23. package/dist/backend/actions/navigation.js +10 -10
  24. package/dist/backend/actions/visual.d.ts +6 -6
  25. package/dist/backend/actions/visual.js +13 -13
  26. package/dist/backend/actions/waits.d.ts +6 -6
  27. package/dist/backend/actions/waits.js +12 -12
  28. package/dist/backend/api/assertions.d.ts +3 -3
  29. package/dist/backend/api/assertions.js +6 -6
  30. package/dist/backend/api/mock.d.ts +3 -3
  31. package/dist/backend/api/mock.js +6 -6
  32. package/dist/backend/api/network.d.ts +6 -6
  33. package/dist/backend/api/network.js +12 -12
  34. package/dist/backend/api/requests.d.ts +4 -4
  35. package/dist/backend/api/requests.js +8 -8
  36. package/dist/backend/assertions/document.d.ts +10 -10
  37. package/dist/backend/assertions/document.js +20 -20
  38. package/dist/backend/assertions/elements.d.ts +28 -28
  39. package/dist/backend/assertions/elements.js +56 -56
  40. package/dist/backend/assertions/expectVisible.d.ts +1 -1
  41. package/dist/backend/assertions/expectVisible.js +2 -2
  42. package/dist/backend/assertions/forms.d.ts +7 -7
  43. package/dist/backend/assertions/forms.js +14 -14
  44. package/dist/backend/assertions/pageState.d.ts +4 -4
  45. package/dist/backend/assertions/pageState.js +8 -8
  46. package/dist/backend/assertions/storage.d.ts +11 -11
  47. package/dist/backend/assertions/storage.js +22 -22
  48. package/dist/backend/assertions/text.d.ts +17 -17
  49. package/dist/backend/assertions/text.js +34 -34
  50. package/dist/backend/assertions/visibility.d.ts +15 -15
  51. package/dist/backend/assertions/visibility.js +30 -30
  52. package/dist/backend/auth/index.d.ts +2 -2
  53. package/dist/backend/auth/index.js +4 -4
  54. package/dist/backend/db/steps.d.ts +10 -10
  55. package/dist/backend/db/steps.d.ts.map +1 -1
  56. package/dist/backend/db/steps.js +19 -19
  57. package/dist/backend/elements/alerts.d.ts +3 -3
  58. package/dist/backend/elements/alerts.js +6 -6
  59. package/dist/backend/elements/find.d.ts +15 -15
  60. package/dist/backend/elements/find.js +41 -41
  61. package/dist/backend/elements/forms.d.ts +4 -4
  62. package/dist/backend/elements/forms.js +8 -8
  63. package/dist/backend/elements/frames.d.ts +3 -3
  64. package/dist/backend/elements/frames.js +6 -6
  65. package/dist/backend/utils/fixtures.d.ts +22 -0
  66. package/dist/backend/utils/fixtures.d.ts.map +1 -1
  67. package/dist/backend/utils/fixtures.js +76 -2
  68. package/dist/backend/utils/resolver.js +1 -1
  69. package/dist/component/runner.d.ts +1 -1
  70. package/dist/component/runner.d.ts.map +1 -1
  71. package/dist/component/runner.js +38 -5
  72. package/dist/core/runner.js +3 -3
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +3 -1
  76. package/dist/metadata.json +270 -270
  77. package/package.json +3 -2
@@ -20,7 +20,7 @@ const state_1 = require("../utils/state");
20
20
  /**
21
21
  * Executes a raw SQL query against the configured database.
22
22
  * Supports fixtures for reusable queries.
23
- * @example When I run the database query "selectUsersByEmail"
23
+ * @example When I pw run the database query "selectUsersByEmail"
24
24
  */
25
25
  async function runDbQuery(_page, queryKey) {
26
26
  const queries = (0, fixtures_1.loadFixture)("queries.json");
@@ -30,7 +30,7 @@ async function runDbQuery(_page, queryKey) {
30
30
  }
31
31
  /**
32
32
  * Asserts that the last executed database query returned a specific number of records.
33
- * @example Then I expect the database to return 1 record
33
+ * @example Then I pw expect the database to return 1 record
34
34
  */
35
35
  async function expectDbRecordCount(page, count) {
36
36
  const result = state_1.dbState.getLastResult();
@@ -44,9 +44,9 @@ async function expectDbRecordCount(page, count) {
44
44
  }
45
45
  /**
46
46
  * Asserts that the database query returned no records (empty result set).
47
- * @example Then I expect the database to return no records
47
+ * @example Then I pw expect the database to return no records
48
48
  */
49
- async function expectDbNoRecords(page) {
49
+ async function expectDbNoRecords(_page) {
50
50
  const result = state_1.dbState.getLastResult();
51
51
  if (!Array.isArray(result)) {
52
52
  throw new Error(`Expected array result from database but got: ${typeof result}`);
@@ -58,7 +58,7 @@ async function expectDbNoRecords(page) {
58
58
  * Asserts that the first record of the last database result set contains specific column values.
59
59
  * Performs a loose equality check (converts values to strings) to handle type mismatches.
60
60
  * Supports fixtures for reusable table data.
61
- * @example Then I expect the first database record to contain
61
+ * @example Then I pw expect the first database record to contain
62
62
  * | username | admin |
63
63
  * | is_active| 1 |
64
64
  * | role | superuser |
@@ -86,7 +86,7 @@ async function expectFirstDbRecordToContain(page, tableData) {
86
86
  /**
87
87
  * Asserts that a specific row (by index) contains expected column values.
88
88
  * Supports fixtures for reusable table data.
89
- * @example Then I expect database row 2 to contain
89
+ * @example Then I pw expect database row 2 to contain
90
90
  * | username | bob |
91
91
  * | status | active |
92
92
  */
@@ -117,7 +117,7 @@ async function expectDbRowToContain(page, index, tableData) {
117
117
  * Asserts that all records in the result set contain specific column values.
118
118
  * Useful for verifying uniform data across multiple rows.
119
119
  * Supports fixtures for reusable table data.
120
- * @example Then I expect all database records to contain
120
+ * @example Then I pw expect all database records to contain
121
121
  * | status | active |
122
122
  */
123
123
  async function expectAllDbRecordsToContain(page, tableData) {
@@ -148,7 +148,7 @@ async function expectAllDbRecordsToContain(page, tableData) {
148
148
  /**
149
149
  * Asserts that a specific column exists in the database result set.
150
150
  * Supports fixtures for reusable column names.
151
- * @example Then I expect database column "email" to exist
151
+ * @example Then I pw expect database column "email" to exist
152
152
  */
153
153
  async function expectDbColumnExists(page, columnNameKey) {
154
154
  const columns = (0, fixtures_1.loadFixture)("columns.json");
@@ -168,7 +168,7 @@ async function expectDbColumnExists(page, columnNameKey) {
168
168
  * Asserts that a specific column in any row contains the expected value.
169
169
  * Searches through all rows to find a match.
170
170
  * Supports fixtures for reusable column names and values.
171
- * @example Then I expect database column "email" to contain "test@example.com"
171
+ * @example Then I pw expect database column "email" to contain "test@example.com"
172
172
  */
173
173
  async function expectDbColumnContains(page, columnNameKey, expectedValueKey) {
174
174
  const columns = (0, fixtures_1.loadFixture)("columns.json");
@@ -196,7 +196,7 @@ async function expectDbColumnContains(page, columnNameKey, expectedValueKey) {
196
196
  /**
197
197
  * Asserts the data type of a column's value in the first record.
198
198
  * Supports fixtures for reusable column names and types.
199
- * @example Then I expect database column "age" to be of type "number"
199
+ * @example Then I pw expect database column "age" to be of type "number"
200
200
  */
201
201
  async function expectDbColumnType(page, columnNameKey, dataTypeKey) {
202
202
  const columns = (0, fixtures_1.loadFixture)("columns.json");
@@ -219,12 +219,12 @@ async function expectDbColumnType(page, columnNameKey, dataTypeKey) {
219
219
  // ==================================================
220
220
  // GLUE STEPS
221
221
  // ==================================================
222
- (0, registry_1.Step)("I run the database query {string}", runDbQuery, "When");
223
- (0, registry_1.Step)("I expect the database to return {int} record(s)", expectDbRecordCount, "Then");
224
- (0, registry_1.Step)("I expect the database to return no records", expectDbNoRecords, "Then");
225
- (0, registry_1.Step)("I expect the first database record to contain", expectFirstDbRecordToContain, "Then");
226
- (0, registry_1.Step)("I expect database row {int} to contain", expectDbRowToContain, "Then");
227
- (0, registry_1.Step)("I expect all database records to contain", expectAllDbRecordsToContain, "Then");
228
- (0, registry_1.Step)("I expect database column {string} to exist", expectDbColumnExists, "Then");
229
- (0, registry_1.Step)("I expect database column {string} to contain {string}", expectDbColumnContains, "Then");
230
- (0, registry_1.Step)("I expect database column {string} to be of type {string}", expectDbColumnType, "Then");
222
+ (0, registry_1.Step)("I pw run the database query {string}", runDbQuery, "When");
223
+ (0, registry_1.Step)("I pw expect the database to return {int} record(s)", expectDbRecordCount, "Then");
224
+ (0, registry_1.Step)("I pw expect the database to return no records", expectDbNoRecords, "Then");
225
+ (0, registry_1.Step)("I pw expect the first database record to contain", expectFirstDbRecordToContain, "Then");
226
+ (0, registry_1.Step)("I pw expect database row {int} to contain", expectDbRowToContain, "Then");
227
+ (0, registry_1.Step)("I pw expect all database records to contain", expectAllDbRecordsToContain, "Then");
228
+ (0, registry_1.Step)("I pw expect database column {string} to exist", expectDbColumnExists, "Then");
229
+ (0, registry_1.Step)("I pw expect database column {string} to contain {string}", expectDbColumnContains, "Then");
230
+ (0, registry_1.Step)("I pw expect database column {string} to be of type {string}", expectDbColumnType, "Then");
@@ -2,20 +2,20 @@
2
2
  * Sets up a listener to automatically click "OK" or "Accept" on the very next browser dialog
3
3
  * (alert, confirm, or prompt) that appears.
4
4
  * **Note:** This must be called *before* the action that triggers the dialog.
5
- * @example Given I accept the next dialog
5
+ * @example Given I pw accept the next dialog
6
6
  */
7
7
  export declare function acceptNextDialog(page: any): Promise<void>;
8
8
  /**
9
9
  * Sets up a listener to automatically click "Cancel" or "Dismiss" on the very next browser dialog.
10
10
  * **Note:** This must be called *before* the action that triggers the dialog.
11
- * @example Given I dismiss the next dialog
11
+ * @example Given I pw dismiss the next dialog
12
12
  */
13
13
  export declare function dismissNextDialog(page: any): Promise<void>;
14
14
  /**
15
15
  * Sets up a listener to type a specific string into the next browser prompt and then accept it.
16
16
  * Supports fixtures for reusable prompt values.
17
17
  * **Note:** This must be called *before* the action that triggers the prompt.
18
- * @example Given I type "prompt.folderName" into the next prompt and accept
18
+ * @example Given I pw type "prompt.folderName" into the next prompt and accept
19
19
  */
20
20
  export declare function typeAndAcceptPrompt(page: any, textKey: string): Promise<void>;
21
21
  //# sourceMappingURL=alerts.d.ts.map
@@ -13,7 +13,7 @@ const fixtures_1 = require("../utils/fixtures");
13
13
  * Sets up a listener to automatically click "OK" or "Accept" on the very next browser dialog
14
14
  * (alert, confirm, or prompt) that appears.
15
15
  * **Note:** This must be called *before* the action that triggers the dialog.
16
- * @example Given I accept the next dialog
16
+ * @example Given I pw accept the next dialog
17
17
  */
18
18
  async function acceptNextDialog(page) {
19
19
  page.once("dialog", async (dialog) => {
@@ -24,7 +24,7 @@ async function acceptNextDialog(page) {
24
24
  /**
25
25
  * Sets up a listener to automatically click "Cancel" or "Dismiss" on the very next browser dialog.
26
26
  * **Note:** This must be called *before* the action that triggers the dialog.
27
- * @example Given I dismiss the next dialog
27
+ * @example Given I pw dismiss the next dialog
28
28
  */
29
29
  async function dismissNextDialog(page) {
30
30
  page.once("dialog", async (dialog) => {
@@ -36,7 +36,7 @@ async function dismissNextDialog(page) {
36
36
  * Sets up a listener to type a specific string into the next browser prompt and then accept it.
37
37
  * Supports fixtures for reusable prompt values.
38
38
  * **Note:** This must be called *before* the action that triggers the prompt.
39
- * @example Given I type "prompt.folderName" into the next prompt and accept
39
+ * @example Given I pw type "prompt.folderName" into the next prompt and accept
40
40
  */
41
41
  async function typeAndAcceptPrompt(page, textKey) {
42
42
  const prompts = (0, fixtures_1.loadFixture)("prompts.json");
@@ -49,6 +49,6 @@ async function typeAndAcceptPrompt(page, textKey) {
49
49
  // ==================================================
50
50
  // GLUE STEPS
51
51
  // ==================================================
52
- (0, registry_1.Step)("I accept the next dialog", acceptNextDialog, "Given");
53
- (0, registry_1.Step)("I dismiss the next dialog", dismissNextDialog, "Given");
54
- (0, registry_1.Step)("I type {string} into the next prompt and accept", typeAndAcceptPrompt, "Given");
52
+ (0, registry_1.Step)("I pw accept the next dialog", acceptNextDialog, "Given");
53
+ (0, registry_1.Step)("I pw dismiss the next dialog", dismissNextDialog, "Given");
54
+ (0, registry_1.Step)("I pw type {string} into the next prompt and accept", typeAndAcceptPrompt, "Given");
@@ -1,74 +1,74 @@
1
1
  /**
2
2
  * Finds a single element using a CSS or XPath selector.
3
3
  * Asserts that exactly one element is found.
4
- * @example When I find element by selector ".nav-bar"
4
+ * @example When I pw find element by selector ".nav-bar"
5
5
  */
6
6
  export declare function findElementBySelector(page: any, selectorKey: string): Promise<void>;
7
7
  /**
8
8
  * Finds an element containing the exact text provided.
9
- * @example When I find element by text "Submit Order"
9
+ * @example When I pw find element by text "Submit Order"
10
10
  */
11
11
  export declare function findElementByText(page: any, text: string): Promise<void>;
12
12
  /**
13
13
  * Finds an element by its `title` attribute.
14
- * @example When I find element by title "Close Modal"
14
+ * @example When I pw find element by title "Close Modal"
15
15
  */
16
16
  export declare function findElementByTitle(page: any, title: string): Promise<void>;
17
17
  /**
18
18
  * Finds an element by its test ID (usually `data-testid`).
19
- * @example When I find element by testid "login-form"
19
+ * @example When I pw find element by testid "login-form"
20
20
  */
21
21
  export declare function findElementByTestId(page: any, testid: string): Promise<void>;
22
22
  /**
23
23
  * Finds an element by its ARIA role.
24
- * @example When I find element by role "button"
24
+ * @example When I pw find element by role "button"
25
25
  */
26
26
  export declare function findElementByRole(page: any, role: string): Promise<void>;
27
27
  /**
28
28
  * Finds an input element by its placeholder text.
29
- * @example When I find element by placeholder text "Enter your email"
29
+ * @example When I pw find element by placeholder text "Enter your email"
30
30
  */
31
31
  export declare function findElementByPlaceholder(page: any, text: string): Promise<void>;
32
32
  /**
33
33
  * Finds a form control associated with a specific label text.
34
- * @example When I find element by label text "Password"
34
+ * @example When I pw find element by label text "Password"
35
35
  */
36
36
  export declare function findElementByLabel(page: any, label: string): Promise<void>;
37
37
  /**
38
38
  * Finds an element (usually an image) by its alt text.
39
- * @example When I find element by alt text "Company Logo"
39
+ * @example When I pw find element by alt text "Company Logo"
40
40
  */
41
41
  export declare function findElementByAltText(page: any, alt: string): Promise<void>;
42
42
  /**
43
43
  * Finds a specific link by its visible text.
44
- * @example When I find link by text "Read More"
44
+ * @example When I pw find link by text "Read More"
45
45
  */
46
46
  export declare function findLinkByText(page: any, text: string): Promise<void>;
47
47
  /**
48
48
  * Finds a heading (h1-h6) by its text content.
49
- * @example When I find heading by text "Dashboard"
49
+ * @example When I pw find heading by text "Dashboard"
50
50
  */
51
51
  export declare function findHeadingByText(page: any, text: string): Promise<void>;
52
52
  /**
53
53
  * Finds an element by its `name` attribute.
54
- * @example When I find element by name "csrf_token"
54
+ * @example When I pw find element by name "csrf_token"
55
55
  */
56
56
  export declare function findElementByName(page: any, name: string): Promise<void>;
57
57
  /**
58
58
  * Finds all elements matching a CSS selector and stores them as a list.
59
- * @example When I find elements by selector "ul > li"
59
+ * @example When I pw find elements by selector "ul > li"
60
60
  */
61
61
  export declare function findElementsBySelector(page: any, selectorKey: string): Promise<void>;
62
62
  /**
63
63
  * Finds all buttons matching specific text.
64
64
  * Supports variable aliasing (e.g., "@buttonName").
65
- * @example When I find buttons by text "Add to Cart"
65
+ * @example When I pw find buttons by text "Add to Cart"
66
66
  */
67
67
  export declare function findButtonsByText(page: any, text: string): Promise<void>;
68
68
  /**
69
69
  * Selects the nth element from the currently stored list.
70
70
  * Uses 1-based indexing (e.g., 1st, 2nd, 3rd).
71
- * @example When I get 2nd element
71
+ * @example When I pw get 2nd element
72
72
  */
73
73
  export declare function getNthElement(page: any, indexStr: string): Promise<void>;
74
74
  /**
@@ -91,7 +91,7 @@ export declare function getFirstElement(page: any): Promise<void>;
91
91
  export declare function getLastElement(page: any): Promise<void>;
92
92
  /**
93
93
  * Stores the text content of the currently active element in a variable.
94
- * @example When I store element text as "confirmationCode"
94
+ * @example When I pw store element text as "confirmationCode"
95
95
  */
96
96
  export declare function storeElementText(page: any, alias: string): Promise<void>;
97
97
  /**
@@ -35,7 +35,7 @@ const fixtures_1 = require("../utils/fixtures");
35
35
  /**
36
36
  * Finds a single element using a CSS or XPath selector.
37
37
  * Asserts that exactly one element is found.
38
- * @example When I find element by selector ".nav-bar"
38
+ * @example When I pw find element by selector ".nav-bar"
39
39
  */
40
40
  async function findElementBySelector(page, selectorKey) {
41
41
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -47,7 +47,7 @@ async function findElementBySelector(page, selectorKey) {
47
47
  }
48
48
  /**
49
49
  * Finds an element containing the exact text provided.
50
- * @example When I find element by text "Submit Order"
50
+ * @example When I pw find element by text "Submit Order"
51
51
  */
52
52
  async function findElementByText(page, text) {
53
53
  const element = page.getByText(text, { exact: true });
@@ -57,7 +57,7 @@ async function findElementByText(page, text) {
57
57
  }
58
58
  /**
59
59
  * Finds an element by its `title` attribute.
60
- * @example When I find element by title "Close Modal"
60
+ * @example When I pw find element by title "Close Modal"
61
61
  */
62
62
  async function findElementByTitle(page, title) {
63
63
  const element = page.getByTitle(title);
@@ -67,7 +67,7 @@ async function findElementByTitle(page, title) {
67
67
  }
68
68
  /**
69
69
  * Finds an element by its test ID (usually `data-testid`).
70
- * @example When I find element by testid "login-form"
70
+ * @example When I pw find element by testid "login-form"
71
71
  */
72
72
  async function findElementByTestId(page, testid) {
73
73
  const element = page.getByTestId(testid);
@@ -77,7 +77,7 @@ async function findElementByTestId(page, testid) {
77
77
  }
78
78
  /**
79
79
  * Finds an element by its ARIA role.
80
- * @example When I find element by role "button"
80
+ * @example When I pw find element by role "button"
81
81
  */
82
82
  async function findElementByRole(page, role) {
83
83
  const element = page.getByRole(role);
@@ -87,7 +87,7 @@ async function findElementByRole(page, role) {
87
87
  }
88
88
  /**
89
89
  * Finds an input element by its placeholder text.
90
- * @example When I find element by placeholder text "Enter your email"
90
+ * @example When I pw find element by placeholder text "Enter your email"
91
91
  */
92
92
  async function findElementByPlaceholder(page, text) {
93
93
  const element = page.getByPlaceholder(text);
@@ -97,7 +97,7 @@ async function findElementByPlaceholder(page, text) {
97
97
  }
98
98
  /**
99
99
  * Finds a form control associated with a specific label text.
100
- * @example When I find element by label text "Password"
100
+ * @example When I pw find element by label text "Password"
101
101
  */
102
102
  async function findElementByLabel(page, label) {
103
103
  const element = page.getByLabel(label);
@@ -107,7 +107,7 @@ async function findElementByLabel(page, label) {
107
107
  }
108
108
  /**
109
109
  * Finds an element (usually an image) by its alt text.
110
- * @example When I find element by alt text "Company Logo"
110
+ * @example When I pw find element by alt text "Company Logo"
111
111
  */
112
112
  async function findElementByAltText(page, alt) {
113
113
  const element = page.getByAltText(alt);
@@ -117,7 +117,7 @@ async function findElementByAltText(page, alt) {
117
117
  }
118
118
  /**
119
119
  * Finds a specific link by its visible text.
120
- * @example When I find link by text "Read More"
120
+ * @example When I pw find link by text "Read More"
121
121
  */
122
122
  async function findLinkByText(page, text) {
123
123
  const element = page.getByRole("link", { name: text });
@@ -126,7 +126,7 @@ async function findLinkByText(page, text) {
126
126
  }
127
127
  /**
128
128
  * Finds a heading (h1-h6) by its text content.
129
- * @example When I find heading by text "Dashboard"
129
+ * @example When I pw find heading by text "Dashboard"
130
130
  */
131
131
  async function findHeadingByText(page, text) {
132
132
  const element = page.getByRole("heading", { name: text });
@@ -135,7 +135,7 @@ async function findHeadingByText(page, text) {
135
135
  }
136
136
  /**
137
137
  * Finds an element by its `name` attribute.
138
- * @example When I find element by name "csrf_token"
138
+ * @example When I pw find element by name "csrf_token"
139
139
  */
140
140
  async function findElementByName(page, name) {
141
141
  const element = page.locator(`[name="${name}"]`);
@@ -145,7 +145,7 @@ async function findElementByName(page, name) {
145
145
  }
146
146
  /**
147
147
  * Finds all elements matching a CSS selector and stores them as a list.
148
- * @example When I find elements by selector "ul > li"
148
+ * @example When I pw find elements by selector "ul > li"
149
149
  */
150
150
  async function findElementsBySelector(page, selectorKey) {
151
151
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -158,7 +158,7 @@ async function findElementsBySelector(page, selectorKey) {
158
158
  /**
159
159
  * Finds all buttons matching specific text.
160
160
  * Supports variable aliasing (e.g., "@buttonName").
161
- * @example When I find buttons by text "Add to Cart"
161
+ * @example When I pw find buttons by text "Add to Cart"
162
162
  */
163
163
  async function findButtonsByText(page, text) {
164
164
  let searchText = text;
@@ -176,7 +176,7 @@ async function findButtonsByText(page, text) {
176
176
  /**
177
177
  * Selects the nth element from the currently stored list.
178
178
  * Uses 1-based indexing (e.g., 1st, 2nd, 3rd).
179
- * @example When I get 2nd element
179
+ * @example When I pw get 2nd element
180
180
  */
181
181
  async function getNthElement(page, indexStr) {
182
182
  const index = parseInt(indexStr, 10);
@@ -223,7 +223,7 @@ async function getLastElement(page) {
223
223
  }
224
224
  /**
225
225
  * Stores the text content of the currently active element in a variable.
226
- * @example When I store element text as "confirmationCode"
226
+ * @example When I pw store element text as "confirmationCode"
227
227
  */
228
228
  async function storeElementText(page, alias) {
229
229
  const element = (0, state_1.getActiveElement)(page);
@@ -318,29 +318,29 @@ async function findInputByName(page, name) {
318
318
  // ==================================================
319
319
  // GLUE STEPS
320
320
  // ==================================================
321
- (0, registry_1.Step)("I find element by selector {string}", findElementBySelector, "When");
322
- (0, registry_1.Step)("I get element by selector {string}", findElementBySelector, "When");
323
- (0, registry_1.Step)("I find element by text {string}", findElementByText, "When");
324
- (0, registry_1.Step)("I find element by title {string}", findElementByTitle, "When");
325
- (0, registry_1.Step)("I find element by testid {string}", findElementByTestId, "When");
326
- (0, registry_1.Step)("I find element by role {string}", findElementByRole, "When");
327
- (0, registry_1.Step)("I find element by placeholder text {string}", findElementByPlaceholder, "When");
328
- (0, registry_1.Step)("I find element by label text {string}", findElementByLabel, "When");
329
- (0, registry_1.Step)("I find element by alt text {string}", findElementByAltText, "When");
330
- (0, registry_1.Step)("I find link by text {string}", findLinkByText, "When");
331
- (0, registry_1.Step)("I find heading by text {string}", findHeadingByText, "When");
332
- (0, registry_1.Step)("I find element by name {string}", findElementByName, "When");
333
- (0, registry_1.Step)("I find elements by selector {string}", findElementsBySelector, "When");
334
- (0, registry_1.Step)("I get elements by selector {string}", findElementsBySelector, "When");
335
- (0, registry_1.Step)("I find buttons by text {string}", findButtonsByText, "When");
336
- (0, registry_1.Step)("I get first element", getFirstElement, "When");
337
- (0, registry_1.Step)("I get last element", getLastElement, "When");
338
- (0, registry_1.Step)("I get {int}(?:st|nd|rd|th) element", getNthElement, "When");
339
- (0, registry_1.Step)("I store element text as {string}", storeElementText, "When");
340
- (0, registry_1.Step)("I get focused element", getFocusedElement, "When");
341
- (0, registry_1.Step)("I find textarea by label text {string}", findTextareaByLabel, "When");
342
- (0, registry_1.Step)("I find input by display value {string}", findInputByValue, "When");
343
- (0, registry_1.Step)("I find input by placeholder text {string}", findInputByPlaceholder, "When");
344
- (0, registry_1.Step)("I find headings by text {string}", findHeadingsByText, "When");
345
- (0, registry_1.Step)("I find input by ID {string}", findInputById, "When");
346
- (0, registry_1.Step)("I find input by name {string}", findInputByName, "When");
321
+ (0, registry_1.Step)("I pw find element by selector {string}", findElementBySelector, "When");
322
+ (0, registry_1.Step)("I pw get element by selector {string}", findElementBySelector, "When");
323
+ (0, registry_1.Step)("I pw find element by text {string}", findElementByText, "When");
324
+ (0, registry_1.Step)("I pw find element by title {string}", findElementByTitle, "When");
325
+ (0, registry_1.Step)("I pw find element by testid {string}", findElementByTestId, "When");
326
+ (0, registry_1.Step)("I pw find element by role {string}", findElementByRole, "When");
327
+ (0, registry_1.Step)("I pw find element by placeholder text {string}", findElementByPlaceholder, "When");
328
+ (0, registry_1.Step)("I pw find element by label text {string}", findElementByLabel, "When");
329
+ (0, registry_1.Step)("I pw find element by alt text {string}", findElementByAltText, "When");
330
+ (0, registry_1.Step)("I pw find link by text {string}", findLinkByText, "When");
331
+ (0, registry_1.Step)("I pw find heading by text {string}", findHeadingByText, "When");
332
+ (0, registry_1.Step)("I pw find element by name {string}", findElementByName, "When");
333
+ (0, registry_1.Step)("I pw find elements by selector {string}", findElementsBySelector, "When");
334
+ (0, registry_1.Step)("I pw get elements by selector {string}", findElementsBySelector, "When");
335
+ (0, registry_1.Step)("I pw find buttons by text {string}", findButtonsByText, "When");
336
+ (0, registry_1.Step)("I pw get first element", getFirstElement, "When");
337
+ (0, registry_1.Step)("I pw get last element", getLastElement, "When");
338
+ (0, registry_1.Step)("I pw get {int}(?:st|nd|rd|th) element", getNthElement, "When");
339
+ (0, registry_1.Step)("I pw store element text as {string}", storeElementText, "When");
340
+ (0, registry_1.Step)("I pw get focused element", getFocusedElement, "When");
341
+ (0, registry_1.Step)("I pw find textarea by label text {string}", findTextareaByLabel, "When");
342
+ (0, registry_1.Step)("I pw find input by display value {string}", findInputByValue, "When");
343
+ (0, registry_1.Step)("I pw find input by placeholder text {string}", findInputByPlaceholder, "When");
344
+ (0, registry_1.Step)("I pw find headings by text {string}", findHeadingsByText, "When");
345
+ (0, registry_1.Step)("I pw find input by ID {string}", findInputById, "When");
346
+ (0, registry_1.Step)("I pw find input by name {string}", findInputByName, "When");
@@ -2,26 +2,26 @@
2
2
  * Selects an option from a `<select>` dropdown menu.
3
3
  * Supports fixtures for reusable selectors and options.
4
4
  * It first attempts to match by the visible label; if that fails, it tries to match by the underlying `value` attribute.
5
- * @example When I select option "options.country.canada" from "selectors.countrySelector"
5
+ * @example When I pw select option "options.country.canada" from "selectors.countrySelector"
6
6
  */
7
7
  export declare function selectDropdownOption(page: any, optionKey: string, selectorKey: string): Promise<void>;
8
8
  /**
9
9
  * Checks a checkbox or radio button.
10
10
  * Supports fixtures for reusable selectors.
11
- * @example When I check "selectors.termsCheckbox"
11
+ * @example When I pw check "selectors.termsCheckbox"
12
12
  */
13
13
  export declare function checkInput(page: any, selectorKey: string): Promise<void>;
14
14
  /**
15
15
  * Unchecks a checkbox.
16
16
  * Supports fixtures for reusable selectors.
17
- * @example When I uncheck "selectors.subscribeCheckbox"
17
+ * @example When I pw uncheck "selectors.subscribeCheckbox"
18
18
  */
19
19
  export declare function uncheckInput(page: any, selectorKey: string): Promise<void>;
20
20
  /**
21
21
  * Uploads a file to an `<input type="file">` element.
22
22
  * Supports fixtures for reusable selectors and file paths.
23
23
  * The file path is resolved relative to the current working directory of the project.
24
- * @example When I upload file "files.avatarImage" to "selectors.avatarUpload"
24
+ * @example When I pw upload file "files.avatarImage" to "selectors.avatarUpload"
25
25
  */
26
26
  export declare function fileUpload(page: any, fileNameKey: string, selectorKey: string): Promise<void>;
27
27
  //# sourceMappingURL=forms.d.ts.map
@@ -48,7 +48,7 @@ const fixtures_1 = require("../utils/fixtures");
48
48
  * Selects an option from a `<select>` dropdown menu.
49
49
  * Supports fixtures for reusable selectors and options.
50
50
  * It first attempts to match by the visible label; if that fails, it tries to match by the underlying `value` attribute.
51
- * @example When I select option "options.country.canada" from "selectors.countrySelector"
51
+ * @example When I pw select option "options.country.canada" from "selectors.countrySelector"
52
52
  */
53
53
  async function selectDropdownOption(page, optionKey, selectorKey) {
54
54
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -63,7 +63,7 @@ async function selectDropdownOption(page, optionKey, selectorKey) {
63
63
  /**
64
64
  * Checks a checkbox or radio button.
65
65
  * Supports fixtures for reusable selectors.
66
- * @example When I check "selectors.termsCheckbox"
66
+ * @example When I pw check "selectors.termsCheckbox"
67
67
  */
68
68
  async function checkInput(page, selectorKey) {
69
69
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -74,7 +74,7 @@ async function checkInput(page, selectorKey) {
74
74
  /**
75
75
  * Unchecks a checkbox.
76
76
  * Supports fixtures for reusable selectors.
77
- * @example When I uncheck "selectors.subscribeCheckbox"
77
+ * @example When I pw uncheck "selectors.subscribeCheckbox"
78
78
  */
79
79
  async function uncheckInput(page, selectorKey) {
80
80
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -86,7 +86,7 @@ async function uncheckInput(page, selectorKey) {
86
86
  * Uploads a file to an `<input type="file">` element.
87
87
  * Supports fixtures for reusable selectors and file paths.
88
88
  * The file path is resolved relative to the current working directory of the project.
89
- * @example When I upload file "files.avatarImage" to "selectors.avatarUpload"
89
+ * @example When I pw upload file "files.avatarImage" to "selectors.avatarUpload"
90
90
  */
91
91
  async function fileUpload(page, fileNameKey, selectorKey) {
92
92
  const files = (0, fixtures_1.loadFixture)("files.json");
@@ -100,7 +100,7 @@ async function fileUpload(page, fileNameKey, selectorKey) {
100
100
  // ==================================================
101
101
  // GLUE STEPS
102
102
  // ==================================================
103
- (0, registry_1.Step)("I select option {string} from {string}", selectDropdownOption, "When");
104
- (0, registry_1.Step)("I check {string}", checkInput, "When");
105
- (0, registry_1.Step)("I uncheck {string}", uncheckInput, "When");
106
- (0, registry_1.Step)("I upload file {string} to {string}", fileUpload, "When");
103
+ (0, registry_1.Step)("I pw select option {string} from {string}", selectDropdownOption, "When");
104
+ (0, registry_1.Step)("I pw check {string}", checkInput, "When");
105
+ (0, registry_1.Step)("I pw uncheck {string}", uncheckInput, "When");
106
+ (0, registry_1.Step)("I pw upload file {string} to {string}", fileUpload, "When");
@@ -1,20 +1,20 @@
1
1
  /**
2
2
  * Clicks an element located inside a specific `<iframe>`.
3
3
  * Supports fixtures for reusable selectors.
4
- * @example When I click "selectors.paymentSubmitButton" inside frame "selectors.paymentIframe"
4
+ * @example When I pw click "selectors.paymentSubmitButton" inside frame "selectors.paymentIframe"
5
5
  */
6
6
  export declare function clickInsideFrame(page: any, elementSelectorKey: string, frameSelectorKey: string): Promise<void>;
7
7
  /**
8
8
  * Fills an input field located inside a specific `<iframe>`.
9
9
  * Supports fixtures for reusable selectors and values.
10
- * @example When I fill "selectors.cardNumberInput" inside frame "selectors.checkoutFrame" with "values.cardNumber"
10
+ * @example When I pw fill "selectors.cardNumberInput" inside frame "selectors.checkoutFrame" with "values.cardNumber"
11
11
  */
12
12
  export declare function fillInsideFrame(page: any, elementSelectorKey: string, frameSelectorKey: string, valueKey: string): Promise<void>;
13
13
  /**
14
14
  * Asserts that an element inside a specific `<iframe>` contains the expected text.
15
15
  * Supports fixtures for reusable selectors and text.
16
16
  * Uses Playwright's web-first assertions for automatic retries.
17
- * @example Then I expect "selectors.successMessage" inside frame "selectors.uploadFrame" to have text "texts.uploadComplete"
17
+ * @example Then I pw expect "selectors.successMessage" inside frame "selectors.uploadFrame" to have text "texts.uploadComplete"
18
18
  */
19
19
  export declare function expectTextInsideFrame(page: any, elementSelectorKey: string, frameSelectorKey: string, textKey: string): Promise<void>;
20
20
  //# sourceMappingURL=frames.d.ts.map
@@ -13,7 +13,7 @@ const fixtures_1 = require("../utils/fixtures");
13
13
  /**
14
14
  * Clicks an element located inside a specific `<iframe>`.
15
15
  * Supports fixtures for reusable selectors.
16
- * @example When I click "selectors.paymentSubmitButton" inside frame "selectors.paymentIframe"
16
+ * @example When I pw click "selectors.paymentSubmitButton" inside frame "selectors.paymentIframe"
17
17
  */
18
18
  async function clickInsideFrame(page, elementSelectorKey, frameSelectorKey) {
19
19
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -26,7 +26,7 @@ async function clickInsideFrame(page, elementSelectorKey, frameSelectorKey) {
26
26
  /**
27
27
  * Fills an input field located inside a specific `<iframe>`.
28
28
  * Supports fixtures for reusable selectors and values.
29
- * @example When I fill "selectors.cardNumberInput" inside frame "selectors.checkoutFrame" with "values.cardNumber"
29
+ * @example When I pw fill "selectors.cardNumberInput" inside frame "selectors.checkoutFrame" with "values.cardNumber"
30
30
  */
31
31
  async function fillInsideFrame(page, elementSelectorKey, frameSelectorKey, valueKey) {
32
32
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -42,7 +42,7 @@ async function fillInsideFrame(page, elementSelectorKey, frameSelectorKey, value
42
42
  * Asserts that an element inside a specific `<iframe>` contains the expected text.
43
43
  * Supports fixtures for reusable selectors and text.
44
44
  * Uses Playwright's web-first assertions for automatic retries.
45
- * @example Then I expect "selectors.successMessage" inside frame "selectors.uploadFrame" to have text "texts.uploadComplete"
45
+ * @example Then I pw expect "selectors.successMessage" inside frame "selectors.uploadFrame" to have text "texts.uploadComplete"
46
46
  */
47
47
  async function expectTextInsideFrame(page, elementSelectorKey, frameSelectorKey, textKey) {
48
48
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -58,6 +58,6 @@ async function expectTextInsideFrame(page, elementSelectorKey, frameSelectorKey,
58
58
  // ==================================================
59
59
  // GLUE STEPS
60
60
  // ==================================================
61
- (0, registry_1.Step)("I click {string} inside frame {string}", clickInsideFrame, "When");
62
- (0, registry_1.Step)("I fill {string} inside frame {string} with {string}", fillInsideFrame, "When");
63
- (0, registry_1.Step)("I expect {string} inside frame {string} to have text {string}", expectTextInsideFrame, "Then");
61
+ (0, registry_1.Step)("I pw click {string} inside frame {string}", clickInsideFrame, "When");
62
+ (0, registry_1.Step)("I pw fill {string} inside frame {string} with {string}", fillInsideFrame, "When");
63
+ (0, registry_1.Step)("I pw expect {string} inside frame {string} to have text {string}", expectTextInsideFrame, "Then");
@@ -1,3 +1,25 @@
1
+ /**
2
+ * Sets the fixture configuration from playwright.config.ts
3
+ * @param config - The fixture configuration object
4
+ */
5
+ export declare function setFixtureConfig(config: {
6
+ fixturesDir?: string;
7
+ selectorsFile?: string;
8
+ textsFile?: string;
9
+ valuesFile?: string;
10
+ optionsFile?: string;
11
+ endpointsFile?: string;
12
+ filesFile?: string;
13
+ pathsFile?: string;
14
+ responsesFile?: string;
15
+ queriesFile?: string;
16
+ columnsFile?: string;
17
+ typesFile?: string;
18
+ titlesFile?: string;
19
+ urlsFile?: string;
20
+ attributesFile?: string;
21
+ promptsFile?: string;
22
+ }): void;
1
23
  /**
2
24
  * Loads a JSON fixture file from the test project's fixtures directory.
3
25
  * Looks in the current working directory (test project root).
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/backend/utils/fixtures.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAUjE;AACD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAoBlF"}
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/backend/utils/fixtures.ts"],"names":[],"mappings":"AA6BA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,IAAI,CAiDP;AAcD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAWjE;AACD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAoBlF"}