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 +1,248 @@
1
- export {};
1
+ import { CustomWorld } from "../helpers/world";
2
+ /**
3
+ * Asserts that an input element matching the given selector has an exact expected value.
4
+ *
5
+ * ```gherkin
6
+ * Then I see input {string} has value {string}
7
+ * ```
8
+ *
9
+ * @param selector - The CSS selector of the input element (e.g., "input[name='email']").
10
+ * @param expectedValue - The exact value the input is expected to have.
11
+ *
12
+ * @example
13
+ * Then I see input "input[name='email']" has value "user@example.com"
14
+ *
15
+ * @remarks
16
+ * This step uses Playwright's `expect(locator).toHaveValue()` which automatically waits
17
+ * for the input to have the specified value.
18
+ * @category Input Assertion Steps
19
+ */
20
+ export declare function Then_I_see_input_has_value(this: CustomWorld, selector: string, expectedValue: string): Promise<void>;
21
+ /**
22
+ * Asserts that the previously stored input element has an exact expected value.
23
+ *
24
+ * ```gherkin
25
+ * Then I see input value {string}
26
+ * ```
27
+ *
28
+ * @param expectedValue - The exact value the stored input is expected to have.
29
+ *
30
+ * @example
31
+ * When I find element by selector "input[name='email']"
32
+ * Then I see input value "user@example.com"
33
+ *
34
+ * @remarks
35
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
36
+ * to an input element. It uses Playwright's `locator.inputValue()` to get the current value
37
+ * and asserts strict equality.
38
+ * @category Input Assertion Steps
39
+ */
40
+ export declare function Then_I_see_stored_input_value(this: CustomWorld, expectedValue: string): Promise<void>;
41
+ /**
42
+ * Asserts that the previously stored input element's value contains a given substring.
43
+ *
44
+ * ```gherkin
45
+ * Then I see input value contains {string}
46
+ * ```
47
+ *
48
+ * @param part - The substring expected to be contained within the input's value.
49
+ *
50
+ * @example
51
+ * When I find element by selector "input[name='email']"
52
+ * Then I see input value contains "@gmail.com"
53
+ *
54
+ * @remarks
55
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
56
+ * to an input element. It uses Playwright's `locator.inputValue()` and then checks for substring presence.
57
+ * @category Input Assertion Steps
58
+ */
59
+ export declare function Then_I_see_stored_input_value_contains(this: CustomWorld, part: string): Promise<void>;
60
+ /**
61
+ * Asserts that an input element matching the given selector's value contains a given substring.
62
+ *
63
+ * ```gherkin
64
+ * Then I see input {string} value contains {string}
65
+ * ```
66
+ *
67
+ * @param selector - The CSS selector of the input element.
68
+ * @param partial - The substring expected to be contained within the input's value.
69
+ *
70
+ * @example
71
+ * Then I see input "input[name='email']" value contains "@gmail.com"
72
+ *
73
+ * @remarks
74
+ * This step uses Playwright's `locator.inputValue()` and asserts that the value includes the substring.
75
+ * @category Input Assertion Steps
76
+ */
77
+ export declare function Then_I_see_input_value_contains(this: CustomWorld, selector: string, partial: string): Promise<void>;
78
+ /**
79
+ * Asserts that a textarea element matching the given selector has an exact expected value.
80
+ *
81
+ * ```gherkin
82
+ * Then I see textarea {string} has value {string}
83
+ * ```
84
+ *
85
+ * @param selector - The CSS selector of the textarea element (e.g., "textarea[name='bio']").
86
+ * @param expectedValue - The exact value the textarea is expected to have.
87
+ *
88
+ * @example
89
+ * Then I see textarea "textarea[name='bio']" has value "Hello"
90
+ *
91
+ * @remarks
92
+ * This step uses Playwright's `expect(locator).toHaveValue()` which automatically waits
93
+ * for the textarea to have the specified value.
94
+ * @category Textarea Assertion Steps
95
+ */
96
+ export declare function Then_I_see_textarea_has_value(this: CustomWorld, selector: string, expectedValue: string): Promise<void>;
97
+ /**
98
+ * Asserts that the previously stored textarea element has an exact expected value.
99
+ *
100
+ * ```gherkin
101
+ * Then I see textarea value {string}
102
+ * ```
103
+ *
104
+ * @param expectedValue - The exact value the stored textarea is expected to have.
105
+ *
106
+ * @example
107
+ * When I find element by selector "textarea[name='bio']"
108
+ * Then I see textarea value "Hello"
109
+ *
110
+ * @remarks
111
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
112
+ * to a textarea element. It uses Playwright's `locator.inputValue()` to get the current value
113
+ * and asserts strict equality.
114
+ * @category Textarea Assertion Steps
115
+ */
116
+ export declare function Then_I_see_stored_textarea_value(this: CustomWorld, expectedValue: string): Promise<void>;
117
+ /**
118
+ * Asserts that the previously stored textarea element's value contains a given substring.
119
+ *
120
+ * ```gherkin
121
+ * Then I see textarea value contains {string}
122
+ * ```
123
+ *
124
+ * @param part - The substring expected to be contained within the textarea's value.
125
+ *
126
+ * @example
127
+ * When I find element by selector "textarea[name='bio']"
128
+ * Then I see textarea value contains "Hello"
129
+ *
130
+ * @remarks
131
+ * This step requires a preceding step that sets the {@link CustomWorld.element | current element}
132
+ * to a textarea element. It uses Playwright's `locator.inputValue()` and then checks for substring presence.
133
+ * @category Textarea Assertion Steps
134
+ */
135
+ export declare function Then_I_see_stored_textarea_value_contains(this: CustomWorld, part: string): Promise<void>;
136
+ /**
137
+ * Asserts that a textarea element matching the given selector's value contains a given substring.
138
+ *
139
+ * ```gherkin
140
+ * Then I see textarea {string} value contains {string}
141
+ * ```
142
+ *
143
+ * @param selector - The CSS selector of the textarea element.
144
+ * @param partial - The substring expected to be contained within the textarea's value.
145
+ *
146
+ * @example
147
+ * Then I see textarea "textarea[name='bio']" value contains "Hello"
148
+ *
149
+ * @remarks
150
+ * This step uses Playwright's `locator.inputValue()` and asserts that the value includes the substring.
151
+ * @category Textarea Assertion Steps
152
+ */
153
+ export declare function Then_I_see_textarea_value_contains(this: CustomWorld, selector: string, partial: string): Promise<void>;
154
+ /**
155
+ * Asserts that an element matching the given selector has an exact expected value.
156
+ * This step is generic and can be used for inputs, textareas, or other elements
157
+ * whose value can be retrieved by Playwright's `toHaveValue`.
158
+ *
159
+ * ```gherkin
160
+ * Then I see value {string} in {string}
161
+ * ```
162
+ *
163
+ * @param expectedValue - The exact value expected.
164
+ * @param selector - The CSS selector of the element to check.
165
+ *
166
+ * @example
167
+ * Then I see value "foo" in "input[name='foo']"
168
+ * Then I see value "true" in "input[type='checkbox'][name='terms']"
169
+ *
170
+ * @remarks
171
+ * This step uses Playwright's `expect(locator).toHaveValue()` which is suitable
172
+ * for `<input>`, `<textarea>`, and `<select>` elements.
173
+ * @category Generic Assertion Steps
174
+ */
175
+ export declare function Then_I_see_value_in_element(this: CustomWorld, expectedValue: string, selector: string): Promise<void>;
176
+ /**
177
+ * Asserts that an element matching the given selector does NOT have a specific value.
178
+ *
179
+ * ```gherkin
180
+ * Then I do not see value {string} in {string}
181
+ * ```
182
+ *
183
+ * @param unwantedValue - The value that is expected NOT to be found.
184
+ * @param selector - The CSS selector of the element to check.
185
+ *
186
+ * @example
187
+ * Then I do not see value "guest" in "input[name='userRole']"
188
+ *
189
+ * @remarks
190
+ * This step uses Playwright's `expect(locator).not.toHaveValue()` for robust assertion.
191
+ * @category Generic Assertion Steps
192
+ */
193
+ export declare function Then_I_do_not_see_value_in_element(this: CustomWorld, unwantedValue: string, selector: string): Promise<void>;
194
+ /**
195
+ * Asserts that an `<option>` element with the given text exists in the DOM.
196
+ * It does not necessarily assert that it is selected or visible within a `<select>` element.
197
+ *
198
+ * ```gherkin
199
+ * Then I see option {string}
200
+ * ```
201
+ *
202
+ * @param optionText - The text of the option expected to exist.
203
+ *
204
+ * @example
205
+ * Then I see option "Admin"
206
+ *
207
+ * @remarks
208
+ * This step directly targets `<option>` tags by their text content.
209
+ * It asserts that at least one such option exists in the DOM.
210
+ * @category Select Option Assertion Steps
211
+ */
212
+ export declare function Then_I_see_option(this: CustomWorld, optionText: string): Promise<void>;
213
+ /**
214
+ * Asserts that an `<option>` element with the given text is NOT visible.
215
+ *
216
+ * ```gherkin
217
+ * Then I do not see option {string}
218
+ * ```
219
+ *
220
+ * @param optionText - The text of the option expected NOT to be visible.
221
+ *
222
+ * @example
223
+ * Then I do not see option "Deprecated Feature"
224
+ *
225
+ * @remarks
226
+ * This step targets `<option>` tags by their text content and asserts that
227
+ * any matching options are not visible. This is useful for dynamically hidden options.
228
+ * @category Select Option Assertion Steps
229
+ */
230
+ export declare function Then_I_do_not_see_option(this: CustomWorld, optionText: string): Promise<void>;
231
+ /**
232
+ * Asserts that an `<option>` element with the given text does NOT exist in the DOM.
233
+ *
234
+ * ```gherkin
235
+ * Then I do not see option {string} (regex pattern)
236
+ * ```
237
+ *
238
+ * @param optionText - The text of the option expected NOT to exist in the DOM.
239
+ *
240
+ * @example
241
+ * Then I do not see option "Super Admin"
242
+ *
243
+ * @remarks
244
+ * This step targets `<option>` tags by their text content and asserts that
245
+ * no such option is present in the DOM. This is useful for verifying removed options.
246
+ * @category Select Option Assertion Steps
247
+ */
248
+ export declare function Then_I_do_not_see_option_exists(this: CustomWorld, optionText: string): Promise<void>;