playwright-cucumber-ts-steps 1.3.0 → 1.3.2

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/dist/backend/actions/click.d.ts +84 -0
  2. package/dist/backend/actions/click.d.ts.map +1 -1
  3. package/dist/backend/actions/click.js +167 -17
  4. package/dist/backend/actions/form.d.ts +6 -0
  5. package/dist/backend/actions/form.d.ts.map +1 -1
  6. package/dist/backend/actions/form.js +17 -1
  7. package/dist/backend/actions/formTable.js +1 -1
  8. package/dist/backend/actions/frames.js +3 -3
  9. package/dist/backend/actions/index.d.ts +2 -0
  10. package/dist/backend/actions/index.d.ts.map +1 -1
  11. package/dist/backend/actions/index.js +2 -0
  12. package/dist/backend/actions/inputs.js +18 -18
  13. package/dist/backend/actions/interactions.d.ts +14 -5
  14. package/dist/backend/actions/interactions.d.ts.map +1 -1
  15. package/dist/backend/actions/interactions.js +69 -13
  16. package/dist/backend/actions/keyboard.js +6 -6
  17. package/dist/backend/actions/misc.d.ts +8 -2
  18. package/dist/backend/actions/misc.d.ts.map +1 -1
  19. package/dist/backend/actions/misc.js +64 -16
  20. package/dist/backend/actions/mobile.js +7 -7
  21. package/dist/backend/actions/mouse.js +9 -9
  22. package/dist/backend/actions/navigation.js +5 -5
  23. package/dist/backend/actions/visual.d.ts +47 -0
  24. package/dist/backend/actions/visual.d.ts.map +1 -0
  25. package/dist/backend/actions/visual.js +97 -0
  26. package/dist/backend/actions/waits.d.ts +6 -0
  27. package/dist/backend/actions/waits.d.ts.map +1 -1
  28. package/dist/backend/actions/waits.js +18 -5
  29. package/dist/backend/api/assertions.js +3 -3
  30. package/dist/backend/api/mock.js +3 -3
  31. package/dist/backend/api/network.js +6 -6
  32. package/dist/backend/api/requests.js +4 -4
  33. package/dist/backend/assertions/document.d.ts +61 -0
  34. package/dist/backend/assertions/document.d.ts.map +1 -0
  35. package/dist/backend/assertions/document.js +166 -0
  36. package/dist/backend/assertions/elements.d.ts +163 -0
  37. package/dist/backend/assertions/elements.d.ts.map +1 -0
  38. package/dist/backend/assertions/elements.js +441 -0
  39. package/dist/backend/assertions/expectVisible.js +1 -1
  40. package/dist/backend/assertions/forms.d.ts +43 -0
  41. package/dist/backend/assertions/forms.d.ts.map +1 -0
  42. package/dist/backend/assertions/forms.js +126 -0
  43. package/dist/backend/assertions/index.d.ts +10 -0
  44. package/dist/backend/assertions/index.d.ts.map +1 -1
  45. package/dist/backend/assertions/index.js +10 -0
  46. package/dist/backend/assertions/pageState.js +4 -4
  47. package/dist/backend/assertions/storage.d.ts +67 -0
  48. package/dist/backend/assertions/storage.d.ts.map +1 -0
  49. package/dist/backend/assertions/storage.js +220 -0
  50. package/dist/backend/assertions/text.d.ts +103 -12
  51. package/dist/backend/assertions/text.d.ts.map +1 -1
  52. package/dist/backend/assertions/text.js +207 -28
  53. package/dist/backend/assertions/visibility.d.ts +18 -0
  54. package/dist/backend/assertions/visibility.d.ts.map +1 -1
  55. package/dist/backend/assertions/visibility.js +58 -12
  56. package/dist/backend/auth/index.js +2 -2
  57. package/dist/backend/db/steps.d.ts +2 -2
  58. package/dist/backend/db/steps.d.ts.map +1 -1
  59. package/dist/backend/db/steps.js +11 -11
  60. package/dist/backend/elements/alerts.js +3 -3
  61. package/dist/backend/elements/find.js +26 -24
  62. package/dist/backend/elements/forms.js +4 -4
  63. package/dist/backend/elements/frames.js +3 -3
  64. package/dist/backend/utils/fixtures.js +1 -1
  65. package/dist/backend/utils/resolver.d.ts +6 -0
  66. package/dist/backend/utils/resolver.d.ts.map +1 -0
  67. package/dist/backend/utils/resolver.js +19 -0
  68. package/dist/component/index.d.ts +3 -0
  69. package/dist/component/index.d.ts.map +1 -0
  70. package/dist/component/index.js +6 -0
  71. package/dist/component/runner.d.ts +18 -0
  72. package/dist/component/runner.d.ts.map +1 -0
  73. package/dist/component/runner.js +91 -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 +179 -124
  77. package/dist/index.d.ts +2 -0
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +3 -1
  80. package/dist/metadata.json +564 -172
  81. package/package.json +4 -3
@@ -1,22 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expectElementToHaveText = expectElementToHaveText;
4
- exports.expectElementToContainText = expectElementToContainText;
5
- exports.expectElementToHaveValue = expectElementToHaveValue;
6
- exports.expectElementAttributeValue = expectElementAttributeValue;
7
- //src/backend/assertions/pageState.ts
3
+ exports.expectElementToHaveExactText = expectElementToHaveExactText;
4
+ exports.expectGlobalTextVisible = expectGlobalTextVisible;
5
+ exports.expectGlobalTextNotVisible = expectGlobalTextNotVisible;
6
+ exports.expectElementToHaveExactValue = expectElementToHaveExactValue;
7
+ exports.expectElementToNotHaveExactValue = expectElementToNotHaveExactValue;
8
+ exports.expectElementToHaveExactAttribute = expectElementToHaveExactAttribute;
9
+ exports.expectElementToNotHaveExactAttribute = expectElementToNotHaveExactAttribute;
10
+ exports.iSeeButtonText = iSeeButtonText;
11
+ exports.iSeeHeadingText = iSeeHeadingText;
12
+ exports.iSeeLinkText = iSeeLinkText;
13
+ exports.iSeeLabelText = iSeeLabelText;
14
+ exports.iDoNotSeeButtonText = iDoNotSeeButtonText;
15
+ exports.iDoNotSeeHeadingText = iDoNotSeeHeadingText;
16
+ exports.iDoNotSeeLinkText = iDoNotSeeLinkText;
17
+ exports.iDoNotSeeLabelText = iDoNotSeeLabelText;
18
+ exports.getElementBySelectorToBeHidden = getElementBySelectorToBeHidden;
19
+ //src/backend/assertions/text.ts
8
20
  const test_1 = require("@playwright/test");
9
21
  const registry_1 = require("../../core/registry");
10
22
  const fixtures_1 = require("../utils/fixtures");
11
23
  // ==================================================
12
24
  // CORE FUNCTIONS
13
25
  // ==================================================
26
+ const resolver_1 = require("../utils/resolver");
27
+ // Additional functions for exact text matching and negative assertions
14
28
  /**
15
- * Asserts that an element exactly matches the specified text.
29
+ * Asserts that an element exactly matches the specified text (case-sensitive).
16
30
  * Supports fixtures for reusable selectors and text values.
17
- * @example Then I expect "header.title" to have text "Welcome Home"
31
+ * @param page - The Playwright page object
32
+ * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
33
+ * @param textKey - The text key (can be a fixture key or raw text)
34
+ * @example Then I see exact element text "Welcome Home"
18
35
  */
19
- async function expectElementToHaveText(page, selectorKey, textKey) {
36
+ async function expectElementToHaveExactText(page, selectorKey, textKey) {
20
37
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
21
38
  const texts = (0, fixtures_1.loadFixture)("texts.json");
22
39
  const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
@@ -25,37 +42,77 @@ async function expectElementToHaveText(page, selectorKey, textKey) {
25
42
  console.log(`✅ Element "${selector}" has exact text "${text}"`);
26
43
  }
27
44
  /**
28
- * Asserts that an element contains the specified substring.
45
+ * Asserts that an element contains the specified substring (case-sensitive).
29
46
  * Supports fixtures for reusable selectors and text values.
30
- * @example Then I expect "error.message" to contain text "invalid credentials"
47
+ * @param page - The Playwright page object
48
+ * @param textKey - The text key (can be a fixture key or raw text)
49
+ * @example Then I see text "Welcome" (will match "Welcome Home" or "Welcome!")
50
+ *
51
+ * Global Visibility Check: Finds text anywhere on the page without needing a selector.
31
52
  */
32
- async function expectElementToContainText(page, selectorKey, textKey) {
53
+ async function expectGlobalTextVisible(page, textKey) {
54
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
55
+ // The quotes around ${text} handle strings with spaces correctly
56
+ await (0, test_1.expect)(page.locator(`text="${text}"`).first()).toBeVisible();
57
+ console.log(`✅ Page texts contains "${text}"`);
58
+ }
59
+ /**
60
+ * Asserts that an element does NOT contain the specified substring.
61
+ * Supports fixtures for reusable selectors and text values.
62
+ * @param page - The Playwright page object
63
+ * @param textKey - The text key (can be a fixture key or raw text)
64
+ * @example Then I do not see text "error"
65
+ */
66
+ async function expectGlobalTextNotVisible(page, textKey) {
67
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
68
+ await (0, test_1.expect)(page.locator(`text="${text}"`).first()).toBeHidden();
69
+ console.log(`✅ Page texts does not contain "${text}"`);
70
+ }
71
+ /**
72
+ * Asserts that a form field (input, textarea, select) has a specific value (exact match).
73
+ * Supports fixtures for reusable selectors and values.
74
+ * @param page - The Playwright page object
75
+ * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
76
+ * @param valueKey - The value key (can be a fixture key or raw value)
77
+ * @example Then I see exact value "john_doe"
78
+ */
79
+ async function expectElementToHaveExactValue(page, selectorKey, valueKey) {
33
80
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
34
- const texts = (0, fixtures_1.loadFixture)("texts.json");
81
+ const values = (0, fixtures_1.loadFixture)("values.json");
35
82
  const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
36
- const text = (0, fixtures_1.getFixtureValue)(texts, textKey);
37
- await (0, test_1.expect)(page.locator(selector)).toContainText(text);
38
- console.log(`✅ Element "${selector}" contains text "${text}"`);
83
+ const value = (0, fixtures_1.getFixtureValue)(values, valueKey);
84
+ await (0, test_1.expect)(page.locator(selector)).toHaveValue(value);
85
+ console.log(`✅ Input "${selector}" has exact value "${value}"`);
39
86
  }
40
87
  /**
41
- * Asserts that a form field (input, textarea, select) has a specific value.
88
+ * Asserts that a form field (input, textarea, select) does NOT have a specific value.
42
89
  * Supports fixtures for reusable selectors and values.
43
- * @example Then I expect "login.usernameField" to have value "john_doe"
90
+ * @param page - The Playwright page object
91
+ * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
92
+ * @param valueKey - The value key (can be a fixture key or raw value)
93
+ * @example Then I do not see exact value "john_doe"
44
94
  */
45
- async function expectElementToHaveValue(page, selectorKey, valueKey) {
95
+ async function expectElementToNotHaveExactValue(page, selectorKey, valueKey) {
46
96
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
47
97
  const values = (0, fixtures_1.loadFixture)("values.json");
48
98
  const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
49
99
  const value = (0, fixtures_1.getFixtureValue)(values, valueKey);
50
- await (0, test_1.expect)(page.locator(selector)).toHaveValue(value);
51
- console.log(`✅ Input "${selector}" has value "${value}"`);
100
+ const actualValue = await page.locator(selector).inputValue();
101
+ if (actualValue === value) {
102
+ throw new Error(`Input "${selector}" has value "${value}" but was expected not to`);
103
+ }
104
+ console.log(`✅ Input "${selector}" does not have exact value "${value}"`);
52
105
  }
53
106
  /**
54
- * Asserts that a specific attribute of an element matches the expected value.
107
+ * Asserts that a specific attribute of an element matches the expected value exactly.
55
108
  * Supports fixtures for reusable selectors, attributes, and values.
56
- * @example Then I expect "terms.link" to have attribute "href" with value "/terms-and-conditions"
109
+ * @param page - The Playwright page object
110
+ * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
111
+ * @param attrKey - The attribute key (can be a fixture key or raw attribute name)
112
+ * @param valueKey - The value key (can be a fixture key or raw value)
113
+ * @example Then I see exact attribute "href" with value "/terms-and-conditions"
57
114
  */
58
- async function expectElementAttributeValue(page, selectorKey, attrKey, valueKey) {
115
+ async function expectElementToHaveExactAttribute(page, selectorKey, attrKey, valueKey) {
59
116
  const selectors = (0, fixtures_1.loadFixture)("selectors.json");
60
117
  const attributes = (0, fixtures_1.loadFixture)("attributes.json");
61
118
  const values = (0, fixtures_1.loadFixture)("values.json");
@@ -63,12 +120,134 @@ async function expectElementAttributeValue(page, selectorKey, attrKey, valueKey)
63
120
  const attr = (0, fixtures_1.getFixtureValue)(attributes, attrKey);
64
121
  const value = (0, fixtures_1.getFixtureValue)(values, valueKey);
65
122
  await (0, test_1.expect)(page.locator(selector)).toHaveAttribute(attr, value);
66
- console.log(`✅ Element "${selector}" attribute "${attr}" is "${value}"`);
123
+ console.log(`✅ Element "${selector}" attribute "${attr}" has exact value "${value}"`);
124
+ }
125
+ /**
126
+ * Asserts that a specific attribute of an element does NOT match the expected value.
127
+ * Supports fixtures for reusable selectors, attributes, and values.
128
+ * @param page - The Playwright page object
129
+ * @param selectorKey - The selector key (can be a fixture key or raw CSS selector)
130
+ * @param attrKey - The attribute key (can be a fixture key or raw attribute name)
131
+ * @param valueKey - The value key (can be a fixture key or raw value)
132
+ * @example Then I do not see exact attribute "href" with value "/wrong-url"
133
+ */
134
+ async function expectElementToNotHaveExactAttribute(page, selectorKey, attrKey, valueKey) {
135
+ const selectors = (0, fixtures_1.loadFixture)("selectors.json");
136
+ const attributes = (0, fixtures_1.loadFixture)("attributes.json");
137
+ const values = (0, fixtures_1.loadFixture)("values.json");
138
+ const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
139
+ const attr = (0, fixtures_1.getFixtureValue)(attributes, attrKey);
140
+ const value = (0, fixtures_1.getFixtureValue)(values, valueKey);
141
+ const actualValue = await page.locator(selector).getAttribute(attr);
142
+ if (actualValue === value) {
143
+ throw new Error(`Element "${selector}" attribute "${attr}" has value "${value}" but was expected not to`);
144
+ }
145
+ console.log(`✅ Element "${selector}" attribute "${attr}" does not have exact value "${value}"`);
146
+ }
147
+ /**
148
+ * Asserts that a button with specific text is visible.
149
+ * @param page - The Playwright page object
150
+ * @param textKey - The text key (can be a fixture key or raw text)
151
+ * @example Then I see button text "Submit"
152
+ * @example Then I see button text "buttons.saveKey" (fixture)
153
+ */
154
+ async function iSeeButtonText(page, textKey) {
155
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
156
+ await (0, test_1.expect)(page.getByRole('button', { name: text, exact: true })).toBeVisible();
157
+ console.log(`✅ Button with text "${text}" is visible`);
158
+ }
159
+ /**
160
+ * Asserts that a heading with specific text is visible.
161
+ * @param page - The Playwright page object
162
+ * @param textKey - The text key (can be a fixture key or raw text)
163
+ * @example Then I see heading text "Welcome"
164
+ */
165
+ async function iSeeHeadingText(page, textKey) {
166
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
167
+ await (0, test_1.expect)(page.getByRole('heading', { name: text })).toBeVisible();
168
+ console.log(`✅ Heading with text "${text}" is visible`);
169
+ }
170
+ /**
171
+ * Asserts that a link with specific text is visible.
172
+ * @example Then I see link text "Read More"
173
+ */
174
+ async function iSeeLinkText(page, textKey) {
175
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
176
+ await (0, test_1.expect)(page.getByRole('link', { name: text, exact: true })).toBeVisible();
177
+ console.log(`✅ Link with text "${text}" is visible`);
178
+ }
179
+ /**
180
+ * Asserts that a label with specific text is visible.
181
+ * @example Then I see label text "Email Address"
182
+ */
183
+ async function iSeeLabelText(page, textKey) {
184
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
185
+ await (0, test_1.expect)(page.locator('label', { hasText: text })).toBeVisible();
186
+ console.log(`✅ Label with text "${text}" is visible`);
187
+ }
188
+ /**
189
+ * Asserts that a button with specific text is NOT visible or does not exist.
190
+ * @example Then I do not see button text "Delete"
191
+ */
192
+ async function iDoNotSeeButtonText(page, textKey) {
193
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
194
+ await (0, test_1.expect)(page.getByRole('button', { name: text, exact: true })).toBeHidden();
195
+ console.log(`✅ Button with text "${text}" is hidden`);
196
+ }
197
+ /**
198
+ * Asserts that a heading with specific text is NOT visible or does not exist.
199
+ * @example Then I do not see heading text "Old Title"
200
+ */
201
+ async function iDoNotSeeHeadingText(page, textKey) {
202
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
203
+ await (0, test_1.expect)(page.getByRole('heading', { name: text })).toBeHidden();
204
+ console.log(`✅ Heading with text "${text}" is hidden`);
205
+ }
206
+ /**
207
+ * Asserts that a link with specific text is NOT visible or does not exist.
208
+ * @example Then I do not see link text "Expired Offer"
209
+ */
210
+ async function iDoNotSeeLinkText(page, textKey) {
211
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
212
+ await (0, test_1.expect)(page.getByRole('link', { name: text, exact: true })).toBeHidden();
213
+ console.log(`✅ Link with text "${text}" is hidden`);
214
+ }
215
+ /**
216
+ * Asserts that a label with specific text is NOT visible or does not exist.
217
+ * @example Then I do not see label text "Secret Info"
218
+ */
219
+ async function iDoNotSeeLabelText(page, textKey) {
220
+ const text = (0, resolver_1.resolveParam)(textKey, "texts.json");
221
+ await (0, test_1.expect)(page.locator('label', { hasText: text })).toBeHidden();
222
+ console.log(`✅ Label with text "${text}" is hidden`);
223
+ }
224
+ /**
225
+ * Gets an element by selector and asserts it is hidden.
226
+ * @example When I get element by selector "div.loader" to be hidden
227
+ */
228
+ async function getElementBySelectorToBeHidden(page, selectorKey) {
229
+ const selector = (0, resolver_1.resolveParam)(selectorKey, "selectors.json");
230
+ await (0, test_1.expect)(page.locator(selector)).toBeHidden();
231
+ console.log(`✅ Element "${selector}" is hidden`);
67
232
  }
68
233
  // ==================================================
69
234
  // GLUE STEPS
70
235
  // ==================================================
71
- (0, registry_1.Step)("I expect {string} to have text {string}", expectElementToHaveText, "Then");
72
- (0, registry_1.Step)("I expect {string} to contain text {string}", expectElementToContainText, "Then");
73
- (0, registry_1.Step)("I expect {string} to have value {string}", expectElementToHaveValue, "Then");
74
- (0, registry_1.Step)("I expect {string} to have attribute {string} with value {string}", expectElementAttributeValue, "Then");
236
+ (0, registry_1.Step)("I pw see button text {string}", iSeeButtonText, "Then");
237
+ (0, registry_1.Step)("I pw see heading text {string}", iSeeHeadingText, "Then");
238
+ (0, registry_1.Step)("I pw see link text {string}", iSeeLinkText, "Then");
239
+ (0, registry_1.Step)("I pw see label text {string}", iSeeLabelText, "Then");
240
+ (0, registry_1.Step)("I pw do not see button text {string}", iDoNotSeeButtonText, "Then");
241
+ (0, registry_1.Step)("I pw do not see heading text {string}", iDoNotSeeHeadingText, "Then");
242
+ (0, registry_1.Step)("I pw do not see link text {string}", iDoNotSeeLinkText, "Then");
243
+ (0, registry_1.Step)("I pw do not see label text {string}", iDoNotSeeLabelText, "Then");
244
+ (0, registry_1.Step)("I pw see exact element text {string}", expectElementToHaveExactText, "Then");
245
+ (0, registry_1.Step)("I pw see exact value {string}", expectElementToHaveExactValue, "Then");
246
+ (0, registry_1.Step)("I pw do not see exact value {string}", expectElementToNotHaveExactValue, "Then");
247
+ (0, registry_1.Step)("I pw see exact attribute {string} with value {string}", expectElementToHaveExactAttribute, "Then");
248
+ (0, registry_1.Step)("I pw do not see exact attribute {string} with value {string}", expectElementToNotHaveExactAttribute, "Then");
249
+ // Global Text Assertions (No selector needed)
250
+ (0, registry_1.Step)("I pw see text {string}", expectGlobalTextVisible, "Then");
251
+ (0, registry_1.Step)("I pw see exact text {string}", expectGlobalTextVisible, "Then"); // Maps to same logic
252
+ (0, registry_1.Step)("I pw do not see text {string}", expectGlobalTextNotVisible, "Then");
253
+ (0, registry_1.Step)("I pw do not see exact text {string}", expectGlobalTextNotVisible, "Then");
@@ -65,4 +65,22 @@ export declare function expectPageScreenshotMatch(page: any, filename: string):
65
65
  * @example Then I expect the element screenshot to match "login-button.png"
66
66
  */
67
67
  export declare function expectElementScreenshotMatch(page: any, filename: string): Promise<void>;
68
+ /**
69
+ * Asserts that an element is not visible.
70
+ * Supports fixtures for reusable selectors.
71
+ * @example Then I expect "modal.overlay" to be not visible
72
+ */
73
+ export declare function expectElementToNotBeVisible(page: any, selectorKey: string): Promise<void>;
74
+ /**
75
+ * Asserts that an element exists in the DOM.
76
+ * Supports fixtures for reusable selectors.
77
+ * @example Then I expect element "header.logo" exists
78
+ */
79
+ export declare function expectElementExists(page: any, selectorKey: string): Promise<void>;
80
+ /**
81
+ * Asserts that an element does not exist in the DOM.
82
+ * Supports fixtures for reusable selectors.
83
+ * @example Then I expect element "modal.deleted" does not exist
84
+ */
85
+ export declare function expectElementDoesNotExist(page: any, selectorKey: string): Promise<void>;
68
86
  //# sourceMappingURL=visibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../src/backend/assertions/visibility.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,C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,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1F;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7F;AAGD;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CASf"}
@@ -12,6 +12,9 @@ exports.expectActiveAttribute = expectActiveAttribute;
12
12
  exports.expectActiveAttributeValue = expectActiveAttributeValue;
13
13
  exports.expectPageScreenshotMatch = expectPageScreenshotMatch;
14
14
  exports.expectElementScreenshotMatch = expectElementScreenshotMatch;
15
+ exports.expectElementToNotBeVisible = expectElementToNotBeVisible;
16
+ exports.expectElementExists = expectElementExists;
17
+ exports.expectElementDoesNotExist = expectElementDoesNotExist;
15
18
  //src/backend/assertions/visibility.ts
16
19
  const test_1 = require("@playwright/test");
17
20
  const registry_1 = require("../../core/registry");
@@ -158,18 +161,61 @@ async function expectElementScreenshotMatch(page, filename) {
158
161
  await (0, test_1.expect)(element).toHaveScreenshot(filename);
159
162
  console.log(`📸 Element matches screenshot: ${filename}`);
160
163
  }
164
+ // Additional functions for more specific visibility and existence checks
165
+ /**
166
+ * Asserts that an element is not visible.
167
+ * Supports fixtures for reusable selectors.
168
+ * @example Then I expect "modal.overlay" to be not visible
169
+ */
170
+ async function expectElementToNotBeVisible(page, selectorKey) {
171
+ const selectors = (0, fixtures_1.loadFixture)("selectors.json");
172
+ const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
173
+ await (0, test_1.expect)(page.locator(selector)).not.toBeVisible();
174
+ console.log(`✅ Element "${selector}" is not visible`);
175
+ }
176
+ /**
177
+ * Asserts that an element exists in the DOM.
178
+ * Supports fixtures for reusable selectors.
179
+ * @example Then I expect element "header.logo" exists
180
+ */
181
+ async function expectElementExists(page, selectorKey) {
182
+ const selectors = (0, fixtures_1.loadFixture)("selectors.json");
183
+ const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
184
+ const count = await page.locator(selector).count();
185
+ if (count === 0) {
186
+ throw new Error(`Element "${selector}" does not exist in the DOM`);
187
+ }
188
+ console.log(`✅ Element "${selector}" exists in the DOM`);
189
+ }
190
+ /**
191
+ * Asserts that an element does not exist in the DOM.
192
+ * Supports fixtures for reusable selectors.
193
+ * @example Then I expect element "modal.deleted" does not exist
194
+ */
195
+ async function expectElementDoesNotExist(page, selectorKey) {
196
+ const selectors = (0, fixtures_1.loadFixture)("selectors.json");
197
+ const selector = (0, fixtures_1.getFixtureValue)(selectors, selectorKey);
198
+ const count = await page.locator(selector).count();
199
+ if (count > 0) {
200
+ throw new Error(`Element "${selector}" exists in the DOM but was expected not to`);
201
+ }
202
+ console.log(`✅ Element "${selector}" does not exist in the DOM`);
203
+ }
161
204
  // ==================================================
162
205
  // GLUE STEPS
163
206
  // ==================================================
164
- (0, registry_1.Step)("I expect element to be visible", expectActiveVisible, "Then");
165
- (0, registry_1.Step)("I expect {string} to be visible", expectStringVisible, "Then");
166
- (0, registry_1.Step)("I expect element to be hidden", expectActiveHidden, "Then");
167
- (0, registry_1.Step)("I expect element to be enabled", expectActiveEnabled, "Then");
168
- (0, registry_1.Step)("I expect element to be disabled", expectActiveDisabled, "Then");
169
- (0, registry_1.Step)("I expect element to have text {string}", expectActiveText, "Then");
170
- (0, registry_1.Step)("I expect element to contain text {string}", expectActiveContainText, "Then");
171
- (0, registry_1.Step)("I expect element to have value {string}", expectActiveValue, "Then");
172
- (0, registry_1.Step)("I expect element to have attribute {string}", expectActiveAttribute, "Then");
173
- (0, registry_1.Step)("I expect element to have attribute {string} with value {string}", expectActiveAttributeValue, "Then");
174
- (0, registry_1.Step)("I expect the page screenshot to match {string}", expectPageScreenshotMatch, "Then");
175
- (0, registry_1.Step)("I expect the element screenshot to match {string}", expectElementScreenshotMatch, "Then");
207
+ (0, registry_1.Step)("I pw expect element to be visible", expectActiveVisible, "Then");
208
+ (0, registry_1.Step)("I pw expect {string} to be visible", expectStringVisible, "Then");
209
+ (0, registry_1.Step)("I pw expect element to be hidden", expectActiveHidden, "Then");
210
+ (0, registry_1.Step)("I pw expect element to be enabled", expectActiveEnabled, "Then");
211
+ (0, registry_1.Step)("I pw expect element to be disabled", expectActiveDisabled, "Then");
212
+ (0, registry_1.Step)("I pw expect element to have text {string}", expectActiveText, "Then");
213
+ (0, registry_1.Step)("I pw expect element to contain text {string}", expectActiveContainText, "Then");
214
+ (0, registry_1.Step)("I pw expect element to have value {string}", expectActiveValue, "Then");
215
+ (0, registry_1.Step)("I pw expect element to have attribute {string}", expectActiveAttribute, "Then");
216
+ (0, registry_1.Step)("I pw expect element to have attribute {string} with value {string}", expectActiveAttributeValue, "Then");
217
+ (0, registry_1.Step)("I pw expect the page screenshot to match {string}", expectPageScreenshotMatch, "Then");
218
+ (0, registry_1.Step)("I pw expect the element screenshot to match {string}", expectElementScreenshotMatch, "Then");
219
+ (0, registry_1.Step)("I pw expect {string} to be not visible", expectElementToNotBeVisible, "Then");
220
+ (0, registry_1.Step)("I pw expect element {string} exists", expectElementExists, "Then");
221
+ (0, registry_1.Step)("I pw expect element {string} does not exist", expectElementDoesNotExist, "Then");
@@ -91,5 +91,5 @@ async function loadBrowserState(page, filenameKey) {
91
91
  // ==================================================
92
92
  // GLUE STEPS
93
93
  // ==================================================
94
- (0, registry_1.Step)("I save the browser state to {string}", saveBrowserState);
95
- (0, registry_1.Step)("I load the browser state from {string}", loadBrowserState);
94
+ (0, registry_1.Step)("I pw save the browser state to {string}", saveBrowserState);
95
+ (0, registry_1.Step)("I pw load the browser state from {string}", loadBrowserState);
@@ -3,7 +3,7 @@
3
3
  * Supports fixtures for reusable queries.
4
4
  * @example When I run the database query "selectUsersByEmail"
5
5
  */
6
- export declare function runDbQuery(page: any, queryKey: string): Promise<void>;
6
+ export declare function runDbQuery(_page: any, queryKey: string): Promise<void>;
7
7
  /**
8
8
  * Asserts that the last executed database query returned a specific number of records.
9
9
  * @example Then I expect the database to return 1 record
@@ -13,7 +13,7 @@ export declare function expectDbRecordCount(page: any, count: number): Promise<v
13
13
  * Asserts that the database query returned no records (empty result set).
14
14
  * @example Then I expect the database to return no records
15
15
  */
16
- export declare function expectDbNoRecords(page: any): Promise<void>;
16
+ export declare function expectDbNoRecords(_page: any): Promise<void>;
17
17
  /**
18
18
  * Asserts that the first record of the last database result set contains specific column values.
19
19
  * Performs a loose equality check (converts values to strings) to handle type mismatches.
@@ -1 +1 @@
1
- {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/backend/db/steps.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM3E;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjF;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhE;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,MAAM,EAAE,EAAE,GACpB,OAAO,CAAC,IA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AAE,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EAAE,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCjG;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB1F;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,GAAG,EACT,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAyBf"}
@@ -22,7 +22,7 @@ const state_1 = require("../utils/state");
22
22
  * Supports fixtures for reusable queries.
23
23
  * @example When I run the database query "selectUsersByEmail"
24
24
  */
25
- async function runDbQuery(page, queryKey) {
25
+ async function runDbQuery(_page, queryKey) {
26
26
  const queries = (0, fixtures_1.loadFixture)("queries.json");
27
27
  const query = (0, fixtures_1.getFixtureValue)(queries, queryKey);
28
28
  await state_1.dbState.executeQuery(query);
@@ -46,7 +46,7 @@ async function expectDbRecordCount(page, count) {
46
46
  * Asserts that the database query returned no records (empty result set).
47
47
  * @example Then I expect the database to return no records
48
48
  */
49
- async function expectDbNoRecords(page) {
49
+ async function expectDbNoRecords(_page) {
50
50
  const result = state_1.dbState.getLastResult();
51
51
  if (!Array.isArray(result)) {
52
52
  throw new Error(`Expected array result from database but got: ${typeof result}`);
@@ -219,12 +219,12 @@ async function expectDbColumnType(page, columnNameKey, dataTypeKey) {
219
219
  // ==================================================
220
220
  // GLUE STEPS
221
221
  // ==================================================
222
- (0, registry_1.Step)("I run the database query {string}", runDbQuery, "When");
223
- (0, registry_1.Step)("I expect the database to return {int} record(s)", expectDbRecordCount, "Then");
224
- (0, registry_1.Step)("I expect the database to return no records", expectDbNoRecords, "Then");
225
- (0, registry_1.Step)("I expect the first database record to contain", expectFirstDbRecordToContain, "Then");
226
- (0, registry_1.Step)("I expect database row {int} to contain", expectDbRowToContain, "Then");
227
- (0, registry_1.Step)("I expect all database records to contain", expectAllDbRecordsToContain, "Then");
228
- (0, registry_1.Step)("I expect database column {string} to exist", expectDbColumnExists, "Then");
229
- (0, registry_1.Step)("I expect database column {string} to contain {string}", expectDbColumnContains, "Then");
230
- (0, registry_1.Step)("I expect database column {string} to be of type {string}", expectDbColumnType, "Then");
222
+ (0, registry_1.Step)("I pw run the database query {string}", runDbQuery, "When");
223
+ (0, registry_1.Step)("I pw expect the database to return {int} record(s)", expectDbRecordCount, "Then");
224
+ (0, registry_1.Step)("I pw expect the database to return no records", expectDbNoRecords, "Then");
225
+ (0, registry_1.Step)("I pw expect the first database record to contain", expectFirstDbRecordToContain, "Then");
226
+ (0, registry_1.Step)("I pw expect database row {int} to contain", expectDbRowToContain, "Then");
227
+ (0, registry_1.Step)("I pw expect all database records to contain", expectAllDbRecordsToContain, "Then");
228
+ (0, registry_1.Step)("I pw expect database column {string} to exist", expectDbColumnExists, "Then");
229
+ (0, registry_1.Step)("I pw expect database column {string} to contain {string}", expectDbColumnContains, "Then");
230
+ (0, registry_1.Step)("I pw expect database column {string} to be of type {string}", expectDbColumnType, "Then");
@@ -49,6 +49,6 @@ async function typeAndAcceptPrompt(page, textKey) {
49
49
  // ==================================================
50
50
  // GLUE STEPS
51
51
  // ==================================================
52
- (0, registry_1.Step)("I accept the next dialog", acceptNextDialog, "Given");
53
- (0, registry_1.Step)("I dismiss the next dialog", dismissNextDialog, "Given");
54
- (0, registry_1.Step)("I type {string} into the next prompt and accept", typeAndAcceptPrompt, "Given");
52
+ (0, registry_1.Step)("I pw accept the next dialog", acceptNextDialog, "Given");
53
+ (0, registry_1.Step)("I pw dismiss the next dialog", dismissNextDialog, "Given");
54
+ (0, registry_1.Step)("I pw type {string} into the next prompt and accept", typeAndAcceptPrompt, "Given");
@@ -318,27 +318,29 @@ async function findInputByName(page, name) {
318
318
  // ==================================================
319
319
  // GLUE STEPS
320
320
  // ==================================================
321
- (0, registry_1.Step)("I find element by selector {string}", findElementBySelector, "When");
322
- (0, registry_1.Step)("I find element by text {string}", findElementByText, "When");
323
- (0, registry_1.Step)("I find element by title {string}", findElementByTitle, "When");
324
- (0, registry_1.Step)("I find element by testid {string}", findElementByTestId, "When");
325
- (0, registry_1.Step)("I find element by role {string}", findElementByRole, "When");
326
- (0, registry_1.Step)("I find element by placeholder text {string}", findElementByPlaceholder, "When");
327
- (0, registry_1.Step)("I find element by label text {string}", findElementByLabel, "When");
328
- (0, registry_1.Step)("I find element by alt text {string}", findElementByAltText, "When");
329
- (0, registry_1.Step)("I find link by text {string}", findLinkByText, "When");
330
- (0, registry_1.Step)("I find heading by text {string}", findHeadingByText, "When");
331
- (0, registry_1.Step)("I find element by name {string}", findElementByName, "When");
332
- (0, registry_1.Step)("I find elements by selector {string}", findElementsBySelector, "When");
333
- (0, registry_1.Step)("I find buttons by text {string}", findButtonsByText, "When");
334
- (0, registry_1.Step)("I get first element", getFirstElement, "When");
335
- (0, registry_1.Step)("I get last element", getLastElement, "When");
336
- (0, registry_1.Step)("I get {int}(?:st|nd|rd|th) element", getNthElement, "When");
337
- (0, registry_1.Step)("I store element text as {string}", storeElementText, "When");
338
- (0, registry_1.Step)("I get focused element", getFocusedElement, "When");
339
- (0, registry_1.Step)("I find textarea by label text {string}", findTextareaByLabel, "When");
340
- (0, registry_1.Step)("I find input by display value {string}", findInputByValue, "When");
341
- (0, registry_1.Step)("I find input by placeholder text {string}", findInputByPlaceholder, "When");
342
- (0, registry_1.Step)("I find headings by text {string}", findHeadingsByText, "When");
343
- (0, registry_1.Step)("I find input by ID {string}", findInputById, "When");
344
- (0, registry_1.Step)("I find input by name {string}", findInputByName, "When");
321
+ (0, registry_1.Step)("I pw find element by selector {string}", findElementBySelector, "When");
322
+ (0, registry_1.Step)("I pw get element by selector {string}", findElementBySelector, "When");
323
+ (0, registry_1.Step)("I pw find element by text {string}", findElementByText, "When");
324
+ (0, registry_1.Step)("I pw find element by title {string}", findElementByTitle, "When");
325
+ (0, registry_1.Step)("I pw find element by testid {string}", findElementByTestId, "When");
326
+ (0, registry_1.Step)("I pw find element by role {string}", findElementByRole, "When");
327
+ (0, registry_1.Step)("I pw find element by placeholder text {string}", findElementByPlaceholder, "When");
328
+ (0, registry_1.Step)("I pw find element by label text {string}", findElementByLabel, "When");
329
+ (0, registry_1.Step)("I pw find element by alt text {string}", findElementByAltText, "When");
330
+ (0, registry_1.Step)("I pw find link by text {string}", findLinkByText, "When");
331
+ (0, registry_1.Step)("I pw find heading by text {string}", findHeadingByText, "When");
332
+ (0, registry_1.Step)("I pw find element by name {string}", findElementByName, "When");
333
+ (0, registry_1.Step)("I pw find elements by selector {string}", findElementsBySelector, "When");
334
+ (0, registry_1.Step)("I pw get elements by selector {string}", findElementsBySelector, "When");
335
+ (0, registry_1.Step)("I pw find buttons by text {string}", findButtonsByText, "When");
336
+ (0, registry_1.Step)("I pw get first element", getFirstElement, "When");
337
+ (0, registry_1.Step)("I pw get last element", getLastElement, "When");
338
+ (0, registry_1.Step)("I pw get {int}(?:st|nd|rd|th) element", getNthElement, "When");
339
+ (0, registry_1.Step)("I pw store element text as {string}", storeElementText, "When");
340
+ (0, registry_1.Step)("I pw get focused element", getFocusedElement, "When");
341
+ (0, registry_1.Step)("I pw find textarea by label text {string}", findTextareaByLabel, "When");
342
+ (0, registry_1.Step)("I pw find input by display value {string}", findInputByValue, "When");
343
+ (0, registry_1.Step)("I pw find input by placeholder text {string}", findInputByPlaceholder, "When");
344
+ (0, registry_1.Step)("I pw find headings by text {string}", findHeadingsByText, "When");
345
+ (0, registry_1.Step)("I pw find input by ID {string}", findInputById, "When");
346
+ (0, registry_1.Step)("I pw find input by name {string}", findInputByName, "When");
@@ -100,7 +100,7 @@ async function fileUpload(page, fileNameKey, selectorKey) {
100
100
  // ==================================================
101
101
  // GLUE STEPS
102
102
  // ==================================================
103
- (0, registry_1.Step)("I select option {string} from {string}", selectDropdownOption, "When");
104
- (0, registry_1.Step)("I check {string}", checkInput, "When");
105
- (0, registry_1.Step)("I uncheck {string}", uncheckInput, "When");
106
- (0, registry_1.Step)("I upload file {string} to {string}", fileUpload, "When");
103
+ (0, registry_1.Step)("I pw select option {string} from {string}", selectDropdownOption, "When");
104
+ (0, registry_1.Step)("I pw check {string}", checkInput, "When");
105
+ (0, registry_1.Step)("I pw uncheck {string}", uncheckInput, "When");
106
+ (0, registry_1.Step)("I pw upload file {string} to {string}", fileUpload, "When");
@@ -58,6 +58,6 @@ async function expectTextInsideFrame(page, elementSelectorKey, frameSelectorKey,
58
58
  // ==================================================
59
59
  // GLUE STEPS
60
60
  // ==================================================
61
- (0, registry_1.Step)("I click {string} inside frame {string}", clickInsideFrame, "When");
62
- (0, registry_1.Step)("I fill {string} inside frame {string} with {string}", fillInsideFrame, "When");
63
- (0, registry_1.Step)("I expect {string} inside frame {string} to have text {string}", expectTextInsideFrame, "Then");
61
+ (0, registry_1.Step)("I pw click {string} inside frame {string}", clickInsideFrame, "When");
62
+ (0, registry_1.Step)("I pw fill {string} inside frame {string} with {string}", fillInsideFrame, "When");
63
+ (0, registry_1.Step)("I pw expect {string} inside frame {string} to have text {string}", expectTextInsideFrame, "Then");
@@ -17,7 +17,7 @@ function loadFixture(fileName) {
17
17
  const content = (0, fs_1.readFileSync)(fixturePath, "utf8");
18
18
  return JSON.parse(content);
19
19
  }
20
- catch (error) {
20
+ catch (_error) {
21
21
  // Return empty object for optional fixtures
22
22
  console.warn(`⚠️ Fixture "${fileName}" not found in project root. Proceeding with empty object.`);
23
23
  return {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Resolves a parameter by checking if it's a key in a fixture file.
3
+ * If the fixture doesn't exist or the key isn't found, it returns the raw string.
4
+ */
5
+ export declare function resolveParam(key: string, fixtureFile: string): string;
6
+ //# sourceMappingURL=resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/backend/utils/resolver.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CASrE"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveParam = resolveParam;
4
+ const fixtures_1 = require("./fixtures");
5
+ /**
6
+ * Resolves a parameter by checking if it's a key in a fixture file.
7
+ * If the fixture doesn't exist or the key isn't found, it returns the raw string.
8
+ */
9
+ function resolveParam(key, fixtureFile) {
10
+ try {
11
+ const fixture = (0, fixtures_1.loadFixture)(fixtureFile);
12
+ // getFixtureValue handles the logic of returning the raw key if the value isn't found
13
+ return (0, fixtures_1.getFixtureValue)(fixture, key);
14
+ }
15
+ catch (_error) {
16
+ // If fixture file is missing, fallback to the raw string
17
+ return key;
18
+ }
19
+ }
@@ -0,0 +1,3 @@
1
+ export { runComponentTests } from './runner';
2
+ export type { ComponentRunnerOptions } from './runner';
3
+ //# sourceMappingURL=index.d.ts.map