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.
- package/README.md +21 -11
- package/lib/actions/clickSteps.d.ts +251 -1
- package/lib/actions/clickSteps.js +297 -47
- package/lib/actions/cookieSteps.d.ts +18 -1
- package/lib/actions/cookieSteps.js +65 -0
- package/lib/actions/debugSteps.d.ts +14 -1
- package/lib/actions/debugSteps.js +18 -3
- package/lib/actions/elementFindSteps.d.ts +668 -1
- package/lib/actions/elementFindSteps.js +808 -94
- package/lib/actions/fillFormSteps.d.ts +69 -1
- package/lib/actions/fillFormSteps.js +178 -71
- package/lib/actions/index.d.ts +11 -0
- package/lib/actions/index.js +28 -0
- package/lib/actions/inputSteps.d.ts +218 -1
- package/lib/actions/inputSteps.js +303 -57
- package/lib/actions/interceptionSteps.d.ts +169 -1
- package/lib/actions/interceptionSteps.js +258 -38
- package/lib/actions/miscSteps.d.ts +645 -1
- package/lib/actions/miscSteps.js +898 -157
- package/lib/actions/mouseSteps.d.ts +143 -1
- package/lib/actions/mouseSteps.js +200 -32
- package/lib/actions/scrollSteps.d.ts +82 -1
- package/lib/actions/scrollSteps.js +116 -16
- package/lib/actions/storageSteps.d.ts +174 -1
- package/lib/actions/storageSteps.js +253 -33
- package/lib/assertions/buttonAndTextVisibilitySteps.d.ts +245 -1
- package/lib/assertions/buttonAndTextVisibilitySteps.js +342 -91
- package/lib/assertions/cookieSteps.d.ts +75 -1
- package/lib/assertions/cookieSteps.js +97 -29
- package/lib/assertions/elementSteps.d.ts +264 -1
- package/lib/assertions/elementSteps.js +376 -78
- package/lib/assertions/formInputSteps.d.ts +248 -1
- package/lib/assertions/formInputSteps.js +342 -79
- package/lib/assertions/index.d.ts +10 -0
- package/lib/assertions/index.js +27 -0
- package/lib/assertions/interceptionRequestsSteps.d.ts +353 -1
- package/lib/assertions/interceptionRequestsSteps.js +569 -177
- package/lib/assertions/locationSteps.d.ts +217 -1
- package/lib/assertions/locationSteps.js +287 -64
- package/lib/assertions/roleTestIdSteps.d.ts +159 -1
- package/lib/assertions/roleTestIdSteps.js +217 -22
- package/lib/assertions/semanticSteps.d.ts +176 -1
- package/lib/assertions/semanticSteps.js +245 -60
- package/lib/assertions/storageSteps.d.ts +149 -1
- package/lib/assertions/storageSteps.js +201 -65
- package/lib/assertions/visualSteps.d.ts +74 -1
- package/lib/assertions/visualSteps.js +178 -45
- package/lib/custom_setups/loginHooks.js +19 -2
- package/lib/helpers/world.d.ts +3 -0
- package/lib/helpers/world.js +11 -5
- package/lib/index.d.ts +3 -21
- package/lib/index.js +3 -23
- package/package.json +9 -2
- package/src/actions/clickSteps.ts +364 -142
- package/src/actions/cookieSteps.ts +66 -0
- package/src/actions/debugSteps.ts +17 -3
- package/src/actions/elementFindSteps.ts +822 -117
- package/src/actions/fillFormSteps.ts +234 -177
- package/src/actions/index.ts +12 -0
- package/src/actions/inputSteps.ts +318 -82
- package/src/actions/interceptionSteps.ts +295 -57
- package/src/actions/miscSteps.ts +984 -254
- package/src/actions/mouseSteps.ts +212 -55
- package/src/actions/scrollSteps.ts +114 -16
- package/src/actions/storageSteps.ts +267 -42
- package/src/assertions/buttonAndTextVisibilitySteps.ts +353 -95
- package/src/assertions/cookieSteps.ts +115 -36
- package/src/assertions/elementSteps.ts +414 -85
- package/src/assertions/formInputSteps.ts +375 -108
- package/src/assertions/index.ts +11 -0
- package/src/assertions/interceptionRequestsSteps.ts +619 -195
- package/src/assertions/locationSteps.ts +280 -64
- package/src/assertions/roleTestIdSteps.ts +244 -26
- package/src/assertions/semanticSteps.ts +257 -69
- package/src/assertions/storageSteps.ts +234 -73
- package/src/assertions/visualSteps.ts +245 -68
- package/src/custom_setups/loginHooks.ts +21 -2
- package/src/helpers/world.ts +30 -4
- package/src/index.ts +4 -25
|
@@ -1,67 +1,252 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Then_I_see_heading = Then_I_see_heading;
|
|
4
|
+
exports.Then_I_do_not_see_heading = Then_I_do_not_see_heading;
|
|
5
|
+
exports.Then_I_see_label = Then_I_see_label;
|
|
6
|
+
exports.Then_I_do_not_see_label = Then_I_do_not_see_label;
|
|
7
|
+
exports.Then_I_see_link = Then_I_see_link;
|
|
8
|
+
exports.Then_I_do_not_see_link = Then_I_do_not_see_link;
|
|
9
|
+
exports.Then_I_count_current_locator_elements = Then_I_count_current_locator_elements;
|
|
10
|
+
exports.Then_I_see_document_title = Then_I_see_document_title;
|
|
11
|
+
exports.Then_I_see_document_title_contains = Then_I_see_document_title_contains;
|
|
3
12
|
const cucumber_1 = require("@cucumber/cucumber");
|
|
4
13
|
const test_1 = require("@playwright/test");
|
|
5
|
-
const optionsUtils_1 = require("../helpers/utils/optionsUtils");
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
14
|
+
const optionsUtils_1 = require("../helpers/utils/optionsUtils"); // Assuming this path is correct
|
|
15
|
+
// ===================================================================================
|
|
16
|
+
// ASSERTIONS: HEADINGS (H1-H6)
|
|
17
|
+
// ===================================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Asserts that a heading element (h1-h6) containing the given text is visible on the page.
|
|
20
|
+
*
|
|
21
|
+
* ```gherkin
|
|
22
|
+
* Then I see heading {string}
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param text - The text content expected within the heading.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* Then I see heading "Welcome to your account"
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* This step searches for any HTML heading tag (`<h1>` through `<h6>`) that contains the specified text.
|
|
32
|
+
* It uses Playwright's `expect().toBeVisible()` to confirm both existence and visibility, which
|
|
33
|
+
* includes automatic waiting.
|
|
34
|
+
* @category Heading Assertion Steps
|
|
35
|
+
*/
|
|
36
|
+
async function Then_I_see_heading(text) {
|
|
37
|
+
// Use `hasText` for partial or full text match
|
|
38
|
+
const headingLocator = this.page.locator("h1, h2, h3, h4, h5, h6", { hasText: text }).first();
|
|
39
|
+
await (0, test_1.expect)(headingLocator).toBeVisible({ timeout: 5000 });
|
|
40
|
+
this.log?.(`✅ Verified heading "${text}" is visible.`);
|
|
41
|
+
}
|
|
42
|
+
(0, cucumber_1.Then)("I see heading {string}", Then_I_see_heading);
|
|
43
|
+
/**
|
|
44
|
+
* Asserts that a heading element (h1-h6) containing the given text is NOT visible on the page.
|
|
45
|
+
*
|
|
46
|
+
* ```gherkin
|
|
47
|
+
* Then I do not see heading {string}
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param text - The text content expected NOT to be visible within a heading.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* Then I do not see heading "Hidden Section"
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* This step searches for any HTML heading tag (`<h1>` through `<h6>`) that contains the specified text.
|
|
57
|
+
* It uses Playwright's `expect().not.toBeVisible()` to confirm both absence and non-visibility,
|
|
58
|
+
* which includes automatic waiting.
|
|
59
|
+
* @category Heading Assertion Steps
|
|
60
|
+
*/
|
|
61
|
+
async function Then_I_do_not_see_heading(text) {
|
|
62
|
+
const headingLocator = this.page.locator("h1, h2, h3, h4, h5, h6", { hasText: text }).first();
|
|
63
|
+
await (0, test_1.expect)(headingLocator).not.toBeVisible({ timeout: 5000 });
|
|
64
|
+
this.log?.(`✅ Verified heading "${text}" is NOT visible.`);
|
|
65
|
+
}
|
|
66
|
+
(0, cucumber_1.Then)("I do not see heading {string}", Then_I_do_not_see_heading);
|
|
67
|
+
// ===================================================================================
|
|
68
|
+
// ASSERTIONS: LABELS
|
|
69
|
+
// ===================================================================================
|
|
70
|
+
/**
|
|
71
|
+
* Asserts that a `<label>` element with the given text is visible on the page.
|
|
72
|
+
*
|
|
73
|
+
* ```gherkin
|
|
74
|
+
* Then I see label {string}
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @param text - The text content of the label expected to be visible.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* Then I see label "Username"
|
|
81
|
+
* Then I see label "I agree to the terms and conditions"
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* This step uses Playwright's `page.getByLabel()` which is designed to find labels
|
|
85
|
+
* and implicitly connected form controls. It then uses `expect().toBeVisible()`
|
|
86
|
+
* to confirm visibility.
|
|
87
|
+
* @category Label Assertion Steps
|
|
88
|
+
*/
|
|
89
|
+
async function Then_I_see_label(text) {
|
|
90
|
+
const labelLocator = this.page.getByLabel(text);
|
|
91
|
+
await (0, test_1.expect)(labelLocator).toBeVisible({ timeout: 5000 });
|
|
92
|
+
this.log?.(`✅ Verified label "${text}" is visible.`);
|
|
93
|
+
}
|
|
94
|
+
(0, cucumber_1.Then)("I see label {string}", Then_I_see_label);
|
|
95
|
+
/**
|
|
96
|
+
* Asserts that a `<label>` element with the given text is NOT visible on the page.
|
|
97
|
+
*
|
|
98
|
+
* ```gherkin
|
|
99
|
+
* Then I do not see label {string}
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @param text - The text content of the label expected NOT to be visible.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* Then I do not see label "Old Feature Toggle"
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* This step uses Playwright's `page.getByLabel()` and then `expect().not.toBeVisible()`
|
|
109
|
+
* to confirm its non-visibility.
|
|
110
|
+
* @category Label Assertion Steps
|
|
111
|
+
*/
|
|
112
|
+
async function Then_I_do_not_see_label(text) {
|
|
113
|
+
const labelLocator = this.page.getByLabel(text);
|
|
114
|
+
await (0, test_1.expect)(labelLocator).not.toBeVisible({ timeout: 5000 });
|
|
115
|
+
this.log?.(`✅ Verified label "${text}" is NOT visible.`);
|
|
116
|
+
}
|
|
117
|
+
(0, cucumber_1.Then)("I do not see label {string}", Then_I_do_not_see_label);
|
|
118
|
+
// ===================================================================================
|
|
119
|
+
// ASSERTIONS: LINKS
|
|
120
|
+
// ===================================================================================
|
|
121
|
+
/**
|
|
122
|
+
* Asserts that a link (`<a>` tag) with the given accessible name (text content) is visible on the page.
|
|
123
|
+
*
|
|
124
|
+
* ```gherkin
|
|
125
|
+
* Then I see link {string}
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @param text - The accessible name (text) of the link expected to be visible.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* Then I see link "Home"
|
|
132
|
+
* Then I see link "View Details"
|
|
133
|
+
*
|
|
134
|
+
* @remarks
|
|
135
|
+
* This step uses Playwright's `page.getByRole("link", { name: text })` for robust
|
|
136
|
+
* link finding based on accessible name, then `expect().toBeVisible()` for visibility.
|
|
137
|
+
* @category Link Assertion Steps
|
|
138
|
+
*/
|
|
139
|
+
async function Then_I_see_link(text) {
|
|
140
|
+
const linkLocator = this.page.getByRole("link", { name: text });
|
|
141
|
+
await (0, test_1.expect)(linkLocator).toBeVisible({ timeout: 5000 });
|
|
142
|
+
this.log?.(`✅ Verified link "${text}" is visible.`);
|
|
143
|
+
}
|
|
144
|
+
(0, cucumber_1.Then)("I see link {string}", Then_I_see_link);
|
|
145
|
+
/**
|
|
146
|
+
* Asserts that a link (`<a>` tag) with the given accessible name (text content) is NOT visible on the page.
|
|
147
|
+
*
|
|
148
|
+
* ```gherkin
|
|
149
|
+
* Then I do not see link {string}
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* @param text - The accessible name (text) of the link expected NOT to be visible.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* Then I do not see link "Admin Panel"
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* This step uses Playwright's `page.getByRole("link", { name: text })` and then
|
|
159
|
+
* `expect().not.toBeVisible()` to confirm its non-visibility.
|
|
160
|
+
* @category Link Assertion Steps
|
|
161
|
+
*/
|
|
162
|
+
async function Then_I_do_not_see_link(text) {
|
|
163
|
+
const linkLocator = this.page.getByRole("link", { name: text });
|
|
164
|
+
await (0, test_1.expect)(linkLocator).not.toBeVisible({ timeout: 5000 });
|
|
165
|
+
this.log?.(`✅ Verified link "${text}" is NOT visible.`);
|
|
166
|
+
}
|
|
167
|
+
(0, cucumber_1.Then)("I do not see link {string}", Then_I_do_not_see_link);
|
|
168
|
+
// ===================================================================================
|
|
169
|
+
// ASSERTIONS: LOCATOR COUNT
|
|
170
|
+
// ===================================================================================
|
|
171
|
+
/**
|
|
172
|
+
* Asserts that the number of elements found by the {@link CustomWorld.currentLocator | currentLocator}
|
|
173
|
+
* matches the expected count. If no `currentLocator` is set, it defaults to counting all elements (`*`).
|
|
174
|
+
*
|
|
175
|
+
* ```gherkin
|
|
176
|
+
* Then I count {int} element
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @param expectedCount - The expected number of elements.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* When I find elements by selector ".product-item"
|
|
183
|
+
* Then I count 10 element
|
|
184
|
+
*
|
|
185
|
+
* @remarks
|
|
186
|
+
* This step is designed to follow a "find elements" step that sets `this.currentLocator`
|
|
187
|
+
* or `this.elements` (if `this.elements` is the intended source, you might prefer a
|
|
188
|
+
* step like `Then I count {int} elements` which specifically targets `this.elements`).
|
|
189
|
+
* The current implementation uses `this.currentLocator` or defaults to `this.page.locator("*")`.
|
|
190
|
+
* @category Count Assertion Steps
|
|
191
|
+
*/
|
|
192
|
+
async function Then_I_count_current_locator_elements(expectedCount) {
|
|
193
|
+
// If currentLocator is not set, default to finding all elements on the page.
|
|
194
|
+
// This might lead to unexpected behavior if not intended.
|
|
195
|
+
const locatorToCount = this.currentLocator ?? this.page.locator("*");
|
|
196
|
+
await (0, test_1.expect)(locatorToCount).toHaveCount(expectedCount, { timeout: 5000 });
|
|
197
|
+
this.log?.(`✅ Verified current locator has ${expectedCount} element(s).`);
|
|
198
|
+
}
|
|
199
|
+
(0, cucumber_1.Then)("I count {int} element", Then_I_count_current_locator_elements);
|
|
200
|
+
// ===================================================================================
|
|
201
|
+
// ASSERTIONS: DOCUMENT TITLE
|
|
202
|
+
// ===================================================================================
|
|
203
|
+
/**
|
|
204
|
+
* Asserts that the current document title exactly matches the expected string.
|
|
205
|
+
*
|
|
206
|
+
* ```gherkin
|
|
207
|
+
* Then I see document title {string}
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @param expectedTitle - The exact title string expected for the document.
|
|
211
|
+
* @param table - (Optional) A Cucumber DataTable for Playwright `ExpectOptions` (e.g., `timeout`).
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* Then I see document title "My Application Dashboard"
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* This step uses Playwright's `expect(page).toHaveTitle()` for robust assertion,
|
|
218
|
+
* including automatic waiting for the title to become correct.
|
|
219
|
+
* @category Page State Assertion Steps
|
|
220
|
+
*/
|
|
221
|
+
async function Then_I_see_document_title(expectedTitle, table) {
|
|
61
222
|
const options = (0, optionsUtils_1.parseExpectOptions)(table);
|
|
62
|
-
await (0, test_1.expect)(this.page).toHaveTitle(
|
|
63
|
-
});
|
|
64
|
-
|
|
223
|
+
await (0, test_1.expect)(this.page).toHaveTitle(expectedTitle, options);
|
|
224
|
+
this.log?.(`✅ Verified document title is "${expectedTitle}".`);
|
|
225
|
+
}
|
|
226
|
+
(0, cucumber_1.Then)("I see document title {string}", Then_I_see_document_title);
|
|
227
|
+
/**
|
|
228
|
+
* Asserts that the current document title contains the expected substring (case-insensitive).
|
|
229
|
+
*
|
|
230
|
+
* ```gherkin
|
|
231
|
+
* Then I see document title contains {string}
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* @param substring - The substring expected to be contained within the document title.
|
|
235
|
+
* @param table - (Optional) A Cucumber DataTable for Playwright `ExpectOptions`.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* Then I see document title contains "App Name"
|
|
239
|
+
* Then I see document title contains "Dashboard"
|
|
240
|
+
*
|
|
241
|
+
* @remarks
|
|
242
|
+
* This step uses Playwright's `expect(page).toHaveTitle()` with a case-insensitive regular
|
|
243
|
+
* expression for partial matching, ensuring automatic waiting.
|
|
244
|
+
* @category Page State Assertion Steps
|
|
245
|
+
*/
|
|
246
|
+
async function Then_I_see_document_title_contains(substring, table) {
|
|
65
247
|
const options = (0, optionsUtils_1.parseExpectOptions)(table);
|
|
248
|
+
// Use RegExp for case-insensitive partial match
|
|
66
249
|
await (0, test_1.expect)(this.page).toHaveTitle(new RegExp(substring, "i"), options);
|
|
67
|
-
});
|
|
250
|
+
this.log?.(`✅ Verified document title contains "${substring}".`);
|
|
251
|
+
}
|
|
252
|
+
(0, cucumber_1.Then)("I see document title contains {string}", Then_I_see_document_title_contains);
|
|
@@ -1 +1,149 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CustomWorld } from "../helpers/world";
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that a Local Storage item with the given key exists for the current page's origin.
|
|
4
|
+
*
|
|
5
|
+
* ```gherkin
|
|
6
|
+
* Then I see local storage item {string}
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @param key - The key of the Local Storage item expected to exist.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* Then I see local storage item "token"
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This step executes `localStorage.getItem(key)` in the browser's context.
|
|
16
|
+
* It asserts that the returned value is not `null`, indicating the item exists.
|
|
17
|
+
* @category Storage Assertion Steps
|
|
18
|
+
*/
|
|
19
|
+
export declare function Then_I_see_local_storage_item(this: CustomWorld, key: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Asserts that a Local Storage item with the given key does NOT exist for the current page's origin.
|
|
22
|
+
*
|
|
23
|
+
* ```gherkin
|
|
24
|
+
* Then I do not see local storage item {string}
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param key - The key of the Local Storage item expected NOT to exist.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* Then I do not see local storage item "oldFeatureFlag"
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* This step executes `localStorage.getItem(key)` in the browser's context.
|
|
34
|
+
* It asserts that the returned value is strictly `null`, indicating the item does not exist.
|
|
35
|
+
* @category Storage Assertion Steps
|
|
36
|
+
*/
|
|
37
|
+
export declare function Then_I_do_not_see_local_storage_item(this: CustomWorld, key: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Asserts that a Local Storage item with the given key exactly equals the expected value.
|
|
40
|
+
*
|
|
41
|
+
* ```gherkin
|
|
42
|
+
* Then I see local storage item {string} equals {string}
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param key - The key of the Local Storage item.
|
|
46
|
+
* @param expectedValue - The exact value the item is expected to have.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* Then I see local storage item "token" equals "abc123"
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* This step executes `localStorage.getItem(key)` in the browser's context.
|
|
53
|
+
* It asserts strict equality between the retrieved value and `expectedValue`.
|
|
54
|
+
* @category Storage Assertion Steps
|
|
55
|
+
*/
|
|
56
|
+
export declare function Then_I_see_local_storage_item_equals(this: CustomWorld, key: string, expectedValue: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Asserts that a Local Storage item with the given key contains the expected substring.
|
|
59
|
+
*
|
|
60
|
+
* ```gherkin
|
|
61
|
+
* Then I see local storage item {string} contains {string}
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param key - The key of the Local Storage item.
|
|
65
|
+
* @param part - The substring expected to be contained within the item's value.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* Then I see local storage item "userSession" contains "loggedIn"
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* This step executes `localStorage.getItem(key)` in the browser's context.
|
|
72
|
+
* It asserts that the retrieved value (if not null) includes the `part` substring.
|
|
73
|
+
* @category Storage Assertion Steps
|
|
74
|
+
*/
|
|
75
|
+
export declare function Then_I_see_local_storage_item_contains(this: CustomWorld, key: string, part: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Asserts that a Session Storage item with the given key exists for the current page's origin.
|
|
78
|
+
*
|
|
79
|
+
* ```gherkin
|
|
80
|
+
* Then I see session storage item {string}
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @param key - The key of the Session Storage item expected to exist.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* Then I see session storage item "sessionId"
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* This step executes `sessionStorage.getItem(key)` in the browser's context.
|
|
90
|
+
* It asserts that the returned value is not `null`, indicating the item exists.
|
|
91
|
+
* @category Storage Assertion Steps
|
|
92
|
+
*/
|
|
93
|
+
export declare function Then_I_see_session_storage_item(this: CustomWorld, key: string): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Asserts that a Session Storage item with the given key does NOT exist for the current page's origin.
|
|
96
|
+
*
|
|
97
|
+
* ```gherkin
|
|
98
|
+
* Then I do not see session storage item {string}
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @param key - The key of the Session Storage item expected NOT to exist.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* Then I do not see session storage item "tempData"
|
|
105
|
+
*
|
|
106
|
+
* @remarks
|
|
107
|
+
* This step executes `sessionStorage.getItem(key)` in the browser's context.
|
|
108
|
+
* It asserts that the returned value is strictly `null`, indicating the item does not exist.
|
|
109
|
+
* @category Storage Assertion Steps
|
|
110
|
+
*/
|
|
111
|
+
export declare function Then_I_do_not_see_session_storage_item(this: CustomWorld, key: string): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Asserts that a Session Storage item with the given key exactly equals the expected value.
|
|
114
|
+
*
|
|
115
|
+
* ```gherkin
|
|
116
|
+
* Then I see session storage item {string} equals {string}
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @param key - The key of the Session Storage item.
|
|
120
|
+
* @param expectedValue - The exact value the item is expected to have.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* Then I see session storage item "sessionId" equals "xyz789"
|
|
124
|
+
*
|
|
125
|
+
* @remarks
|
|
126
|
+
* This step executes `sessionStorage.getItem(key)` in the browser's context.
|
|
127
|
+
* It asserts strict equality between the retrieved value and `expectedValue`.
|
|
128
|
+
* @category Storage Assertion Steps
|
|
129
|
+
*/
|
|
130
|
+
export declare function Then_I_see_session_storage_item_equals(this: CustomWorld, key: string, expectedValue: string): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Asserts that a Session Storage item with the given key contains the expected substring.
|
|
133
|
+
*
|
|
134
|
+
* ```gherkin
|
|
135
|
+
* Then I see session storage item {string} contains {string}
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @param key - The key of the Session Storage item.
|
|
139
|
+
* @param part - The substring expected to be contained within the item's value.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* Then I see session storage item "userState" contains "authenticated"
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* This step executes `sessionStorage.getItem(key)` in the browser's context.
|
|
146
|
+
* It asserts that the retrieved value (if not null) includes the `part` substring.
|
|
147
|
+
* @category Storage Assertion Steps
|
|
148
|
+
*/
|
|
149
|
+
export declare function Then_I_see_session_storage_item_contains(this: CustomWorld, key: string, part: string): Promise<void>;
|