playwright-cucumber-ts-steps 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +358 -671
  2. package/dist/backend/actions/click.d.ts +29 -29
  3. package/dist/backend/actions/click.js +59 -59
  4. package/dist/backend/actions/form.d.ts +2 -2
  5. package/dist/backend/actions/form.js +4 -4
  6. package/dist/backend/actions/formTable.d.ts +1 -1
  7. package/dist/backend/actions/formTable.js +2 -2
  8. package/dist/backend/actions/frames.d.ts +3 -3
  9. package/dist/backend/actions/frames.js +6 -6
  10. package/dist/backend/actions/inputs.d.ts +14 -14
  11. package/dist/backend/actions/inputs.js +32 -32
  12. package/dist/backend/actions/interactions.d.ts +7 -7
  13. package/dist/backend/actions/interactions.js +13 -13
  14. package/dist/backend/actions/keyboard.d.ts +6 -6
  15. package/dist/backend/actions/keyboard.js +12 -12
  16. package/dist/backend/actions/misc.d.ts +15 -15
  17. package/dist/backend/actions/misc.js +30 -30
  18. package/dist/backend/actions/mobile.d.ts +7 -7
  19. package/dist/backend/actions/mobile.js +14 -14
  20. package/dist/backend/actions/mouse.d.ts +9 -9
  21. package/dist/backend/actions/mouse.js +18 -18
  22. package/dist/backend/actions/navigation.d.ts +5 -5
  23. package/dist/backend/actions/navigation.js +10 -10
  24. package/dist/backend/actions/visual.d.ts +6 -6
  25. package/dist/backend/actions/visual.js +13 -13
  26. package/dist/backend/actions/waits.d.ts +6 -6
  27. package/dist/backend/actions/waits.js +12 -12
  28. package/dist/backend/api/assertions.d.ts +3 -3
  29. package/dist/backend/api/assertions.js +6 -6
  30. package/dist/backend/api/mock.d.ts +3 -3
  31. package/dist/backend/api/mock.js +6 -6
  32. package/dist/backend/api/network.d.ts +6 -6
  33. package/dist/backend/api/network.js +12 -12
  34. package/dist/backend/api/requests.d.ts +4 -4
  35. package/dist/backend/api/requests.js +8 -8
  36. package/dist/backend/assertions/document.d.ts +10 -10
  37. package/dist/backend/assertions/document.js +20 -20
  38. package/dist/backend/assertions/elements.d.ts +28 -28
  39. package/dist/backend/assertions/elements.js +56 -56
  40. package/dist/backend/assertions/expectVisible.d.ts +1 -1
  41. package/dist/backend/assertions/expectVisible.js +2 -2
  42. package/dist/backend/assertions/forms.d.ts +7 -7
  43. package/dist/backend/assertions/forms.js +14 -14
  44. package/dist/backend/assertions/pageState.d.ts +4 -4
  45. package/dist/backend/assertions/pageState.js +8 -8
  46. package/dist/backend/assertions/storage.d.ts +11 -11
  47. package/dist/backend/assertions/storage.js +22 -22
  48. package/dist/backend/assertions/text.d.ts +17 -17
  49. package/dist/backend/assertions/text.js +34 -34
  50. package/dist/backend/assertions/visibility.d.ts +15 -15
  51. package/dist/backend/assertions/visibility.js +30 -30
  52. package/dist/backend/auth/index.d.ts +2 -2
  53. package/dist/backend/auth/index.js +4 -4
  54. package/dist/backend/db/steps.d.ts +10 -10
  55. package/dist/backend/db/steps.d.ts.map +1 -1
  56. package/dist/backend/db/steps.js +19 -19
  57. package/dist/backend/elements/alerts.d.ts +3 -3
  58. package/dist/backend/elements/alerts.js +6 -6
  59. package/dist/backend/elements/find.d.ts +15 -15
  60. package/dist/backend/elements/find.js +41 -41
  61. package/dist/backend/elements/forms.d.ts +4 -4
  62. package/dist/backend/elements/forms.js +8 -8
  63. package/dist/backend/elements/frames.d.ts +3 -3
  64. package/dist/backend/elements/frames.js +6 -6
  65. package/dist/backend/utils/fixtures.d.ts +22 -0
  66. package/dist/backend/utils/fixtures.d.ts.map +1 -1
  67. package/dist/backend/utils/fixtures.js +76 -2
  68. package/dist/backend/utils/resolver.js +1 -1
  69. package/dist/component/runner.d.ts +1 -1
  70. package/dist/component/runner.d.ts.map +1 -1
  71. package/dist/component/runner.js +38 -5
  72. package/dist/core/runner.js +3 -3
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +3 -1
  76. package/dist/metadata.json +270 -270
  77. package/package.json +3 -2
@@ -17,7 +17,7 @@ const fixtures_1 = require("../utils/fixtures");
17
17
  * Takes a screenshot of the entire page.
18
18
  * @param page - The Playwright page object
19
19
  * @param filename - The filename to save the screenshot as
20
- * @example When I take a screenshot of the page "dashboard-view.png"
20
+ * @example When I pw take a screenshot of the page "dashboard-view.png"
21
21
  */
22
22
  async function takePageScreenshot(page, filename) {
23
23
  await page.screenshot({ path: `screenshots/${filename}`, fullPage: true });
@@ -28,7 +28,7 @@ async function takePageScreenshot(page, filename) {
28
28
  * @param page - The Playwright page object
29
29
  * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
30
30
  * @param filename - The filename to save the screenshot as
31
- * @example When I take a screenshot of element "header.navbar" as "navbar.png"
31
+ * @example When I pw take a screenshot of element "header.navbar" as "navbar.png"
32
32
  */
33
33
  async function takeElementScreenshot(page, selectorKey, filename) {
34
34
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -41,7 +41,7 @@ async function takeElementScreenshot(page, selectorKey, filename) {
41
41
  * Takes a screenshot of the viewport area.
42
42
  * @param page - The Playwright page object
43
43
  * @param filename - The filename to save the screenshot as
44
- * @example When I take a viewport screenshot "login-area.png"
44
+ * @example When I pw take a viewport screenshot "login-area.png"
45
45
  */
46
46
  async function takeViewportScreenshot(page, filename) {
47
47
  await page.screenshot({ path: `screenshots/${filename}` });
@@ -52,7 +52,7 @@ async function takeViewportScreenshot(page, filename) {
52
52
  * @param page - The Playwright page object
53
53
  * @param currentFilename - The filename of the current page screenshot
54
54
  * @param referenceFilename - The filename of the reference screenshot to compare with
55
- * @example Then I expect page "current-view.png" to closely match "reference-view.png"
55
+ * @example Then I pw expect page "current-view.png" to closely match "reference-view.png"
56
56
  */
57
57
  async function expectPageToCloselyMatch(page, currentFilename, referenceFilename) {
58
58
  // Playwright's screenshot comparison is already pixel-perfect by default
@@ -66,7 +66,7 @@ async function expectPageToCloselyMatch(page, currentFilename, referenceFilename
66
66
  * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
67
67
  * @param currentFilename - The filename of the current element screenshot
68
68
  * @param referenceFilename - The filename of the reference screenshot to compare with
69
- * @example Then I expect element "div.content" screenshot "content-current.png" to closely match "content-reference.png"
69
+ * @example Then I pw expect element "div.content" screenshot "content-current.png" to closely match "content-reference.png"
70
70
  */
71
71
  async function expectElementToCloselyMatch(page, selectorKey, currentFilename, referenceFilename) {
72
72
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -79,19 +79,19 @@ async function expectElementToCloselyMatch(page, selectorKey, currentFilename, r
79
79
  * Takes a screenshot and attaches it to the test report.
80
80
  * @param page - The Playwright page object
81
81
  * @param name - The name to identify the screenshot in the report
82
- * @example When I capture screenshot "error-state" for the report
82
+ * @example When I pw capture screenshot "error-state" for the report
83
83
  */
84
84
  async function captureScreenshotForReport(page, name) {
85
- const screenshot = await page.screenshot();
85
+ await page.screenshot();
86
86
  // This would typically be attached to the test report
87
87
  console.log(`📎 Captured screenshot "${name}" for test report`);
88
88
  }
89
89
  // ==================================================
90
90
  // GLUE STEPS
91
91
  // ==================================================
92
- (0, registry_1.Step)("I take a screenshot of the page {string}", takePageScreenshot, "When");
93
- (0, registry_1.Step)("I take a screenshot of element {string} as {string}", takeElementScreenshot, "When");
94
- (0, registry_1.Step)("I take a viewport screenshot {string}", takeViewportScreenshot, "When");
95
- (0, registry_1.Step)("I expect page {string} to closely match {string}", expectPageToCloselyMatch, "Then");
96
- (0, registry_1.Step)("I expect element {string} screenshot {string} to closely match {string}", expectElementToCloselyMatch, "Then");
97
- (0, registry_1.Step)("I capture screenshot {string} for the report", captureScreenshotForReport, "When");
92
+ (0, registry_1.Step)("I pw take a screenshot of the page {string}", takePageScreenshot, "When");
93
+ (0, registry_1.Step)("I pw take a screenshot of element {string} as {string}", takeElementScreenshot, "When");
94
+ (0, registry_1.Step)("I pw take a viewport screenshot {string}", takeViewportScreenshot, "When");
95
+ (0, registry_1.Step)("I pw expect page {string} to closely match {string}", expectPageToCloselyMatch, "Then");
96
+ (0, registry_1.Step)("I pw expect element {string} screenshot {string} to closely match {string}", expectElementToCloselyMatch, "Then");
97
+ (0, registry_1.Step)("I pw capture screenshot {string} for the report", captureScreenshotForReport, "When");
@@ -1,36 +1,36 @@
1
1
  /**
2
2
  * Waits for the network to reach an "idle" state.
3
3
  * In Playwright terms, this means there are no new network connections for at least 500ms.
4
- * @example When I wait for network idle
4
+ * @example When I pw wait for network idle
5
5
  */
6
6
  export declare function waitForNetworkIdle(page: any): Promise<void>;
7
7
  /**
8
8
  * Waits for the page to reach a specific load lifecycle event.
9
- * @example When I wait for load state "domcontentloaded"
9
+ * @example When I pw wait for load state "domcontentloaded"
10
10
  */
11
11
  export declare function waitForLoadState(page: any, state: string): Promise<void>;
12
12
  /**
13
13
  * Explicitly waits for the currently stored (active) element to become visible.
14
14
  * Useful for ensuring animations complete or modals appear before proceeding.
15
- * @example When I wait for element to be visible
15
+ * @example When I pw wait for element to be visible
16
16
  */
17
17
  export declare function waitForElementVisible(page: any): Promise<void>;
18
18
  /**
19
19
  * Explicitly waits for a specific element to become visible.
20
20
  * Useful for ensuring animations complete or modals appear before proceeding.
21
- * @example When I wait for "#modal" to be visible
21
+ * @example When I pw wait for "#modal" to be visible
22
22
  */
23
23
  export declare function waitForElementVisibleBySelector(page: any, selectorKey: string): Promise<void>;
24
24
  /**
25
25
  * Explicitly waits for the currently stored (active) element to become hidden or detached from the DOM.
26
26
  * Useful for verifying that loading spinners have disappeared.
27
- * @example When I wait for element to be hidden
27
+ * @example When I pw wait for element to be hidden
28
28
  */
29
29
  export declare function waitForElementHidden(page: any): Promise<void>;
30
30
  /**
31
31
  * Waits until the page URL contains the specified substring (Regex match).
32
32
  * Supports fixtures for reusable URL parts.
33
- * @example When I wait for URL to contain "dashboard"
33
+ * @example When I pw wait for URL to contain "dashboard"
34
34
  */
35
35
  export declare function waitForUrlContain(page: any, urlPartKey: string): Promise<void>;
36
36
  //# sourceMappingURL=waits.d.ts.map
@@ -15,7 +15,7 @@ const fixtures_1 = require("../utils/fixtures");
15
15
  /**
16
16
  * Waits for the network to reach an "idle" state.
17
17
  * In Playwright terms, this means there are no new network connections for at least 500ms.
18
- * @example When I wait for network idle
18
+ * @example When I pw wait for network idle
19
19
  */
20
20
  async function waitForNetworkIdle(page) {
21
21
  await page.waitForLoadState("networkidle");
@@ -23,7 +23,7 @@ async function waitForNetworkIdle(page) {
23
23
  }
24
24
  /**
25
25
  * Waits for the page to reach a specific load lifecycle event.
26
- * @example When I wait for load state "domcontentloaded"
26
+ * @example When I pw wait for load state "domcontentloaded"
27
27
  */
28
28
  async function waitForLoadState(page, state) {
29
29
  const validStates = ["load", "domcontentloaded", "networkidle"];
@@ -36,7 +36,7 @@ async function waitForLoadState(page, state) {
36
36
  /**
37
37
  * Explicitly waits for the currently stored (active) element to become visible.
38
38
  * Useful for ensuring animations complete or modals appear before proceeding.
39
- * @example When I wait for element to be visible
39
+ * @example When I pw wait for element to be visible
40
40
  */
41
41
  async function waitForElementVisible(page) {
42
42
  const element = (0, state_1.getActiveElement)(page);
@@ -46,7 +46,7 @@ async function waitForElementVisible(page) {
46
46
  /**
47
47
  * Explicitly waits for a specific element to become visible.
48
48
  * Useful for ensuring animations complete or modals appear before proceeding.
49
- * @example When I wait for "#modal" to be visible
49
+ * @example When I pw wait for "#modal" to be visible
50
50
  */
51
51
  async function waitForElementVisibleBySelector(page, selectorKey) {
52
52
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
@@ -57,7 +57,7 @@ async function waitForElementVisibleBySelector(page, selectorKey) {
57
57
  /**
58
58
  * Explicitly waits for the currently stored (active) element to become hidden or detached from the DOM.
59
59
  * Useful for verifying that loading spinners have disappeared.
60
- * @example When I wait for element to be hidden
60
+ * @example When I pw wait for element to be hidden
61
61
  */
62
62
  async function waitForElementHidden(page) {
63
63
  const element = (0, state_1.getActiveElement)(page);
@@ -67,7 +67,7 @@ async function waitForElementHidden(page) {
67
67
  /**
68
68
  * Waits until the page URL contains the specified substring (Regex match).
69
69
  * Supports fixtures for reusable URL parts.
70
- * @example When I wait for URL to contain "dashboard"
70
+ * @example When I pw wait for URL to contain "dashboard"
71
71
  */
72
72
  async function waitForUrlContain(page, urlPartKey) {
73
73
  const urls = (0, fixtures_1.loadFixture)("urls.json");
@@ -78,9 +78,9 @@ async function waitForUrlContain(page, urlPartKey) {
78
78
  // ==================================================
79
79
  // GLUE STEPS
80
80
  // ==================================================
81
- (0, registry_1.Step)("I wait for network idle", waitForNetworkIdle, "When");
82
- (0, registry_1.Step)("I wait for load state {string}", waitForLoadState, "When");
83
- (0, registry_1.Step)("I wait for element to be visible", waitForElementVisible, "When");
84
- (0, registry_1.Step)("I wait for {string} to be visible", waitForElementVisibleBySelector, "When");
85
- (0, registry_1.Step)("I wait for element to be hidden", waitForElementHidden, "When");
86
- (0, registry_1.Step)("I wait for URL to contain {string}", waitForUrlContain, "When");
81
+ (0, registry_1.Step)("I pw wait for network idle", waitForNetworkIdle, "When");
82
+ (0, registry_1.Step)("I pw wait for load state {string}", waitForLoadState, "When");
83
+ (0, registry_1.Step)("I pw wait for element to be visible", waitForElementVisible, "When");
84
+ (0, registry_1.Step)("I pw wait for {string} to be visible", waitForElementVisibleBySelector, "When");
85
+ (0, registry_1.Step)("I pw wait for element to be hidden", waitForElementHidden, "When");
86
+ (0, registry_1.Step)("I pw wait for URL to contain {string}", waitForUrlContain, "When");
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Asserts that the HTTP status code of the last API response matches the expected integer.
3
- * @example Then I expect the response status to be 200
3
+ * @example Then I pw expect the response status to be 200
4
4
  */
5
5
  export declare function expectResponseStatus(page: any, statusCode: number): Promise<void>;
6
6
  /**
7
7
  * Asserts that the body text of the last API response contains a specific substring.
8
8
  * Supports fixtures for reusable substrings.
9
- * @example Then I expect the response body to contain "success"
9
+ * @example Then I pw expect the response body to contain "success"
10
10
  */
11
11
  export declare function expectResponseBodyContain(page: any, textKey: string): Promise<void>;
12
12
  /**
13
13
  * Asserts that a specific property in the JSON response matches a string value.
14
14
  * Supports dot notation for nested properties and fixtures for reusable keys/values.
15
- * @example Then I expect the response property "user.id" to be "12345"
15
+ * @example Then I pw expect the response property "user.id" to be "12345"
16
16
  */
17
17
  export declare function expectResponseProperty(page: any, jsonPathKey: string, valueKey: string): Promise<void>;
18
18
  //# sourceMappingURL=assertions.d.ts.map
@@ -13,7 +13,7 @@ const fixtures_1 = require("../utils/fixtures");
13
13
  // ==================================================
14
14
  /**
15
15
  * 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
16
+ * @example Then I pw expect the response status to be 200
17
17
  */
18
18
  async function expectResponseStatus(page, statusCode) {
19
19
  const response = state_1.apiState.getResponse();
@@ -25,7 +25,7 @@ async function expectResponseStatus(page, statusCode) {
25
25
  /**
26
26
  * Asserts that the body text of the last API response contains a specific substring.
27
27
  * Supports fixtures for reusable substrings.
28
- * @example Then I expect the response body to contain "success"
28
+ * @example Then I pw expect the response body to contain "success"
29
29
  */
30
30
  async function expectResponseBodyContain(page, textKey) {
31
31
  const response = state_1.apiState.getResponse();
@@ -40,7 +40,7 @@ async function expectResponseBodyContain(page, textKey) {
40
40
  /**
41
41
  * Asserts that a specific property in the JSON response matches a string value.
42
42
  * 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"
43
+ * @example Then I pw expect the response property "user.id" to be "12345"
44
44
  */
45
45
  async function expectResponseProperty(page, jsonPathKey, valueKey) {
46
46
  const response = state_1.apiState.getResponse();
@@ -58,6 +58,6 @@ async function expectResponseProperty(page, jsonPathKey, valueKey) {
58
58
  // ==================================================
59
59
  // GLUE STEPS
60
60
  // ==================================================
61
- (0, registry_1.Step)("I expect the response status to be {int}", expectResponseStatus, "Then");
62
- (0, registry_1.Step)("I expect the response body to contain {string}", expectResponseBodyContain, "Then");
63
- (0, registry_1.Step)("I expect the response property {string} to be {string}", expectResponseProperty, "Then");
61
+ (0, registry_1.Step)("I pw expect the response status to be {int}", expectResponseStatus, "Then");
62
+ (0, registry_1.Step)("I pw expect the response body to contain {string}", expectResponseBodyContain, "Then");
63
+ (0, registry_1.Step)("I pw expect the response property {string} to be {string}", expectResponseProperty, "Then");
@@ -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");
@@ -102,6 +102,6 @@ async function mockApiStatus(page, urlPatternKey, statusCode) {
102
102
  // ==================================================
103
103
  // GLUE STEPS
104
104
  // ==================================================
105
- (0, registry_1.Step)("I mock the API endpoint {string} with body {string}", mockApiWithInlineJson, "Given");
106
- (0, registry_1.Step)("I mock the API endpoint {string} with response from {string}", mockApiWithFile, "Given");
107
- (0, registry_1.Step)("I mock the API endpoint {string} with status {int}", mockApiStatus, "Given");
105
+ (0, registry_1.Step)("I pw mock the API endpoint {string} with body {string}", mockApiWithInlineJson, "Given");
106
+ (0, registry_1.Step)("I pw mock the API endpoint {string} with response from {string}", mockApiWithFile, "Given");
107
+ (0, registry_1.Step)("I pw mock the API endpoint {string} with status {int}", mockApiStatus, "Given");
@@ -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
  */
@@ -165,9 +165,9 @@ async function browserFetchRequest(page, method, url, table) {
165
165
  // ==================================================
166
166
  // GLUE STEPS
167
167
  // ==================================================
168
- (0, registry_1.Step)("I intercept URL {string} and stub body:", interceptStubJson, "When"); // Handles DocString
169
- (0, registry_1.Step)("I intercept URL {string} and stub body {string}", interceptStubRaw, "When");
170
- (0, registry_1.Step)("I intercept URL {string}", interceptSpy, "When");
171
- (0, registry_1.Step)("I make request to {string}", apiGetRequest, "When");
172
- (0, registry_1.Step)("I make a POST request to {string} with JSON body:", apiPostRequest, "When"); // Handles DocString
173
- (0, registry_1.Step)("I make a {word} request to {string}", browserFetchRequest, "When");
168
+ (0, registry_1.Step)("I pw intercept URL {string} and stub body:", interceptStubJson, "When"); // Handles DocString
169
+ (0, registry_1.Step)("I pw intercept URL {string} and stub body {string}", interceptStubRaw, "When");
170
+ (0, registry_1.Step)("I pw intercept URL {string}", interceptSpy, "When");
171
+ (0, registry_1.Step)("I pw make request to {string}", apiGetRequest, "When");
172
+ (0, registry_1.Step)("I pw make a POST request to {string} with JSON body:", apiPostRequest, "When"); // Handles DocString
173
+ (0, registry_1.Step)("I pw make a {word} request to {string}", browserFetchRequest, "When");
@@ -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");
@@ -118,7 +118,7 @@ async function makePostRequestWithFile(page, urlKey, filePathKey) {
118
118
  // ==================================================
119
119
  // GLUE STEPS
120
120
  // ==================================================
121
- (0, registry_1.Step)("I make a GET request to {string}", makeGetRequest, "When");
122
- (0, registry_1.Step)("I make a DELETE request to {string}", makeDeleteRequest, "When");
123
- (0, registry_1.Step)("I make a POST request to {string} with data", makePostRequestWithTable, "When");
124
- (0, registry_1.Step)("I make a POST request to {string} with payload from {string}", makePostRequestWithFile, "When");
121
+ (0, registry_1.Step)("I pw make a GET request to {string}", makeGetRequest, "When");
122
+ (0, registry_1.Step)("I pw make a DELETE request to {string}", makeDeleteRequest, "When");
123
+ (0, registry_1.Step)("I pw make a POST request to {string} with data", makePostRequestWithTable, "When");
124
+ (0, registry_1.Step)("I pw make a POST request to {string} with payload from {string}", makePostRequestWithFile, "When");
@@ -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