playwright-cucumber-ts-steps 0.1.7 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +21 -11
  2. package/lib/actions/clickSteps.d.ts +251 -1
  3. package/lib/actions/clickSteps.js +297 -47
  4. package/lib/actions/cookieSteps.d.ts +18 -1
  5. package/lib/actions/cookieSteps.js +65 -0
  6. package/lib/actions/debugSteps.d.ts +14 -1
  7. package/lib/actions/debugSteps.js +18 -3
  8. package/lib/actions/elementFindSteps.d.ts +668 -1
  9. package/lib/actions/elementFindSteps.js +808 -94
  10. package/lib/actions/fillFormSteps.d.ts +69 -1
  11. package/lib/actions/fillFormSteps.js +178 -71
  12. package/lib/actions/index.d.ts +11 -0
  13. package/lib/actions/index.js +28 -0
  14. package/lib/actions/inputSteps.d.ts +218 -1
  15. package/lib/actions/inputSteps.js +303 -57
  16. package/lib/actions/interceptionSteps.d.ts +169 -1
  17. package/lib/actions/interceptionSteps.js +258 -38
  18. package/lib/actions/miscSteps.d.ts +645 -1
  19. package/lib/actions/miscSteps.js +898 -157
  20. package/lib/actions/mouseSteps.d.ts +143 -1
  21. package/lib/actions/mouseSteps.js +200 -32
  22. package/lib/actions/scrollSteps.d.ts +82 -1
  23. package/lib/actions/scrollSteps.js +116 -16
  24. package/lib/actions/storageSteps.d.ts +174 -1
  25. package/lib/actions/storageSteps.js +253 -33
  26. package/lib/assertions/buttonAndTextVisibilitySteps.d.ts +245 -1
  27. package/lib/assertions/buttonAndTextVisibilitySteps.js +342 -91
  28. package/lib/assertions/cookieSteps.d.ts +75 -1
  29. package/lib/assertions/cookieSteps.js +97 -29
  30. package/lib/assertions/elementSteps.d.ts +264 -1
  31. package/lib/assertions/elementSteps.js +376 -78
  32. package/lib/assertions/formInputSteps.d.ts +248 -1
  33. package/lib/assertions/formInputSteps.js +342 -79
  34. package/lib/assertions/index.d.ts +10 -0
  35. package/lib/assertions/index.js +27 -0
  36. package/lib/assertions/interceptionRequestsSteps.d.ts +353 -1
  37. package/lib/assertions/interceptionRequestsSteps.js +569 -177
  38. package/lib/assertions/locationSteps.d.ts +217 -1
  39. package/lib/assertions/locationSteps.js +287 -64
  40. package/lib/assertions/roleTestIdSteps.d.ts +159 -1
  41. package/lib/assertions/roleTestIdSteps.js +217 -22
  42. package/lib/assertions/semanticSteps.d.ts +176 -1
  43. package/lib/assertions/semanticSteps.js +245 -60
  44. package/lib/assertions/storageSteps.d.ts +149 -1
  45. package/lib/assertions/storageSteps.js +201 -65
  46. package/lib/assertions/visualSteps.d.ts +74 -1
  47. package/lib/assertions/visualSteps.js +178 -45
  48. package/lib/custom_setups/loginHooks.js +19 -2
  49. package/lib/helpers/world.d.ts +3 -0
  50. package/lib/helpers/world.js +11 -5
  51. package/lib/index.d.ts +3 -21
  52. package/lib/index.js +3 -23
  53. package/package.json +9 -2
  54. package/src/actions/clickSteps.ts +364 -142
  55. package/src/actions/cookieSteps.ts +66 -0
  56. package/src/actions/debugSteps.ts +17 -3
  57. package/src/actions/elementFindSteps.ts +822 -117
  58. package/src/actions/fillFormSteps.ts +234 -177
  59. package/src/actions/index.ts +12 -0
  60. package/src/actions/inputSteps.ts +318 -82
  61. package/src/actions/interceptionSteps.ts +295 -57
  62. package/src/actions/miscSteps.ts +984 -254
  63. package/src/actions/mouseSteps.ts +212 -55
  64. package/src/actions/scrollSteps.ts +114 -16
  65. package/src/actions/storageSteps.ts +267 -42
  66. package/src/assertions/buttonAndTextVisibilitySteps.ts +353 -95
  67. package/src/assertions/cookieSteps.ts +115 -36
  68. package/src/assertions/elementSteps.ts +414 -85
  69. package/src/assertions/formInputSteps.ts +375 -108
  70. package/src/assertions/index.ts +11 -0
  71. package/src/assertions/interceptionRequestsSteps.ts +619 -195
  72. package/src/assertions/locationSteps.ts +280 -64
  73. package/src/assertions/roleTestIdSteps.ts +244 -26
  74. package/src/assertions/semanticSteps.ts +257 -69
  75. package/src/assertions/storageSteps.ts +234 -73
  76. package/src/assertions/visualSteps.ts +245 -68
  77. package/src/custom_setups/loginHooks.ts +21 -2
  78. package/src/helpers/world.ts +30 -4
  79. package/src/index.ts +4 -25
@@ -1,87 +1,350 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Then_I_see_input_has_value = Then_I_see_input_has_value;
4
+ exports.Then_I_see_stored_input_value = Then_I_see_stored_input_value;
5
+ exports.Then_I_see_stored_input_value_contains = Then_I_see_stored_input_value_contains;
6
+ exports.Then_I_see_input_value_contains = Then_I_see_input_value_contains;
7
+ exports.Then_I_see_textarea_has_value = Then_I_see_textarea_has_value;
8
+ exports.Then_I_see_stored_textarea_value = Then_I_see_stored_textarea_value;
9
+ exports.Then_I_see_stored_textarea_value_contains = Then_I_see_stored_textarea_value_contains;
10
+ exports.Then_I_see_textarea_value_contains = Then_I_see_textarea_value_contains;
11
+ exports.Then_I_see_value_in_element = Then_I_see_value_in_element;
12
+ exports.Then_I_do_not_see_value_in_element = Then_I_do_not_see_value_in_element;
13
+ exports.Then_I_see_option = Then_I_see_option;
14
+ exports.Then_I_do_not_see_option = Then_I_do_not_see_option;
15
+ exports.Then_I_do_not_see_option_exists = Then_I_do_not_see_option_exists;
3
16
  const cucumber_1 = require("@cucumber/cucumber");
4
17
  const test_1 = require("@playwright/test");
5
- //
6
- // 🧾 INPUT VALUES
7
- //
8
- (0, cucumber_1.Then)(/^I see input "([^"]+)" has value "(.*)"$/, async function (selector, value) {
9
- const el = this.page.locator(selector);
10
- await (0, test_1.expect)(el).toHaveValue(value);
11
- });
12
- (0, cucumber_1.Then)("I see input value {string}", async function (expected) {
18
+ // ===================================================================================
19
+ // ASSERTIONS: INPUT VALUES
20
+ // ===================================================================================
21
+ /**
22
+ * Asserts that an input element matching the given selector has an exact expected value.
23
+ *
24
+ * ```gherkin
25
+ * Then I see input {string} has value {string}
26
+ * ```
27
+ *
28
+ * @param selector - The CSS selector of the input element (e.g., "input[name='email']").
29
+ * @param expectedValue - The exact value the input is expected to have.
30
+ *
31
+ * @example
32
+ * Then I see input "input[name='email']" has value "user@example.com"
33
+ *
34
+ * @remarks
35
+ * This step uses Playwright's `expect(locator).toHaveValue()` which automatically waits
36
+ * for the input to have the specified value.
37
+ * @category Input Assertion Steps
38
+ */
39
+ async function Then_I_see_input_has_value(selector, expectedValue) {
40
+ const locator = this.page.locator(selector);
41
+ await (0, test_1.expect)(locator).toHaveValue(expectedValue, { timeout: 5000 });
42
+ this.log?.(`✅ Verified input "${selector}" has value: "${expectedValue}".`);
43
+ }
44
+ (0, cucumber_1.Then)(/^I see input "([^"]+)" has value "(.*)"$/, Then_I_see_input_has_value);
45
+ /**
46
+ * Asserts that the previously stored input element has an exact expected value.
47
+ *
48
+ * ```gherkin
49
+ * Then I see input value {string}
50
+ * ```
51
+ *
52
+ * @param expectedValue - The exact value the stored input is expected to have.
53
+ *
54
+ * @example
55
+ * When I find element by selector "input[name='email']"
56
+ * Then I see input value "user@example.com"
57
+ *
58
+ * @remarks
59
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
60
+ * to an input element. It uses Playwright's `locator.inputValue()` to get the current value
61
+ * and asserts strict equality.
62
+ * @category Input Assertion Steps
63
+ */
64
+ async function Then_I_see_stored_input_value(expectedValue) {
13
65
  if (!this.element)
14
- throw new Error("No element stored in context");
15
- const value = await this.element.inputValue();
16
- (0, test_1.expect)(value).toBe(expected);
17
- });
18
- (0, cucumber_1.Then)("I see input value contains {string}", async function (part) {
66
+ throw new Error("No element stored in context. Use a 'find' step to select an input.");
67
+ await (0, test_1.expect)(this.element).toHaveValue(expectedValue, { timeout: 5000 });
68
+ this.log?.(`✅ Verified stored input has value: "${expectedValue}".`);
69
+ }
70
+ (0, cucumber_1.Then)("I see input value {string}", Then_I_see_stored_input_value);
71
+ /**
72
+ * Asserts that the previously stored input element's value contains a given substring.
73
+ *
74
+ * ```gherkin
75
+ * Then I see input value contains {string}
76
+ * ```
77
+ *
78
+ * @param part - The substring expected to be contained within the input's value.
79
+ *
80
+ * @example
81
+ * When I find element by selector "input[name='email']"
82
+ * Then I see input value contains "@gmail.com"
83
+ *
84
+ * @remarks
85
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
86
+ * to an input element. It uses Playwright's `locator.inputValue()` and then checks for substring presence.
87
+ * @category Input Assertion Steps
88
+ */
89
+ async function Then_I_see_stored_input_value_contains(part) {
19
90
  if (!this.element)
20
- throw new Error("No element stored in context");
21
- const value = await this.element.inputValue();
22
- (0, test_1.expect)(value).toContain(part);
23
- });
24
- (0, cucumber_1.Then)(/^I see input "([^"]+)" value contains "(.*)"$/, async function (selector, partial) {
25
- const val = await this.page.locator(selector).inputValue();
26
- (0, test_1.expect)(val).toContain(partial);
27
- });
28
- //
29
- // 📝 TEXTAREA VALUES
30
- //
31
- (0, cucumber_1.Then)(/^I see textarea "([^"]+)" has value "(.*)"$/, async function (selector, value) {
32
- const el = this.page.locator(selector);
33
- await (0, test_1.expect)(el).toHaveValue(value);
34
- });
35
- (0, cucumber_1.Then)("I see textarea value {string}", async function (expected) {
91
+ throw new Error("No element stored in context. Use a 'find' step to select an input.");
92
+ // Use Playwright's toHaveValue with a regex for 'contains'
93
+ await (0, test_1.expect)(this.element).toHaveValue(new RegExp(part), { timeout: 5000 });
94
+ this.log?.(`✅ Verified stored input value contains: "${part}".`);
95
+ }
96
+ (0, cucumber_1.Then)("I see input value contains {string}", Then_I_see_stored_input_value_contains);
97
+ /**
98
+ * Asserts that an input element matching the given selector's value contains a given substring.
99
+ *
100
+ * ```gherkin
101
+ * Then I see input {string} value contains {string}
102
+ * ```
103
+ *
104
+ * @param selector - The CSS selector of the input element.
105
+ * @param partial - The substring expected to be contained within the input's value.
106
+ *
107
+ * @example
108
+ * Then I see input "input[name='email']" value contains "@gmail.com"
109
+ *
110
+ * @remarks
111
+ * This step uses Playwright's `locator.inputValue()` and asserts that the value includes the substring.
112
+ * @category Input Assertion Steps
113
+ */
114
+ async function Then_I_see_input_value_contains(selector, partial) {
115
+ const locator = this.page.locator(selector);
116
+ // Use Playwright's toHaveValue with a regex for 'contains'
117
+ await (0, test_1.expect)(locator).toHaveValue(new RegExp(partial), { timeout: 5000 });
118
+ this.log?.(`✅ Verified input "${selector}" value contains: "${partial}".`);
119
+ }
120
+ (0, cucumber_1.Then)(/^I see input "([^"]+)" value contains "(.*)"$/, Then_I_see_input_value_contains);
121
+ // ===================================================================================
122
+ // ASSERTIONS: TEXTAREA VALUES
123
+ // ===================================================================================
124
+ /**
125
+ * Asserts that a textarea element matching the given selector has an exact expected value.
126
+ *
127
+ * ```gherkin
128
+ * Then I see textarea {string} has value {string}
129
+ * ```
130
+ *
131
+ * @param selector - The CSS selector of the textarea element (e.g., "textarea[name='bio']").
132
+ * @param expectedValue - The exact value the textarea is expected to have.
133
+ *
134
+ * @example
135
+ * Then I see textarea "textarea[name='bio']" has value "Hello"
136
+ *
137
+ * @remarks
138
+ * This step uses Playwright's `expect(locator).toHaveValue()` which automatically waits
139
+ * for the textarea to have the specified value.
140
+ * @category Textarea Assertion Steps
141
+ */
142
+ async function Then_I_see_textarea_has_value(selector, expectedValue) {
143
+ const locator = this.page.locator(selector);
144
+ await (0, test_1.expect)(locator).toHaveValue(expectedValue, { timeout: 5000 });
145
+ this.log?.(`✅ Verified textarea "${selector}" has value: "${expectedValue}".`);
146
+ }
147
+ (0, cucumber_1.Then)(/^I see textarea "([^"]+)" has value "(.*)"$/, Then_I_see_textarea_has_value);
148
+ /**
149
+ * Asserts that the previously stored textarea element has an exact expected value.
150
+ *
151
+ * ```gherkin
152
+ * Then I see textarea value {string}
153
+ * ```
154
+ *
155
+ * @param expectedValue - The exact value the stored textarea is expected to have.
156
+ *
157
+ * @example
158
+ * When I find element by selector "textarea[name='bio']"
159
+ * Then I see textarea value "Hello"
160
+ *
161
+ * @remarks
162
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
163
+ * to a textarea element. It uses Playwright's `locator.inputValue()` to get the current value
164
+ * and asserts strict equality.
165
+ * @category Textarea Assertion Steps
166
+ */
167
+ async function Then_I_see_stored_textarea_value(expectedValue) {
36
168
  if (!this.element)
37
- throw new Error("No textarea selected");
38
- const value = await this.element.inputValue();
39
- if (value !== expected)
40
- throw new Error(`Expected "${expected}", got "${value}"`);
41
- });
42
- (0, cucumber_1.Then)("I see textarea value contains {string}", async function (part) {
169
+ throw new Error("No textarea selected. Use a 'find' step to select a textarea.");
170
+ await (0, test_1.expect)(this.element).toHaveValue(expectedValue, { timeout: 5000 });
171
+ this.log?.(`✅ Verified stored textarea has value: "${expectedValue}".`);
172
+ }
173
+ (0, cucumber_1.Then)("I see textarea value {string}", Then_I_see_stored_textarea_value);
174
+ /**
175
+ * Asserts that the previously stored textarea element's value contains a given substring.
176
+ *
177
+ * ```gherkin
178
+ * Then I see textarea value contains {string}
179
+ * ```
180
+ *
181
+ * @param part - The substring expected to be contained within the textarea's value.
182
+ *
183
+ * @example
184
+ * When I find element by selector "textarea[name='bio']"
185
+ * Then I see textarea value contains "Hello"
186
+ *
187
+ * @remarks
188
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
189
+ * to a textarea element. It uses Playwright's `locator.inputValue()` and then checks for substring presence.
190
+ * @category Textarea Assertion Steps
191
+ */
192
+ async function Then_I_see_stored_textarea_value_contains(part) {
43
193
  if (!this.element)
44
- throw new Error("No textarea selected");
45
- const value = await this.element.inputValue();
46
- if (!value.includes(part)) {
47
- throw new Error(`Textarea does not contain "${part}". Got: "${value}"`);
48
- }
49
- });
50
- (0, cucumber_1.Then)(/^I see textarea "([^"]+)" value contains "(.*)"$/, async function (selector, partial) {
51
- const val = await this.page.locator(selector).inputValue();
52
- (0, test_1.expect)(val).toContain(partial);
53
- });
54
- //
55
- // GENERIC VALUE MATCHING
56
- //
57
- (0, cucumber_1.Then)(/^I see value "(.*)" in "([^"]+)"$/, async function (value, selector) {
58
- const el = this.page.locator(selector);
59
- await (0, test_1.expect)(el).toHaveValue(value);
60
- });
61
- (0, cucumber_1.Then)(/^I do not see value "(.*)" in "([^"]+)"$/, async function (value, selector) {
62
- const actual = await this.page.locator(selector).inputValue();
63
- (0, test_1.expect)(actual).not.toBe(value);
64
- });
65
- //
66
- // ⬇️ OPTION IN SELECT
67
- //
68
- (0, cucumber_1.Then)(/^I see option "(.*)"$/, async function (optionText) {
69
- const el = this.page.locator(`option`, { hasText: optionText });
70
- await (0, test_1.expect)(el).toHaveCount(1);
71
- });
72
- (0, cucumber_1.Then)("I see option {string}", async function (optionText) {
73
- const option = this.page.locator("option", { hasText: optionText });
74
- if (!(await option.isVisible())) {
75
- throw new Error(`Option "${optionText}" not visible`);
76
- }
77
- });
78
- (0, cucumber_1.Then)("I do not see option {string}", async function (optionText) {
79
- const option = this.page.locator("option", { hasText: optionText });
80
- if ((await option.count()) > 0 && (await option.first().isVisible())) {
81
- throw new Error(`Option "${optionText}" is visible but should not be`);
82
- }
83
- });
84
- (0, cucumber_1.Then)(/^I do not see option "(.*)"$/, async function (optionText) {
85
- const el = this.page.locator(`option`, { hasText: optionText });
86
- await (0, test_1.expect)(el).toHaveCount(0);
87
- });
194
+ throw new Error("No textarea selected. Use a 'find' step to select a textarea.");
195
+ // Use Playwright's toHaveValue with a regex for 'contains'
196
+ await (0, test_1.expect)(this.element).toHaveValue(new RegExp(part), { timeout: 5000 });
197
+ this.log?.(`✅ Verified stored textarea value contains: "${part}".`);
198
+ }
199
+ (0, cucumber_1.Then)("I see textarea value contains {string}", Then_I_see_stored_textarea_value_contains);
200
+ /**
201
+ * Asserts that a textarea element matching the given selector's value contains a given substring.
202
+ *
203
+ * ```gherkin
204
+ * Then I see textarea {string} value contains {string}
205
+ * ```
206
+ *
207
+ * @param selector - The CSS selector of the textarea element.
208
+ * @param partial - The substring expected to be contained within the textarea's value.
209
+ *
210
+ * @example
211
+ * Then I see textarea "textarea[name='bio']" value contains "Hello"
212
+ *
213
+ * @remarks
214
+ * This step uses Playwright's `locator.inputValue()` and asserts that the value includes the substring.
215
+ * @category Textarea Assertion Steps
216
+ */
217
+ async function Then_I_see_textarea_value_contains(selector, partial) {
218
+ const locator = this.page.locator(selector);
219
+ // Use Playwright's toHaveValue with a regex for 'contains'
220
+ await (0, test_1.expect)(locator).toHaveValue(new RegExp(partial), { timeout: 5000 });
221
+ this.log?.(`✅ Verified textarea "${selector}" value contains: "${partial}".`);
222
+ }
223
+ (0, cucumber_1.Then)(/^I see textarea "([^"]+)" value contains "(.*)"$/, Then_I_see_textarea_value_contains);
224
+ // ===================================================================================
225
+ // ASSERTIONS: GENERIC VALUE MATCHING (by Selector)
226
+ // ===================================================================================
227
+ /**
228
+ * Asserts that an element matching the given selector has an exact expected value.
229
+ * This step is generic and can be used for inputs, textareas, or other elements
230
+ * whose value can be retrieved by Playwright's `toHaveValue`.
231
+ *
232
+ * ```gherkin
233
+ * Then I see value {string} in {string}
234
+ * ```
235
+ *
236
+ * @param expectedValue - The exact value expected.
237
+ * @param selector - The CSS selector of the element to check.
238
+ *
239
+ * @example
240
+ * Then I see value "foo" in "input[name='foo']"
241
+ * Then I see value "true" in "input[type='checkbox'][name='terms']"
242
+ *
243
+ * @remarks
244
+ * This step uses Playwright's `expect(locator).toHaveValue()` which is suitable
245
+ * for `<input>`, `<textarea>`, and `<select>` elements.
246
+ * @category Generic Assertion Steps
247
+ */
248
+ async function Then_I_see_value_in_element(expectedValue, selector) {
249
+ const locator = this.page.locator(selector);
250
+ await (0, test_1.expect)(locator).toHaveValue(expectedValue, { timeout: 5000 });
251
+ this.log?.(`✅ Verified value "${expectedValue}" in element "${selector}".`);
252
+ }
253
+ (0, cucumber_1.Then)(/^I see value "(.*)" in "([^"]+)"$/, Then_I_see_value_in_element);
254
+ /**
255
+ * Asserts that an element matching the given selector does NOT have a specific value.
256
+ *
257
+ * ```gherkin
258
+ * Then I do not see value {string} in {string}
259
+ * ```
260
+ *
261
+ * @param unwantedValue - The value that is expected NOT to be found.
262
+ * @param selector - The CSS selector of the element to check.
263
+ *
264
+ * @example
265
+ * Then I do not see value "guest" in "input[name='userRole']"
266
+ *
267
+ * @remarks
268
+ * This step uses Playwright's `expect(locator).not.toHaveValue()` for robust assertion.
269
+ * @category Generic Assertion Steps
270
+ */
271
+ async function Then_I_do_not_see_value_in_element(unwantedValue, selector) {
272
+ const locator = this.page.locator(selector);
273
+ await (0, test_1.expect)(locator).not.toHaveValue(unwantedValue, { timeout: 5000 });
274
+ this.log?.(`✅ Verified value "${unwantedValue}" is NOT in element "${selector}".`);
275
+ }
276
+ (0, cucumber_1.Then)(/^I do not see value "(.*)" in "([^"]+)"$/, Then_I_do_not_see_value_in_element);
277
+ // ===================================================================================
278
+ // ASSERTIONS: OPTION IN SELECT ELEMENTS
279
+ // ===================================================================================
280
+ /**
281
+ * Asserts that an `<option>` element with the given text exists in the DOM.
282
+ * It does not necessarily assert that it is selected or visible within a `<select>` element.
283
+ *
284
+ * ```gherkin
285
+ * Then I see option {string}
286
+ * ```
287
+ *
288
+ * @param optionText - The text of the option expected to exist.
289
+ *
290
+ * @example
291
+ * Then I see option "Admin"
292
+ *
293
+ * @remarks
294
+ * This step directly targets `<option>` tags by their text content.
295
+ * It asserts that at least one such option exists in the DOM.
296
+ * @category Select Option Assertion Steps
297
+ */
298
+ async function Then_I_see_option(optionText) {
299
+ const locator = this.page.locator(`option`, { hasText: optionText });
300
+ await (0, test_1.expect)(locator).toHaveCount(1, { timeout: 5000 });
301
+ this.log?.(`✅ Verified option "${optionText}" exists.`);
302
+ }
303
+ (0, cucumber_1.Then)(/^I see option "(.*)"$/, Then_I_see_option); // Regex for flexibility
304
+ (0, cucumber_1.Then)("I see option {string}", Then_I_see_option); // Strict string for clarity, links to same implementation
305
+ /**
306
+ * Asserts that an `<option>` element with the given text is NOT visible.
307
+ *
308
+ * ```gherkin
309
+ * Then I do not see option {string}
310
+ * ```
311
+ *
312
+ * @param optionText - The text of the option expected NOT to be visible.
313
+ *
314
+ * @example
315
+ * Then I do not see option "Deprecated Feature"
316
+ *
317
+ * @remarks
318
+ * This step targets `<option>` tags by their text content and asserts that
319
+ * any matching options are not visible. This is useful for dynamically hidden options.
320
+ * @category Select Option Assertion Steps
321
+ */
322
+ async function Then_I_do_not_see_option(optionText) {
323
+ const locator = this.page.locator(`option`, { hasText: optionText });
324
+ await (0, test_1.expect)(locator).not.toBeVisible({ timeout: 5000 });
325
+ this.log?.(`✅ Verified option "${optionText}" is NOT visible.`);
326
+ }
327
+ (0, cucumber_1.Then)("I do not see option {string}", Then_I_do_not_see_option);
328
+ /**
329
+ * Asserts that an `<option>` element with the given text does NOT exist in the DOM.
330
+ *
331
+ * ```gherkin
332
+ * Then I do not see option {string} (regex pattern)
333
+ * ```
334
+ *
335
+ * @param optionText - The text of the option expected NOT to exist in the DOM.
336
+ *
337
+ * @example
338
+ * Then I do not see option "Super Admin"
339
+ *
340
+ * @remarks
341
+ * This step targets `<option>` tags by their text content and asserts that
342
+ * no such option is present in the DOM. This is useful for verifying removed options.
343
+ * @category Select Option Assertion Steps
344
+ */
345
+ async function Then_I_do_not_see_option_exists(optionText) {
346
+ const locator = this.page.locator(`option`, { hasText: optionText });
347
+ await (0, test_1.expect)(locator).toHaveCount(0, { timeout: 5000 });
348
+ this.log?.(`✅ Verified option "${optionText}" does NOT exist.`);
349
+ }
350
+ (0, cucumber_1.Then)(/^I do not see option "(.*)"$/, Then_I_do_not_see_option_exists);
@@ -0,0 +1,10 @@
1
+ export * from "./buttonAndTextVisibilitySteps";
2
+ export * from "./cookieSteps";
3
+ export * from "./elementSteps";
4
+ export * from "./formInputSteps";
5
+ export * from "./interceptionRequestsSteps";
6
+ export * from "./locationSteps";
7
+ export * from "./roleTestIdSteps";
8
+ export * from "./semanticSteps";
9
+ export * from "./storageSteps";
10
+ export * from "./visualSteps";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Assertions
18
+ __exportStar(require("./buttonAndTextVisibilitySteps"), exports);
19
+ __exportStar(require("./cookieSteps"), exports);
20
+ __exportStar(require("./elementSteps"), exports);
21
+ __exportStar(require("./formInputSteps"), exports);
22
+ __exportStar(require("./interceptionRequestsSteps"), exports);
23
+ __exportStar(require("./locationSteps"), exports);
24
+ __exportStar(require("./roleTestIdSteps"), exports);
25
+ __exportStar(require("./semanticSteps"), exports);
26
+ __exportStar(require("./storageSteps"), exports);
27
+ __exportStar(require("./visualSteps"), exports);