playwright-cucumber-ts-steps 1.3.2 → 1.3.4

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 (81) 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 +29 -29
  4. package/dist/backend/actions/form.d.ts +2 -2
  5. package/dist/backend/actions/form.js +2 -2
  6. package/dist/backend/actions/formTable.d.ts +1 -1
  7. package/dist/backend/actions/formTable.js +1 -1
  8. package/dist/backend/actions/frames.d.ts +3 -3
  9. package/dist/backend/actions/frames.js +3 -3
  10. package/dist/backend/actions/inputs.d.ts +14 -14
  11. package/dist/backend/actions/inputs.js +14 -14
  12. package/dist/backend/actions/interactions.d.ts +7 -7
  13. package/dist/backend/actions/interactions.js +7 -7
  14. package/dist/backend/actions/keyboard.d.ts +6 -6
  15. package/dist/backend/actions/keyboard.js +6 -6
  16. package/dist/backend/actions/misc.d.ts +15 -15
  17. package/dist/backend/actions/misc.js +15 -15
  18. package/dist/backend/actions/mobile.d.ts +7 -7
  19. package/dist/backend/actions/mobile.js +7 -7
  20. package/dist/backend/actions/mouse.d.ts +9 -9
  21. package/dist/backend/actions/mouse.js +9 -9
  22. package/dist/backend/actions/navigation.d.ts +5 -5
  23. package/dist/backend/actions/navigation.js +5 -5
  24. package/dist/backend/actions/visual.d.ts +6 -6
  25. package/dist/backend/actions/visual.js +6 -6
  26. package/dist/backend/actions/waits.d.ts +6 -6
  27. package/dist/backend/actions/waits.js +6 -6
  28. package/dist/backend/api/assertions.d.ts +64 -4
  29. package/dist/backend/api/assertions.d.ts.map +1 -1
  30. package/dist/backend/api/assertions.js +205 -5
  31. package/dist/backend/api/mock.d.ts +3 -3
  32. package/dist/backend/api/mock.js +3 -3
  33. package/dist/backend/api/network.d.ts +6 -6
  34. package/dist/backend/api/network.js +6 -6
  35. package/dist/backend/api/requests.d.ts +4 -4
  36. package/dist/backend/api/requests.js +4 -4
  37. package/dist/backend/assertions/document.d.ts +10 -10
  38. package/dist/backend/assertions/document.js +10 -10
  39. package/dist/backend/assertions/elements.d.ts +28 -28
  40. package/dist/backend/assertions/elements.js +28 -28
  41. package/dist/backend/assertions/expectVisible.d.ts +1 -1
  42. package/dist/backend/assertions/expectVisible.js +1 -1
  43. package/dist/backend/assertions/forms.d.ts +7 -7
  44. package/dist/backend/assertions/forms.js +7 -7
  45. package/dist/backend/assertions/pageState.d.ts +4 -4
  46. package/dist/backend/assertions/pageState.js +4 -4
  47. package/dist/backend/assertions/storage.d.ts +11 -11
  48. package/dist/backend/assertions/storage.js +11 -11
  49. package/dist/backend/assertions/text.d.ts +17 -17
  50. package/dist/backend/assertions/text.js +17 -17
  51. package/dist/backend/assertions/visibility.d.ts +15 -15
  52. package/dist/backend/assertions/visibility.js +15 -15
  53. package/dist/backend/auth/index.d.ts +2 -2
  54. package/dist/backend/auth/index.js +2 -2
  55. package/dist/backend/db/steps.d.ts +9 -9
  56. package/dist/backend/db/steps.js +9 -9
  57. package/dist/backend/elements/alerts.d.ts +3 -3
  58. package/dist/backend/elements/alerts.js +3 -3
  59. package/dist/backend/elements/find.d.ts +15 -15
  60. package/dist/backend/elements/find.js +15 -15
  61. package/dist/backend/elements/forms.d.ts +4 -4
  62. package/dist/backend/elements/forms.js +4 -4
  63. package/dist/backend/elements/frames.d.ts +3 -3
  64. package/dist/backend/elements/frames.js +3 -3
  65. package/dist/backend/utils/faker.d.ts +2 -0
  66. package/dist/backend/utils/faker.d.ts.map +1 -0
  67. package/dist/backend/utils/faker.js +510 -0
  68. package/dist/backend/utils/fixtures.d.ts +44 -2
  69. package/dist/backend/utils/fixtures.d.ts.map +1 -1
  70. package/dist/backend/utils/fixtures.js +321 -5
  71. package/dist/backend/utils/resolver.d.ts +13 -0
  72. package/dist/backend/utils/resolver.d.ts.map +1 -1
  73. package/dist/backend/utils/resolver.js +55 -0
  74. package/dist/core/runner.d.ts +1 -0
  75. package/dist/core/runner.d.ts.map +1 -1
  76. package/dist/core/runner.js +1 -0
  77. package/dist/index.d.ts +1 -0
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +4 -1
  80. package/dist/metadata.json +49 -1
  81. package/package.json +4 -2
@@ -1,31 +1,57 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.expectResponseStatus = expectResponseStatus;
4
+ exports.expectResponseStatusSuccess = expectResponseStatusSuccess;
4
5
  exports.expectResponseBodyContain = expectResponseBodyContain;
6
+ exports.expectResponseBodyNotContain = expectResponseBodyNotContain;
7
+ exports.expectResponseBodyEqual = expectResponseBodyEqual;
5
8
  exports.expectResponseProperty = expectResponseProperty;
9
+ exports.storeResponseProperty = storeResponseProperty;
10
+ exports.expectResponsePropertyExists = expectResponsePropertyExists;
11
+ exports.expectResponsePropertyNotExists = expectResponsePropertyNotExists;
12
+ exports.expectResponsePropertyBeNull = expectResponsePropertyBeNull;
13
+ exports.expectResponsePropertyNotNull = expectResponsePropertyNotNull;
14
+ exports.expectResponsePropertyContains = expectResponsePropertyContains;
15
+ exports.expectResponseArrayLength = expectResponseArrayLength;
16
+ exports.expectResponseArrayNotEmpty = expectResponseArrayNotEmpty;
17
+ exports.fillWithStoredValue = fillWithStoredValue;
6
18
  //src/backend/api/assertions.ts
7
19
  const test_1 = require("@playwright/test");
8
20
  const registry_1 = require("../../core/registry");
9
21
  const state_1 = require("../utils/state");
10
22
  const fixtures_1 = require("../utils/fixtures");
23
+ const state_2 = require("../utils/state");
11
24
  // ==================================================
12
25
  // CORE FUNCTIONS
13
26
  // ==================================================
14
27
  /**
15
28
  * Asserts that the HTTP status code of the last API response matches the expected integer.
16
- * @example Then I expect the response status to be 200
29
+ * @example Then I pw expect the response status to be 200
17
30
  */
18
31
  async function expectResponseStatus(page, statusCode) {
19
32
  const response = state_1.apiState.getResponse();
20
33
  if (!response)
21
34
  throw new Error("❌ No API response found. Did you forget to make a request?");
22
- (0, test_1.expect)(response.status()).toBe(statusCode);
35
+ (0, test_1.expect)(String(response.status())).toBe(String(statusCode));
23
36
  console.log(`✅ Response status is ${statusCode}`);
24
37
  }
38
+ /**
39
+ * Asserts that the HTTP status code of the last API response is successful (2xx).
40
+ * @example Then I pw expect the response status to be successful
41
+ */
42
+ async function expectResponseStatusSuccess(_page) {
43
+ const response = state_1.apiState.getResponse();
44
+ if (!response)
45
+ throw new Error("❌ No API response found. Did you forget to make a request?");
46
+ const status = response.status();
47
+ (0, test_1.expect)(status).toBeGreaterThanOrEqual(200);
48
+ (0, test_1.expect)(status).toBeLessThan(300);
49
+ console.log(`✅ Response status ${status} is successful`);
50
+ }
25
51
  /**
26
52
  * Asserts that the body text of the last API response contains a specific substring.
27
53
  * Supports fixtures for reusable substrings.
28
- * @example Then I expect the response body to contain "success"
54
+ * @example Then I pw expect the response body to contain "success"
29
55
  */
30
56
  async function expectResponseBodyContain(page, textKey) {
31
57
  const response = state_1.apiState.getResponse();
@@ -37,10 +63,38 @@ async function expectResponseBodyContain(page, textKey) {
37
63
  (0, test_1.expect)(body).toContain(text);
38
64
  console.log(`✅ Response body contains "${text}"`);
39
65
  }
66
+ /**
67
+ * Asserts that the body text of the last API response does NOT contain a specific substring.
68
+ * @example Then I pw expect the response body to not contain "error"
69
+ */
70
+ async function expectResponseBodyNotContain(page, textKey) {
71
+ const response = state_1.apiState.getResponse();
72
+ if (!response)
73
+ throw new Error("❌ No API response found. Did you forget to make a request?");
74
+ const texts = (0, fixtures_1.loadFixture)("responses.json");
75
+ const text = (0, fixtures_1.getFixtureValue)(texts, textKey);
76
+ const body = await response.text();
77
+ (0, test_1.expect)(body).not.toContain(text);
78
+ console.log(`✅ Response body does not contain "${text}"`);
79
+ }
80
+ /**
81
+ * Asserts that the body text of the last API response equals a specific string.
82
+ * @example Then I pw expect the response body to equal "OK"
83
+ */
84
+ async function expectResponseBodyEqual(page, textKey) {
85
+ const response = state_1.apiState.getResponse();
86
+ if (!response)
87
+ throw new Error("❌ No API response found. Did you forget to make a request?");
88
+ const texts = (0, fixtures_1.loadFixture)("responses.json");
89
+ const text = (0, fixtures_1.getFixtureValue)(texts, textKey);
90
+ const body = await response.text();
91
+ (0, test_1.expect)(body).toBe(text);
92
+ console.log(`✅ Response body equals "${text}"`);
93
+ }
40
94
  /**
41
95
  * Asserts that a specific property in the JSON response matches a string value.
42
96
  * Supports dot notation for nested properties and fixtures for reusable keys/values.
43
- * @example Then I expect the response property "user.id" to be "12345"
97
+ * @example Then I pw expect the response property "user.id" to be "12345"
44
98
  */
45
99
  async function expectResponseProperty(page, jsonPathKey, valueKey) {
46
100
  const response = state_1.apiState.getResponse();
@@ -55,9 +109,155 @@ async function expectResponseProperty(page, jsonPathKey, valueKey) {
55
109
  (0, test_1.expect)(String(actualValue)).toBe(expectedValue);
56
110
  console.log(`✅ Response property "${jsonPath}" is "${expectedValue}"`);
57
111
  }
112
+ /**
113
+ * Stores a response property value in the variable store for later use.
114
+ * @example When I pw store response property "user.id" value as "userId"
115
+ */
116
+ async function storeResponseProperty(page, jsonPathKey, alias) {
117
+ const response = state_1.apiState.getResponse();
118
+ if (!response)
119
+ throw new Error("❌ No API response found. Did you forget to make a request?");
120
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
121
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
122
+ const json = await response.json();
123
+ const value = jsonPath.split(".").reduce((o, i) => o[i], json);
124
+ (0, state_2.setVariable)(page, alias, value);
125
+ console.log(`💾 Stored response property "${jsonPath}" = "${value}" as @${alias}`);
126
+ }
127
+ /**
128
+ * Asserts that a response property exists in the JSON response.
129
+ * @example Then I pw expect response property "user.email" to exist
130
+ */
131
+ async function expectResponsePropertyExists(page, jsonPathKey) {
132
+ const response = state_1.apiState.getResponse();
133
+ if (!response)
134
+ throw new Error("❌ No API response found. Did you forget to make a request?");
135
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
136
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
137
+ const json = await response.json();
138
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
139
+ (0, test_1.expect)(value).toBeDefined();
140
+ console.log(`✅ Response property "${jsonPath}" exists`);
141
+ }
142
+ /**
143
+ * Asserts that a response property does NOT exist in the JSON response.
144
+ * @example Then I pw expect response property "user.deletedAt" to not exist
145
+ */
146
+ async function expectResponsePropertyNotExists(page, jsonPathKey) {
147
+ const response = state_1.apiState.getResponse();
148
+ if (!response)
149
+ throw new Error("❌ No API response found. Did you forget to make a request?");
150
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
151
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
152
+ const json = await response.json();
153
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
154
+ (0, test_1.expect)(value).toBeUndefined();
155
+ console.log(`✅ Response property "${jsonPath}" does not exist`);
156
+ }
157
+ /**
158
+ * Asserts that a response property is null.
159
+ * @example Then I pw expect response property "user.deletedAt" to be null
160
+ */
161
+ async function expectResponsePropertyBeNull(page, jsonPathKey) {
162
+ const response = state_1.apiState.getResponse();
163
+ if (!response)
164
+ throw new Error("❌ No API response found. Did you forget to make a request?");
165
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
166
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
167
+ const json = await response.json();
168
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
169
+ (0, test_1.expect)(value).toBeNull();
170
+ console.log(`✅ Response property "${jsonPath}" is null`);
171
+ }
172
+ /**
173
+ * Asserts that a response property is not null.
174
+ * @example Then I pw expect response property "user.id" to not be null
175
+ */
176
+ async function expectResponsePropertyNotNull(page, jsonPathKey) {
177
+ const response = state_1.apiState.getResponse();
178
+ if (!response)
179
+ throw new Error("❌ No API response found. Did you forget to make a request?");
180
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
181
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
182
+ const json = await response.json();
183
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
184
+ (0, test_1.expect)(value).not.toBeNull();
185
+ console.log(`✅ Response property "${jsonPath}" is not null`);
186
+ }
187
+ /**
188
+ * Asserts that a response property contains a substring.
189
+ * @example Then I pw expect response property "user.email" to contain "@example.com"
190
+ */
191
+ async function expectResponsePropertyContains(page, jsonPathKey, substring) {
192
+ const response = state_1.apiState.getResponse();
193
+ if (!response)
194
+ throw new Error("❌ No API response found. Did you forget to make a request?");
195
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
196
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
197
+ const json = await response.json();
198
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
199
+ (0, test_1.expect)(String(value)).toContain(substring);
200
+ console.log(`✅ Response property "${jsonPath}" contains "${substring}"`);
201
+ }
202
+ /**
203
+ * Asserts that a response array property has a specific length.
204
+ * @example Then I pw expect response property "users" array length to be 10
205
+ */
206
+ async function expectResponseArrayLength(page, jsonPathKey, expectedLength) {
207
+ const response = state_1.apiState.getResponse();
208
+ if (!response)
209
+ throw new Error("❌ No API response found. Did you forget to make a request?");
210
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
211
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
212
+ const json = await response.json();
213
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
214
+ (0, test_1.expect)(Array.isArray(value)).toBe(true);
215
+ (0, test_1.expect)(value.length).toBe(expectedLength);
216
+ console.log(`✅ Response property "${jsonPath}" array length is ${expectedLength}`);
217
+ }
218
+ /**
219
+ * Asserts that a response array property is not empty.
220
+ * @example Then I pw expect response property "users" array to not be empty
221
+ */
222
+ async function expectResponseArrayNotEmpty(page, jsonPathKey) {
223
+ const response = state_1.apiState.getResponse();
224
+ if (!response)
225
+ throw new Error("❌ No API response found. Did you forget to make a request?");
226
+ const paths = (0, fixtures_1.loadFixture)("paths.json");
227
+ const jsonPath = (0, fixtures_1.getFixtureValue)(paths, jsonPathKey);
228
+ const json = await response.json();
229
+ const value = jsonPath.split(".").reduce((o, i) => o && i in o ? o[i] : undefined, json);
230
+ (0, test_1.expect)(Array.isArray(value)).toBe(true);
231
+ (0, test_1.expect)(value.length).toBeGreaterThan(0);
232
+ console.log(`✅ Response property "${jsonPath}" array is not empty`);
233
+ }
234
+ /**
235
+ * Fills an input field with a previously stored value.
236
+ * @example When I pw fill "#userId" with stored value "userId"
237
+ */
238
+ async function fillWithStoredValue(page, selector, alias) {
239
+ const value = (0, state_2.getVariable)(page, alias);
240
+ if (value === undefined) {
241
+ throw new Error(`❌ No stored value found for alias "@${alias}"`);
242
+ }
243
+ await page.fill(selector, String(value));
244
+ console.log(`✍️ Filled "${selector}" with stored value @${alias} = "${value}"`);
245
+ }
58
246
  // ==================================================
59
247
  // GLUE STEPS
60
248
  // ==================================================
61
- (0, registry_1.Step)("I pw expect the response status to be {int}", expectResponseStatus, "Then");
249
+ (0, registry_1.Step)("I pw expect the response status to be {string}", expectResponseStatus, "Then");
250
+ (0, registry_1.Step)("I pw expect the response status to be successful", expectResponseStatusSuccess, "Then");
62
251
  (0, registry_1.Step)("I pw expect the response body to contain {string}", expectResponseBodyContain, "Then");
252
+ (0, registry_1.Step)("I pw expect the response body to not contain {string}", expectResponseBodyNotContain, "Then");
253
+ (0, registry_1.Step)("I pw expect the response body to equal {string}", expectResponseBodyEqual, "Then");
63
254
  (0, registry_1.Step)("I pw expect the response property {string} to be {string}", expectResponseProperty, "Then");
255
+ (0, registry_1.Step)("I pw store response property {string} value as {string}", storeResponseProperty, "When");
256
+ (0, registry_1.Step)("I pw expect response property {string} to exist", expectResponsePropertyExists, "Then");
257
+ (0, registry_1.Step)("I pw expect response property {string} to not exist", expectResponsePropertyNotExists, "Then");
258
+ (0, registry_1.Step)("I pw expect response property {string} to be null", expectResponsePropertyBeNull, "Then");
259
+ (0, registry_1.Step)("I pw expect response property {string} to not be null", expectResponsePropertyNotNull, "Then");
260
+ (0, registry_1.Step)("I pw expect response property {string} to contain {string}", expectResponsePropertyContains, "Then");
261
+ (0, registry_1.Step)("I pw expect response property {string} array length to be {int}", expectResponseArrayLength, "Then");
262
+ (0, registry_1.Step)("I pw expect response property {string} array to not be empty", expectResponseArrayNotEmpty, "Then");
263
+ (0, registry_1.Step)("I pw fill {string} with stored value {string}", fillWithStoredValue, "When");
@@ -1,20 +1,20 @@
1
1
  /**
2
2
  * Mocks a specific API endpoint with a hardcoded inline JSON response body.
3
3
  * Supports fixtures for reusable API endpoints.
4
- * @example Given I mock the API endpoint "/api/users" with body '{"id": 1, "name": "Fake"}'
4
+ * @example Given I pw mock the API endpoint "/api/users" with body '{"id": 1, "name": "Fake"}'
5
5
  */
6
6
  export declare function mockApiWithInlineJson(page: any, urlPatternKey: string, jsonBody: string): Promise<void>;
7
7
  /**
8
8
  * Mocks an API endpoint using the contents of a local JSON file.
9
9
  * Supports fixtures for reusable API endpoints and mock files.
10
- * @example Given I mock the API endpoint "/api/users" with response from "mocks/users.json"
10
+ * @example Given I pw mock the API endpoint "/api/users" with response from "mocks/users.json"
11
11
  */
12
12
  export declare function mockApiWithFile(page: any, urlPatternKey: string, filePathKey: string): Promise<void>;
13
13
  /**
14
14
  * Mocks an API endpoint to return a specific HTTP status code only.
15
15
  * Useful for simulating server errors like 500 or 404.
16
16
  * Supports fixtures for reusable API endpoints.
17
- * @example Given I mock the API endpoint "/api/broken" with status 500
17
+ * @example Given I pw mock the API endpoint "/api/broken" with status 500
18
18
  */
19
19
  export declare function mockApiStatus(page: any, urlPatternKey: string, statusCode: number): Promise<void>;
20
20
  //# sourceMappingURL=mock.d.ts.map
@@ -46,7 +46,7 @@ const fixtures_1 = require("./../utils/fixtures");
46
46
  /**
47
47
  * Mocks a specific API endpoint with a hardcoded inline JSON response body.
48
48
  * Supports fixtures for reusable API endpoints.
49
- * @example Given I mock the API endpoint "/api/users" with body '{"id": 1, "name": "Fake"}'
49
+ * @example Given I pw mock the API endpoint "/api/users" with body '{"id": 1, "name": "Fake"}'
50
50
  */
51
51
  async function mockApiWithInlineJson(page, urlPatternKey, jsonBody) {
52
52
  const endpoints = (0, fixtures_1.loadFixture)("endpoints.json");
@@ -64,7 +64,7 @@ async function mockApiWithInlineJson(page, urlPatternKey, jsonBody) {
64
64
  /**
65
65
  * Mocks an API endpoint using the contents of a local JSON file.
66
66
  * Supports fixtures for reusable API endpoints and mock files.
67
- * @example Given I mock the API endpoint "/api/users" with response from "mocks/users.json"
67
+ * @example Given I pw mock the API endpoint "/api/users" with response from "mocks/users.json"
68
68
  */
69
69
  async function mockApiWithFile(page, urlPatternKey, filePathKey) {
70
70
  const endpoints = (0, fixtures_1.loadFixture)("endpoints.json");
@@ -89,7 +89,7 @@ async function mockApiWithFile(page, urlPatternKey, filePathKey) {
89
89
  * Mocks an API endpoint to return a specific HTTP status code only.
90
90
  * Useful for simulating server errors like 500 or 404.
91
91
  * Supports fixtures for reusable API endpoints.
92
- * @example Given I mock the API endpoint "/api/broken" with status 500
92
+ * @example Given I pw mock the API endpoint "/api/broken" with status 500
93
93
  */
94
94
  async function mockApiStatus(page, urlPatternKey, statusCode) {
95
95
  const endpoints = (0, fixtures_1.loadFixture)("endpoints.json");
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Intercepts a network URL and returns a stubbed JSON response.
3
3
  * Supports Gherkin DocStrings for the body content.
4
- * @example When I intercept URL "/api/user" and stub body:
4
+ * @example When I pw intercept URL "/api/user" and stub body:
5
5
  * """
6
6
  * { "id": 101, "status": "active" }
7
7
  * """
@@ -9,24 +9,24 @@
9
9
  export declare function interceptStubJson(page: any, url: string, body: any): Promise<void>;
10
10
  /**
11
11
  * Intercepts a URL and stubs it with a raw string (non-JSON).
12
- * @example When I intercept URL "/health" and stub body "OK"
12
+ * @example When I pw intercept URL "/health" and stub body "OK"
13
13
  */
14
14
  export declare function interceptStubRaw(page: any, url: string, body: string): Promise<void>;
15
15
  /**
16
16
  * Intercepts a URL but allows it to continue (Network Spying).
17
17
  * Useful for monitoring traffic without changing the response.
18
- * @example When I intercept URL "/api/*"
18
+ * @example When I pw intercept URL "/api/*"
19
19
  */
20
20
  export declare function interceptSpy(page: any, url: string): Promise<void>;
21
21
  /**
22
22
  * Makes a GET request and stores the response in the test state.
23
23
  * Stores values in `lastResponse` and `lastStatusCode`.
24
- * @example When I make request to "https://api.example.com/v1/users"
24
+ * @example When I pw make request to "https://api.example.com/v1/users"
25
25
  */
26
26
  export declare function apiGetRequest(page: any, url: string): Promise<void>;
27
27
  /**
28
28
  * Makes a POST request with a JSON body provided via DocString.
29
- * @example When I make a POST request to "/api/login" with JSON body:
29
+ * @example When I pw make a POST request to "/api/login" with JSON body:
30
30
  * """
31
31
  * { "username": "admin", "password": "password123" }
32
32
  * """
@@ -35,7 +35,7 @@ export declare function apiPostRequest(page: any, url: string, docString: any):
35
35
  /**
36
36
  * Makes a generic HTTP request using the browser's `fetch` API.
37
37
  * Supports a data table for headers and an optional body.
38
- * @example When I make a "PUT" request to "/api/settings"
38
+ * @example When I pw make a "PUT" request to "/api/settings"
39
39
  * | Authorization | Bearer my-token |
40
40
  * | body | {"theme": "dark"} |
41
41
  */
@@ -36,7 +36,7 @@ function safeJsonParse(input, context) {
36
36
  /**
37
37
  * Intercepts a network URL and returns a stubbed JSON response.
38
38
  * Supports Gherkin DocStrings for the body content.
39
- * @example When I intercept URL "/api/user" and stub body:
39
+ * @example When I pw intercept URL "/api/user" and stub body:
40
40
  * """
41
41
  * { "id": 101, "status": "active" }
42
42
  * """
@@ -54,7 +54,7 @@ async function interceptStubJson(page, url, body) {
54
54
  }
55
55
  /**
56
56
  * Intercepts a URL and stubs it with a raw string (non-JSON).
57
- * @example When I intercept URL "/health" and stub body "OK"
57
+ * @example When I pw intercept URL "/health" and stub body "OK"
58
58
  */
59
59
  async function interceptStubRaw(page, url, body) {
60
60
  await page.route(url, (route) => {
@@ -69,7 +69,7 @@ async function interceptStubRaw(page, url, body) {
69
69
  /**
70
70
  * Intercepts a URL but allows it to continue (Network Spying).
71
71
  * Useful for monitoring traffic without changing the response.
72
- * @example When I intercept URL "/api/*"
72
+ * @example When I pw intercept URL "/api/*"
73
73
  */
74
74
  async function interceptSpy(page, url) {
75
75
  await page.route(url, async (route) => {
@@ -80,7 +80,7 @@ async function interceptSpy(page, url) {
80
80
  /**
81
81
  * Makes a GET request and stores the response in the test state.
82
82
  * Stores values in `lastResponse` and `lastStatusCode`.
83
- * @example When I make request to "https://api.example.com/v1/users"
83
+ * @example When I pw make request to "https://api.example.com/v1/users"
84
84
  */
85
85
  async function apiGetRequest(page, url) {
86
86
  console.log(`⚡ GET request to: ${url}`);
@@ -98,7 +98,7 @@ async function apiGetRequest(page, url) {
98
98
  }
99
99
  /**
100
100
  * Makes a POST request with a JSON body provided via DocString.
101
- * @example When I make a POST request to "/api/login" with JSON body:
101
+ * @example When I pw make a POST request to "/api/login" with JSON body:
102
102
  * """
103
103
  * { "username": "admin", "password": "password123" }
104
104
  * """
@@ -121,7 +121,7 @@ async function apiPostRequest(page, url, docString) {
121
121
  /**
122
122
  * Makes a generic HTTP request using the browser's `fetch` API.
123
123
  * Supports a data table for headers and an optional body.
124
- * @example When I make a "PUT" request to "/api/settings"
124
+ * @example When I pw make a "PUT" request to "/api/settings"
125
125
  * | Authorization | Bearer my-token |
126
126
  * | body | {"theme": "dark"} |
127
127
  */
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Performs a standard HTTP GET request and stores the response in the global API state.
3
3
  * Supports fixtures for reusable API endpoints.
4
- * @example When I make a GET request to "users.list"
4
+ * @example When I pw make a GET request to "users.list"
5
5
  */
6
6
  export declare function makeGetRequest(page: any, urlKey: string): Promise<void>;
7
7
  /**
8
8
  * Performs a standard HTTP DELETE request and stores the response in the global API state.
9
9
  * Supports fixtures for reusable API endpoints.
10
- * @example When I make a DELETE request to "users.delete"
10
+ * @example When I pw make a DELETE request to "users.delete"
11
11
  */
12
12
  export declare function makeDeleteRequest(page: any, urlKey: string): Promise<void>;
13
13
  /**
14
14
  * Performs an HTTP POST request using a Gherkin Data Table as the JSON payload.
15
- * @example When I make a POST request to "users.create" with data
15
+ * @example When I pw make a POST request to "users.create" with data
16
16
  * | name | John |
17
17
  * | job | Dev |
18
18
  */
@@ -20,7 +20,7 @@ export declare function makePostRequestWithTable(page: any, urlKey: string, tabl
20
20
  /**
21
21
  * Performs an HTTP POST request using the contents of a local JSON file as the payload.
22
22
  * Supports fixtures for reusable API endpoints and payloads.
23
- * @example When I make a POST request to "users.create" with payload from "user.newUser"
23
+ * @example When I pw make a POST request to "users.create" with payload from "user.newUser"
24
24
  */
25
25
  export declare function makePostRequestWithFile(page: any, urlKey: string, filePathKey: string): Promise<void>;
26
26
  //# sourceMappingURL=requests.d.ts.map
@@ -49,7 +49,7 @@ const fixtures_1 = require("../utils/fixtures");
49
49
  /**
50
50
  * Performs a standard HTTP GET request and stores the response in the global API state.
51
51
  * Supports fixtures for reusable API endpoints.
52
- * @example When I make a GET request to "users.list"
52
+ * @example When I pw make a GET request to "users.list"
53
53
  */
54
54
  async function makeGetRequest(page, urlKey) {
55
55
  const endpoints = (0, fixtures_1.loadFixture)("endpoints.json");
@@ -61,7 +61,7 @@ async function makeGetRequest(page, urlKey) {
61
61
  /**
62
62
  * Performs a standard HTTP DELETE request and stores the response in the global API state.
63
63
  * Supports fixtures for reusable API endpoints.
64
- * @example When I make a DELETE request to "users.delete"
64
+ * @example When I pw make a DELETE request to "users.delete"
65
65
  */
66
66
  async function makeDeleteRequest(page, urlKey) {
67
67
  const endpoints = (0, fixtures_1.loadFixture)("endpoints.json");
@@ -72,7 +72,7 @@ async function makeDeleteRequest(page, urlKey) {
72
72
  }
73
73
  /**
74
74
  * Performs an HTTP POST request using a Gherkin Data Table as the JSON payload.
75
- * @example When I make a POST request to "users.create" with data
75
+ * @example When I pw make a POST request to "users.create" with data
76
76
  * | name | John |
77
77
  * | job | Dev |
78
78
  */
@@ -95,7 +95,7 @@ async function makePostRequestWithTable(page, urlKey, tableData) {
95
95
  /**
96
96
  * Performs an HTTP POST request using the contents of a local JSON file as the payload.
97
97
  * Supports fixtures for reusable API endpoints and payloads.
98
- * @example When I make a POST request to "users.create" with payload from "user.newUser"
98
+ * @example When I pw make a POST request to "users.create" with payload from "user.newUser"
99
99
  */
100
100
  async function makePostRequestWithFile(page, urlKey, filePathKey) {
101
101
  const endpoints = (0, fixtures_1.loadFixture)("endpoints.json");
@@ -1,61 +1,61 @@
1
1
  /**
2
2
  * Asserts that the document title equals the expected value.
3
3
  * Supports fixtures for reusable title values.
4
- * @example Then I see document title "My Website - Home"
4
+ * @example Then I pw see document title "My Website - Home"
5
5
  */
6
6
  export declare function expectDocumentTitle(page: any, titleKey: string): Promise<void>;
7
7
  /**
8
8
  * Asserts that the document title contains the expected substring.
9
9
  * Supports fixtures for reusable title values.
10
- * @example Then I see document title contains "Website"
10
+ * @example Then I pw see document title contains "Website"
11
11
  */
12
12
  export declare function expectDocumentTitleContains(page: any, titleKey: string): Promise<void>;
13
13
  /**
14
14
  * Asserts that the current URL equals the expected value.
15
15
  * Supports fixtures for reusable URL values.
16
- * @example Then I see URL "https://example.com/dashboard"
16
+ * @example Then I pw see URL "https://example.com/dashboard"
17
17
  */
18
18
  export declare function expectUrl(page: any, urlKey: string): Promise<void>;
19
19
  /**
20
20
  * Asserts that the current URL contains the expected substring.
21
21
  * Supports fixtures for reusable URL values.
22
- * @example Then I see URL contains "dashboard"
22
+ * @example Then I pw see URL contains "dashboard"
23
23
  */
24
24
  export declare function expectUrlContains(page: any, urlPartKey: string): Promise<void>;
25
25
  /**
26
26
  * Asserts that the current pathname equals the expected value.
27
27
  * Supports fixtures for reusable pathname values.
28
- * @example Then I see pathname "/dashboard"
28
+ * @example Then I pw see pathname "/dashboard"
29
29
  */
30
30
  export declare function expectPathname(page: any, pathnameKey: string): Promise<void>;
31
31
  /**
32
32
  * Asserts that the current pathname contains the expected substring.
33
33
  * Supports fixtures for reusable pathname values.
34
- * @example Then I see pathname contains "dashboard"
34
+ * @example Then I pw see pathname contains "dashboard"
35
35
  */
36
36
  export declare function expectPathnameContains(page: any, pathnamePartKey: string): Promise<void>;
37
37
  /**
38
38
  * Asserts that the current hash equals the expected value.
39
39
  * Supports fixtures for reusable hash values.
40
- * @example Then I see hash "#section1"
40
+ * @example Then I pw see hash "#section1"
41
41
  */
42
42
  export declare function expectHash(page: any, hashKey: string): Promise<void>;
43
43
  /**
44
44
  * Asserts that the current hash contains the expected substring.
45
45
  * Supports fixtures for reusable hash values.
46
- * @example Then I see hash contains "section"
46
+ * @example Then I pw see hash contains "section"
47
47
  */
48
48
  export declare function expectHashContains(page: any, hashPartKey: string): Promise<void>;
49
49
  /**
50
50
  * Asserts that the current search parameters contain the expected substring.
51
51
  * Supports fixtures for reusable search values.
52
- * @example Then I see search contains "query=test"
52
+ * @example Then I pw see search contains "query=test"
53
53
  */
54
54
  export declare function expectSearchContains(page: any, searchPartKey: string): Promise<void>;
55
55
  /**
56
56
  * Asserts that the current location equals the expected value.
57
57
  * Supports fixtures for reusable location values.
58
- * @example Then I see location "https://example.com/dashboard#top"
58
+ * @example Then I pw see location "https://example.com/dashboard#top"
59
59
  */
60
60
  export declare function expectLocation(page: any, locationKey: string): Promise<void>;
61
61
  //# sourceMappingURL=document.d.ts.map
@@ -20,7 +20,7 @@ const fixtures_1 = require("../utils/fixtures");
20
20
  /**
21
21
  * Asserts that the document title equals the expected value.
22
22
  * Supports fixtures for reusable title values.
23
- * @example Then I see document title "My Website - Home"
23
+ * @example Then I pw see document title "My Website - Home"
24
24
  */
25
25
  async function expectDocumentTitle(page, titleKey) {
26
26
  const titles = (0, fixtures_1.loadFixture)("titles.json");
@@ -31,7 +31,7 @@ async function expectDocumentTitle(page, titleKey) {
31
31
  /**
32
32
  * Asserts that the document title contains the expected substring.
33
33
  * Supports fixtures for reusable title values.
34
- * @example Then I see document title contains "Website"
34
+ * @example Then I pw see document title contains "Website"
35
35
  */
36
36
  async function expectDocumentTitleContains(page, titleKey) {
37
37
  const titles = (0, fixtures_1.loadFixture)("titles.json");
@@ -45,7 +45,7 @@ async function expectDocumentTitleContains(page, titleKey) {
45
45
  /**
46
46
  * Asserts that the current URL equals the expected value.
47
47
  * Supports fixtures for reusable URL values.
48
- * @example Then I see URL "https://example.com/dashboard"
48
+ * @example Then I pw see URL "https://example.com/dashboard"
49
49
  */
50
50
  async function expectUrl(page, urlKey) {
51
51
  const urls = (0, fixtures_1.loadFixture)("urls.json");
@@ -56,7 +56,7 @@ async function expectUrl(page, urlKey) {
56
56
  /**
57
57
  * Asserts that the current URL contains the expected substring.
58
58
  * Supports fixtures for reusable URL values.
59
- * @example Then I see URL contains "dashboard"
59
+ * @example Then I pw see URL contains "dashboard"
60
60
  */
61
61
  async function expectUrlContains(page, urlPartKey) {
62
62
  const urls = (0, fixtures_1.loadFixture)("urls.json");
@@ -70,7 +70,7 @@ async function expectUrlContains(page, urlPartKey) {
70
70
  /**
71
71
  * Asserts that the current pathname equals the expected value.
72
72
  * Supports fixtures for reusable pathname values.
73
- * @example Then I see pathname "/dashboard"
73
+ * @example Then I pw see pathname "/dashboard"
74
74
  */
75
75
  async function expectPathname(page, pathnameKey) {
76
76
  const paths = (0, fixtures_1.loadFixture)("paths.json");
@@ -84,7 +84,7 @@ async function expectPathname(page, pathnameKey) {
84
84
  /**
85
85
  * Asserts that the current pathname contains the expected substring.
86
86
  * Supports fixtures for reusable pathname values.
87
- * @example Then I see pathname contains "dashboard"
87
+ * @example Then I pw see pathname contains "dashboard"
88
88
  */
89
89
  async function expectPathnameContains(page, pathnamePartKey) {
90
90
  const paths = (0, fixtures_1.loadFixture)("paths.json");
@@ -98,7 +98,7 @@ async function expectPathnameContains(page, pathnamePartKey) {
98
98
  /**
99
99
  * Asserts that the current hash equals the expected value.
100
100
  * Supports fixtures for reusable hash values.
101
- * @example Then I see hash "#section1"
101
+ * @example Then I pw see hash "#section1"
102
102
  */
103
103
  async function expectHash(page, hashKey) {
104
104
  const hashes = (0, fixtures_1.loadFixture)("hashes.json");
@@ -112,7 +112,7 @@ async function expectHash(page, hashKey) {
112
112
  /**
113
113
  * Asserts that the current hash contains the expected substring.
114
114
  * Supports fixtures for reusable hash values.
115
- * @example Then I see hash contains "section"
115
+ * @example Then I pw see hash contains "section"
116
116
  */
117
117
  async function expectHashContains(page, hashPartKey) {
118
118
  const hashes = (0, fixtures_1.loadFixture)("hashes.json");
@@ -126,7 +126,7 @@ async function expectHashContains(page, hashPartKey) {
126
126
  /**
127
127
  * Asserts that the current search parameters contain the expected substring.
128
128
  * Supports fixtures for reusable search values.
129
- * @example Then I see search contains "query=test"
129
+ * @example Then I pw see search contains "query=test"
130
130
  */
131
131
  async function expectSearchContains(page, searchPartKey) {
132
132
  const searches = (0, fixtures_1.loadFixture)("searches.json");
@@ -140,7 +140,7 @@ async function expectSearchContains(page, searchPartKey) {
140
140
  /**
141
141
  * Asserts that the current location equals the expected value.
142
142
  * Supports fixtures for reusable location values.
143
- * @example Then I see location "https://example.com/dashboard#top"
143
+ * @example Then I pw see location "https://example.com/dashboard#top"
144
144
  */
145
145
  async function expectLocation(page, locationKey) {
146
146
  const locations = (0, fixtures_1.loadFixture)("locations.json");