webship-js 2.0.4 → 2.0.6

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 (211) hide show
  1. package/.drone.yml +0 -0
  2. package/.harness/webship-js-pipeline.yml +0 -0
  3. package/.semaphore/semaphore.yml +0 -0
  4. package/.teamcity/pom.xml +0 -0
  5. package/.teamcity/settings.kts +0 -0
  6. package/.travis.yml +0 -0
  7. package/AGENTS.md +50 -14
  8. package/CLAUDE.md +326 -104
  9. package/Jenkinsfile +0 -0
  10. package/azure-pipelines.yml +0 -0
  11. package/bamboo-specs/bamboo.yml +0 -0
  12. package/bin/init-webship.js +1 -14
  13. package/bin/postinstall.js +0 -0
  14. package/buildspec.yml +0 -0
  15. package/cloudbuild.yaml +0 -0
  16. package/codefresh.yml +0 -0
  17. package/cucumber.js +3 -13
  18. package/docs/00-quick-start.md +0 -0
  19. package/docs/01-getting-started.md +0 -0
  20. package/docs/02-bbr-smart-waits.md +24 -1
  21. package/docs/03-selector-registry.md +0 -0
  22. package/docs/04-step-reference.md +4 -0
  23. package/docs/05-web-first-assertions.md +0 -0
  24. package/docs/06-network-and-dialogs.md +0 -0
  25. package/docs/07-auth-state.md +0 -0
  26. package/docs/08-clock-mocking.md +0 -0
  27. package/docs/09-api-testing.md +0 -0
  28. package/docs/10-accessibility.md +24 -3
  29. package/docs/11-debugging.md +0 -0
  30. package/docs/12-ai-agent-guide.md +0 -0
  31. package/docs/13-faq.md +0 -0
  32. package/docs/14-recipes-cookbook.md +0 -0
  33. package/docs/15-tag-conventions.md +0 -0
  34. package/docs/16-ci-cd.md +0 -0
  35. package/docs/README.md +6 -3
  36. package/docs/advanced-screenshots/then-i-save-fullscreen-screenshot.md +0 -0
  37. package/docs/advanced-screenshots/then-i-save-width-x-height-screenshot.md +0 -0
  38. package/docs/advanced-screenshots/when-i-save-screenshot-name-filename.md +0 -0
  39. package/docs/advanced-screenshots.md +0 -0
  40. package/docs/advanced-selectors.md +0 -0
  41. package/docs/api-step-definitions.md +0 -0
  42. package/docs/global-settings.md +1 -28
  43. package/docs/install-webship-js/ddev-webship-js.md +0 -0
  44. package/docs/install-webship-js.md +0 -1
  45. package/docs/overview.md +0 -1
  46. package/docs/step-definitions/given-i-am-anonymous-user.md +0 -0
  47. package/docs/step-definitions/given-i-am-homepage.md +0 -0
  48. package/docs/step-definitions/given-i-am-specific-page.md +0 -0
  49. package/docs/step-definitions/then-i-should-be.md +0 -0
  50. package/docs/step-definitions/then-i-should-see.md +0 -0
  51. package/docs/step-definitions/then-item-checkbox.md +0 -0
  52. package/docs/step-definitions/then-item-link-should-contain-url.md +0 -0
  53. package/docs/step-definitions/then-item-should-contain.md +0 -0
  54. package/docs/step-definitions/then-radio-button-value-should-be-selected.md +0 -0
  55. package/docs/step-definitions/then-response-status-code-should-be-number.md +0 -0
  56. package/docs/step-definitions/then-value-radio-button-selected.md +0 -0
  57. package/docs/step-definitions/when-i-attach-file-file-name-element.md +0 -0
  58. package/docs/step-definitions/when-i-check-checkbox.md +0 -0
  59. package/docs/step-definitions/when-i-click-link.md +0 -0
  60. package/docs/step-definitions/when-i-click-operation-text-row.md +0 -0
  61. package/docs/step-definitions/when-i-fill.md +0 -0
  62. package/docs/step-definitions/when-i-go-homepage.md +0 -0
  63. package/docs/step-definitions/when-i-go-specific-page.md +0 -0
  64. package/docs/step-definitions/when-i-move-backward-one-page.md +0 -0
  65. package/docs/step-definitions/when-i-move-forward-one-page.md +0 -0
  66. package/docs/step-definitions/when-i-press-button.md +0 -0
  67. package/docs/step-definitions/when-i-reload-page.md +0 -0
  68. package/docs/step-definitions/when-i-scroll.md +0 -0
  69. package/docs/step-definitions/when-i-select-option-select-list.md +0 -0
  70. package/docs/step-definitions/when-i-select-radio-button-value.md +0 -0
  71. package/docs/step-definitions/when-i-uncheck-checkbox.md +0 -0
  72. package/docs/step-definitions/when-i-wait-ajax-finish.md +0 -0
  73. package/docs/step-definitions/when-i-wait.md +0 -0
  74. package/docs/step-definitions.md +0 -0
  75. package/examples/a11y.html +8 -0
  76. package/examples/account.html +0 -0
  77. package/examples/ajax-wait-examples.html +0 -0
  78. package/examples/cookies.html +0 -0
  79. package/examples/date.html +0 -0
  80. package/examples/dynamic-examples.html +0 -0
  81. package/examples/element.html +0 -0
  82. package/examples/field.html +0 -0
  83. package/examples/keyboard.html +0 -0
  84. package/examples/links.html +0 -0
  85. package/examples/modal.html +0 -0
  86. package/examples/never-settles.html +32 -0
  87. package/examples/path.html +0 -0
  88. package/examples/table.html +0 -0
  89. package/examples/test--modal-dialogs.html +0 -0
  90. package/examples/test--when--i-additionally-select.html +0 -0
  91. package/examples/test--when--i-select-radio-button.html +0 -0
  92. package/examples/video-demo.html +0 -0
  93. package/package.json +1 -1
  94. package/playwright.config.ts +0 -0
  95. package/tests/assets/test-document.pdf +0 -0
  96. package/tests/features/a11y.feature +22 -0
  97. package/tests/features/ajax-wait-examples.feature +0 -0
  98. package/tests/features/cookie.feature +0 -0
  99. package/tests/features/date.feature +0 -0
  100. package/tests/features/dynamic-content-examples.feature +0 -0
  101. package/tests/features/element.feature +0 -0
  102. package/tests/features/field.feature +0 -0
  103. package/tests/features/keyboard.feature +0 -0
  104. package/tests/features/link.feature +0 -0
  105. package/tests/features/modal-advanced-example.feature +0 -0
  106. package/tests/features/modal-basic-example.feature +0 -0
  107. package/tests/features/modal-error-handling-example.feature +0 -0
  108. package/tests/features/modal.feature +0 -0
  109. package/tests/features/path.feature +0 -0
  110. package/tests/features/response.feature +0 -0
  111. package/tests/features/responsive.feature +0 -0
  112. package/tests/features/smart-settle-budget.feature +12 -0
  113. package/tests/features/table.feature +0 -0
  114. package/tests/features/test--given--i-am-an-anonymous-user.feature +0 -0
  115. package/tests/features/test--then--i-save-screenshot.feature +0 -0
  116. package/tests/features/test--then--i-see-locator.feature +0 -0
  117. package/tests/features/test--then--i-should-see-n-elements.feature +0 -0
  118. package/tests/features/test--then--print-current-url-and-response.feature +0 -0
  119. package/tests/features/test--when--i-additionally-select.feature +0 -0
  120. package/tests/features/test--when--i-follow.feature +0 -0
  121. package/tests/features/test--when--i-select-radio-button.feature +0 -0
  122. package/tests/features/video.feature +0 -0
  123. package/tests/features/wait.feature +0 -0
  124. package/tests/features/yaml.feature +0 -0
  125. package/tests/reports/README.md +0 -0
  126. package/tests/selectors/_canonical-keys.json +0 -0
  127. package/tests/selectors/back-end-selectors.json +0 -0
  128. package/tests/selectors/cms-contentful-admin.json +0 -0
  129. package/tests/selectors/cms-craft-admin.json +0 -0
  130. package/tests/selectors/cms-drupal-cms-gin.json +0 -0
  131. package/tests/selectors/cms-drupal-core-claro.json +0 -0
  132. package/tests/selectors/cms-generic-admin.json +0 -0
  133. package/tests/selectors/cms-ghost-admin.json +0 -0
  134. package/tests/selectors/cms-joomla-admin.json +0 -0
  135. package/tests/selectors/cms-magento2-admin.json +0 -0
  136. package/tests/selectors/cms-prestashop-admin.json +0 -0
  137. package/tests/selectors/cms-shopify-admin.json +0 -0
  138. package/tests/selectors/cms-strapi-admin.json +0 -0
  139. package/tests/selectors/cms-typo3-admin.json +0 -0
  140. package/tests/selectors/cms-woocommerce-front.json +0 -0
  141. package/tests/selectors/cms-wordpress-admin.json +0 -0
  142. package/tests/selectors/framework-ant-design.json +0 -0
  143. package/tests/selectors/framework-bootstrap.json +0 -0
  144. package/tests/selectors/framework-bulma.json +0 -0
  145. package/tests/selectors/framework-chakra.json +0 -0
  146. package/tests/selectors/framework-foundation.json +0 -0
  147. package/tests/selectors/framework-material-ui.json +0 -0
  148. package/tests/selectors/framework-shadcn.json +0 -0
  149. package/tests/selectors/framework-tailwind.json +0 -0
  150. package/tests/selectors/framework-vuetify.json +0 -0
  151. package/tests/selectors/front-end-selectors.json +0 -0
  152. package/tests/selectors/homepage-selectors.json +0 -0
  153. package/tests/step-definitions/a11y.steps.js +339 -113
  154. package/tests/step-definitions/action.steps.js +0 -0
  155. package/tests/step-definitions/assertion.steps.js +0 -0
  156. package/tests/step-definitions/auth.steps.js +0 -0
  157. package/tests/step-definitions/clock.steps.js +0 -0
  158. package/tests/step-definitions/cookie.steps.js +0 -0
  159. package/tests/step-definitions/debug.steps.js +0 -0
  160. package/tests/step-definitions/dialog.steps.js +0 -0
  161. package/tests/step-definitions/element.steps.js +0 -0
  162. package/tests/step-definitions/field.steps.js +0 -0
  163. package/tests/step-definitions/file-download.steps.js +0 -0
  164. package/tests/step-definitions/form.steps.js +0 -0
  165. package/tests/step-definitions/iframe.steps.js +0 -0
  166. package/tests/step-definitions/input.steps.js +0 -0
  167. package/tests/step-definitions/javascript.steps.js +0 -0
  168. package/tests/step-definitions/keyboard.steps.js +0 -0
  169. package/tests/step-definitions/link.steps.js +0 -0
  170. package/tests/step-definitions/metatag.steps.js +0 -0
  171. package/tests/step-definitions/modal.steps.js +0 -0
  172. package/tests/step-definitions/navigation.steps.js +0 -0
  173. package/tests/step-definitions/network.steps.js +0 -0
  174. package/tests/step-definitions/path.steps.js +0 -0
  175. package/tests/step-definitions/response.steps.js +0 -0
  176. package/tests/step-definitions/responsive.steps.js +0 -0
  177. package/tests/step-definitions/rest.steps.js +0 -0
  178. package/tests/step-definitions/screenshot.steps.js +0 -0
  179. package/tests/step-definitions/scroll.steps.js +0 -0
  180. package/tests/step-definitions/selectors.steps.js +0 -0
  181. package/tests/step-definitions/storage.steps.js +0 -0
  182. package/tests/step-definitions/table.steps.js +0 -0
  183. package/tests/step-definitions/video.steps.js +0 -0
  184. package/tests/step-definitions/wait.steps.js +0 -0
  185. package/tests/step-definitions/web-first.steps.js +0 -0
  186. package/tests/step-definitions/webship.js +57 -20
  187. package/tests/step-definitions/xml.steps.js +0 -0
  188. package/tests/step-definitions/yaml.steps.js +0 -0
  189. package/tsconfig.json +0 -0
  190. package/videos/README.md +0 -0
  191. package/docs/diffy-step-definitions/then-compare-diffy-env1-env2.md +0 -30
  192. package/docs/diffy-step-definitions/then-create-diffy-comparison-name-value.md +0 -21
  193. package/docs/diffy-step-definitions/then-create-diffy-comparison.md +0 -25
  194. package/docs/diffy-step-definitions/then-create-diffy-screenshot-environment-name.md +0 -35
  195. package/docs/diffy-step-definitions/then-i-take-screenshot.md +0 -21
  196. package/docs/diffy-step-definitions/then-i-take-screenshots-all-breakpoints.md +0 -27
  197. package/docs/diffy-step-definitions/then-send-screenshots-diffy-name-value.md +0 -27
  198. package/docs/diffy-step-definitions/then-upload-folder-url-diffy-snapshotname.md +0 -28
  199. package/docs/diffy-step-definitions/then-wait-diffy-comparison-complete.md +0 -21
  200. package/docs/diffy-step-definitions/when-i-resize-window-number.md +0 -29
  201. package/docs/diffy-step-definitions.md +0 -21
  202. package/examples/diffy/baseline.html +0 -54
  203. package/examples/diffy/changed.html +0 -63
  204. package/examples/diffy/index.html +0 -52
  205. package/tests/features/diffy/test--diffy-01-example-demo.feature +0 -22
  206. package/tests/features/diffy/test--diffy-02-all-steps.feature +0 -52
  207. package/tests/features/diffy/test--diffy-03-real-api.feature +0 -21
  208. package/tests/step-definitions-diffy/README.md +0 -329
  209. package/tests/step-definitions-diffy/mock-diffy-api/server.js +0 -84
  210. package/tests/step-definitions-diffy/webship-diffy-mock.js +0 -31
  211. package/tests/step-definitions-diffy/webship-diffy.js +0 -459
package/cucumber.js CHANGED
@@ -3,7 +3,9 @@ module.exports = {
3
3
  // Cucumber step timeout must exceed Playwright's default 30s so the
4
4
  // try/catch wrappers in step files always see the Playwright error
5
5
  // first (and emit a friendly message) rather than cucumber's raw
6
- // "function timed out" stack.
6
+ // "function timed out" stack. The step definitions call
7
+ // setDefaultTimeout() on load, which wins over this value — raise it
8
+ // with WEBSHIP_STEP_TIMEOUT instead.
7
9
  timeout: 45000,
8
10
  // tsx/cjs registers a require() hook so cucumber-js can load both
9
11
  // `.js` and `.ts` step files with zero build step. If you ship only
@@ -11,7 +13,6 @@ module.exports = {
11
13
  requireModule: ['tsx/cjs'],
12
14
  require: [
13
15
  'tests/step-definitions/**/*.js',
14
- 'tests/step-definitions-diffy/**/*.js',
15
16
  ],
16
17
  paths: ['tests/features/**/*.feature'],
17
18
  format: [
@@ -121,17 +122,6 @@ module.exports = {
121
122
  // Report collected errors at scenario end (default true).
122
123
  afterScenario: true, // WEBSHIP_JS_ERROR_AFTER
123
124
  },
124
- diffy: {
125
- apiKey: 'mock-key', // DIFFY_API_KEY
126
- projectId: 1, // DIFFY_PROJECT_ID
127
- breakpoints: '640,1200', // DIFFY_BREAKPOINTS
128
- windowHeight: 2000, // DIFFY_WINDOW_HEIGHT
129
- screenshotsDir: '', // DIFFY_SCREENSHOTS_DIR
130
- baseUrl: 'http://127.0.0.1:3099/', // DIFFY_API_BASE_URL (mock server)
131
- maxWait: 30, // DIFFY_MAX_WAIT (seconds)
132
- env1Url: '', // DIFFY_ENV1_URL (custom env)
133
- env2Url: '', // DIFFY_ENV2_URL (custom env)
134
- },
135
125
  },
136
126
  },
137
127
  };
File without changes
File without changes
@@ -21,7 +21,30 @@ __webshipAjaxCount === 0
21
21
  && (Date.now() - __webshipLastMutation) >= 250 ms
22
22
  ```
23
23
 
24
- …or when `budget` elapses, whichever comes first. Each phase is best-effort, so a slow network does not stall the others.
24
+ …or when `budget` elapses, whichever comes first.
25
+
26
+ ### How the budget is shared
27
+
28
+ Each phase is best-effort — a phase that times out is not a failure — and each
29
+ gets a **share of the budget** rather than "whatever is left":
30
+
31
+ | Phase | Share of the budget |
32
+ | --- | --- |
33
+ | `<body>` attached | 25% |
34
+ | `DOMContentLoaded` | 25% |
35
+ | `networkidle` | 50% |
36
+ | AJAX + pending timers + DOM quiet | 50% |
37
+
38
+ The shares add up to more than 100% on purpose: a phase that finishes early
39
+ hands its unspent time to the ones after it, and no phase is ever given more
40
+ than what is actually left. Capping `networkidle` matters, because on a page
41
+ with analytics, a chat widget or a self-rescheduling timer it never arrives —
42
+ uncapped it would eat the whole budget and starve the AJAX / pending-timer /
43
+ DOM-quiet probe, which is the phase that decides the answer.
44
+
45
+ `smartSettle` returns within `budget` even when nothing on the page ever
46
+ settles, and never hands Playwright a zero timeout (Playwright reads `0` as
47
+ "no timeout at all").
25
48
 
26
49
  ## Step phrasings
27
50
 
File without changes
@@ -302,11 +302,15 @@ This index lists every public step grouped by source file, with one Gherkin exam
302
302
  - *^user zoom should be allowed$* · Example: `Then user zoom should be allowed`
303
303
  - *^the page should pass an accessibility audit(?: at level "(A|AA|AAA)")?$* · Example: `Then the page should pass an accessibility audit`
304
304
  - *^the page should have no (critical|serious|moderate|minor) accessibility violations$* · Example: `Then the page should have no critical accessibility violations`
305
+ - *^the page should have no accessibility violations$* · Example: `Then the page should have no accessibility violations`
306
+ - *^the element "([^"]*)" should not violate the accessibility rule "([^"]*)"$* · Example: `Then the element "main" should not violate the accessibility rule "color-contrast"`
305
307
  - *^the element "([^"]*)" should pass an accessibility audit$* · Example: `Then the element "main" should pass an accessibility audit`
306
308
  - *^the page should pass an accessibility audit excluding "([^"]*)"$* · Example: `Then the page should pass an accessibility audit excluding "iframe.payment"`
307
309
  - *^the page should not violate the accessibility rule "([^"]*)"$* · Example: `Then the page should not violate the accessibility rule "color-contrast"`
308
310
  - *^(I |we )*print accessibility violations$* · Example: `Then I print accessibility violations`
309
311
  - *^the page should pass the accessibility rules "([^"]*)"$* · Example: `Then the page should pass the accessibility rules "image-alt, label"`
312
+ - *^the page should pass the full accessibility check(?: at level "(A|AA|AAA)")?$* · Example: `Then the page should pass the full accessibility check`
313
+ - *^(?:I |we )*print the full accessibility check$* · Example: `Then I print the full accessibility check`
310
314
 
311
315
  ### action.steps.js
312
316
 
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -38,7 +38,9 @@ Then every image should have an alt attribute
38
38
  And every form field should have an accessible label
39
39
  ```
40
40
 
41
- `every image` allows empty `alt=""` (decorative) and `role="presentation"`. Missing alt fails.
41
+ `every image` allows empty `alt=""` (decorative), `role="presentation"` or `role="none"`, and an `aria-label`, `aria-labelledby` or `title`. Missing alt fails.
42
+
43
+ Every probe skips what assistive technology cannot reach: anything under `aria-hidden="true"`, `inert` or `hidden`, and anything with `display: none` or `visibility: hidden`. axe does the same, so a closed menu or an overlay scrim no longer fails a probe that axe passes.
42
44
 
43
45
  `every form field` counts as labelled when **any** of the following is true:
44
46
  - An `aria-label` attribute is present
@@ -119,6 +121,20 @@ Then the page should have a title
119
121
  | `user zoom should be allowed` | 1.4.4, 1.4.10 |
120
122
  | `required fields should be consistently marked` | 3.3.2 |
121
123
 
124
+ ## The full check, in one step
125
+
126
+ ```gherkin
127
+ Then the page should pass the full accessibility check
128
+ And the page should pass the full accessibility check at level "A"
129
+ Then I print the full accessibility check
130
+ ```
131
+
132
+ One step runs axe at the level (AA by default) and every structural probe in this file in a single pass: image alt, button and link names, field labels, iframe titles, positive tabindex, unresolved ARIA references, one h1, skipped heading levels, empty headings, main and navigation landmarks, page language, page title, zoom, and navigation landmarks sharing one name.
133
+
134
+ It reports every failure at once, not the first. A finding axe already named is not repeated by the probe that covers the same thing. The print form reports without failing, which is the way to see where a page stands before choosing a gate.
135
+
136
+ The skip link, focus, ARIA role and required-field steps are not part of it. Add them beside it when you need them.
137
+
122
138
  ## axe-core full audit
123
139
 
124
140
  ```gherkin
@@ -127,13 +143,17 @@ Then the page should pass an accessibility audit
127
143
  And the page should pass an accessibility audit at level "AAA"
128
144
  And the page should have no critical accessibility violations
129
145
  And the page should have no serious accessibility violations
146
+ And the page should have no accessibility violations
130
147
  And the element "main" should pass an accessibility audit
148
+ And the element "main" should not violate the accessibility rule "color-contrast"
131
149
  And the page should pass an accessibility audit excluding "iframe.payment"
132
150
  And the page should not violate the accessibility rule "color-contrast"
133
151
  And the page should pass the accessibility rules "image-alt, label, button-name"
134
152
  Then I print accessibility violations
135
153
  ```
136
154
 
155
+ The impact gate is a ladder. `no serious accessibility violations` fails on a serious **or** a critical violation, and `no minor` fails on any. Earlier releases matched each gate to its own level only, so a page with a critical violation passed the serious gate. A suite that gated on serious alone gets stricter on upgrade. `no accessibility violations` fails on any impact.
156
+
137
157
  Default audit level is **AA** — required by EU Web Accessibility
138
158
  Directive, US Section 508, UK PSBAR. Use `at level "AAA"` for stricter
139
159
  gates.
@@ -159,9 +179,10 @@ For an admin / authenticated UI where some third-party widgets are
159
179
  known-bad, gate on the impact-based step instead:
160
180
 
161
181
  ```gherkin
162
- Then the page should have no critical accessibility violations
163
- And the page should have no serious accessibility violations
182
+ Then the page should have no serious accessibility violations
164
183
  ```
165
184
 
185
+ One serious gate now covers critical too.
186
+
166
187
  Tag scenarios `@a11y` so CI can run the accessibility suite in
167
188
  isolation: `npx cucumber-js --tags "@a11y"`.
File without changes
File without changes
package/docs/13-faq.md CHANGED
File without changes
File without changes
File without changes
package/docs/16-ci-cd.md CHANGED
File without changes
package/docs/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Webship-js is a BDD-first browser-automation harness built on Playwright + Cucumber-js. Feature files in plain Gherkin; selectors that survive redesigns; smart waits that never sleep.
4
4
 
5
- **411 built-in steps** across **36 step files**. **288 example scenarios / 1,406 step executions** in the bundled suite, all green on chromium, firefox, and webkit.
5
+ **417 built-in steps** across **36 step files**. **288 example scenarios / 1,406 step executions** in the bundled suite, all green on chromium, firefox, and webkit.
6
6
 
7
7
  ## Reading order
8
8
 
@@ -42,7 +42,10 @@ Webship-js is a BDD-first browser-automation harness built on Playwright + Cucum
42
42
  | [API step definitions](api-step-definitions.md) | REST step definitions |
43
43
  | [Advanced screenshots](advanced-screenshots.md) | Per-size, full-page, named (3 sub-pages under `advanced-screenshots/`) |
44
44
  | [Advanced selectors](advanced-selectors.md) | Named selector registry, position assertions |
45
- | [Diffy step definitions](diffy-step-definitions.md) | Visual-diff workflow (10 sub-pages under `diffy-step-definitions/`) |
45
+
46
+ > **Visual regression moved out.** The Diffy step-pack now ships as its own
47
+ > plugin, [`diffy-steps`](https://github.com/webship/diffy-steps) — install it
48
+ > alongside webship-js and add its step-definition path to `cucumber.js`.
46
49
 
47
50
  ## At a glance
48
51
 
@@ -71,7 +74,7 @@ webship-js/
71
74
  │ ├── selectors/ <— CMS / framework JSON presets
72
75
  │ └── step-definitions/ <— Built-in steps (auto-loaded)
73
76
  │ ├── webship.js # World setup, hooks, shared helpers (smartSettle, modal, selectors, date tokens)
74
- │ ├── a11y.steps.js (26) # axe-core audits + WCAG hygiene probes
77
+ │ ├── a11y.steps.js (30) # axe-core audits + WCAG hygiene probes
75
78
  │ ├── action.steps.js (7) # press / click / follow / attach
76
79
  │ ├── api.steps.js (22) # REST long form (base URL, headers, query, body, JSON Pointer)
77
80
  │ ├── assertion.steps.js (14) # see / not see, in row, in element, response, count
File without changes
File without changes
File without changes
@@ -187,34 +187,6 @@ Tags override `mode` per scenario:
187
187
 
188
188
  The explicit step `Then there should be no JavaScript errors` always asserts (independent of mode).
189
189
 
190
- ### `diffy` — visual-diff integration (optional)
191
-
192
- ```js
193
- diffy: {
194
- apiKey: 'mock-key',
195
- projectId: 1,
196
- breakpoints: '640,1200',
197
- windowHeight: 2000,
198
- screenshotsDir: '',
199
- baseUrl: 'http://127.0.0.1:3099/',
200
- maxWait: 30,
201
- env1Url: '',
202
- env2Url: '',
203
- }
204
- ```
205
-
206
- | Key | Default | Env override |
207
- | --- | --- | --- |
208
- | `apiKey` | `mock-key` | `DIFFY_API_KEY` |
209
- | `projectId` | `1` | `DIFFY_PROJECT_ID` |
210
- | `breakpoints` | `640,1200` | `DIFFY_BREAKPOINTS` |
211
- | `windowHeight` | `2000` | `DIFFY_WINDOW_HEIGHT` |
212
- | `screenshotsDir` | `''` | `DIFFY_SCREENSHOTS_DIR` |
213
- | `baseUrl` | mock server | `DIFFY_API_BASE_URL` |
214
- | `maxWait` | `30` (seconds) | `DIFFY_MAX_WAIT` |
215
- | `env1Url` | `''` | `DIFFY_ENV1_URL` |
216
- | `env2Url` | `''` | `DIFFY_ENV2_URL` |
217
-
218
190
  ---
219
191
 
220
192
  ## `playwright.config.ts` — browser launch
@@ -250,6 +222,7 @@ const config = {
250
222
  | Env var | Effect |
251
223
  | --- | --- |
252
224
  | `WEBSHIP_AUTO_SETTLE` | Set to `off` to disable the BBR auto-settle hook (`smartSettle(page, 1500)` after every state-changing step). |
225
+ | `WEBSHIP_STEP_TIMEOUT` | Cucumber step timeout in milliseconds. Defaults to `45000`. webship-js calls `setDefaultTimeout()` when its step definitions load, which overrides a `timeout` set in your own `cucumber.js`, so raise it here instead. |
253
226
  | `WEBSHIP_REPORT_DISABLE` | Set to `1` to skip auto-generating the HTML report on cucumber-js process exit. |
254
227
  | `WEBSHIP_REPORT_ARGS` | Extra CLI flags forwarded to `bin/generate-reports.js`. e.g. `--theme hierarchy --layout 2`. |
255
228
 
File without changes
@@ -28,7 +28,6 @@ The page is part of the Webship JS 2.0.x documentation section, which includes:
28
28
  - API Step Definitions
29
29
  - Advanced Screenshots
30
30
  - Advanced Selectors
31
- - Diffy Step Definitions
32
31
  - Assertions
33
32
  - Commands
34
33
 
package/docs/overview.md CHANGED
@@ -36,6 +36,5 @@ Webship-js offers "increased testing efficiency, reduced human error, improved t
36
36
  - [API Step Definitions](/docs/webship-js/2.0.x/api-step-definitions)
37
37
  - [Advanced Screenshots](/docs/webship-js/2.0.x/advanced-screenshots)
38
38
  - [Advanced Selectors](/docs/webship-js/2.0.x/advanced-selectors)
39
- - [Diffy Step Definitions](/docs/webship-js/2.0.x/diffy-step-definitions)
40
39
  - [Assertions](/docs/webship-js/2.0.x/assertions)
41
40
  - [Commands](/docs/webship-js/2.0.x/commands)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -26,6 +26,14 @@
26
26
  <button type="submit">Submit</button>
27
27
  </form>
28
28
  </main>
29
+ <!-- Hidden from assistive technology: a closed overlay. Nothing in here is
30
+ reachable, so no accessibility probe should report it. -->
31
+ <div class="scrim" aria-hidden="true" style="display:none">
32
+ <button type="button" tabindex="-1"></button>
33
+ <a href="/closed"></a>
34
+ <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">
35
+ <input type="text" name="scrim-field">
36
+ </div>
29
37
  <footer><small>&copy; 2026</small></footer>
30
38
  </body>
31
39
  </html>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Never Settles</title>
6
+ </head>
7
+ <body>
8
+ <h1 id="page-title">Never Settles</h1>
9
+
10
+ <p id="intro">
11
+ This fixture never reaches network idle and never drains its timers, the way a
12
+ production page with analytics, a chat widget or a carousel behaves.
13
+ </p>
14
+
15
+ <p>Beat: <span id="beat">0</span></p>
16
+
17
+ <script>
18
+ // A request every 120ms: Playwright's "networkidle" needs 500ms with no
19
+ // in-flight network, so this page never reaches it.
20
+ // A self-rescheduling setTimeout: window.__webshipPendingTimers can
21
+ // therefore never fall back to 0 either.
22
+ var beat = 0;
23
+ function tick() {
24
+ beat++;
25
+ document.getElementById('beat').textContent = String(beat);
26
+ fetch('example-api.json?beat=' + beat, { cache: 'no-store' }).catch(function () {});
27
+ setTimeout(tick, 120);
28
+ }
29
+ setTimeout(tick, 120);
30
+ </script>
31
+ </body>
32
+ </html>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webship-js",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Webship JS automated functional testing.",
5
5
  "main": "index.js",
6
6
  "bin": {
File without changes
File without changes
@@ -37,3 +37,25 @@ Feature: Accessibility (a11y) smoke checks
37
37
  And the page should not violate the accessibility rule "image-alt"
38
38
  And the page should not violate the accessibility rule "label"
39
39
  And the page should pass the accessibility rules "image-alt, label, button-name"
40
+
41
+ Scenario: Elements hidden from assistive technology are out of scope
42
+ Given I am on "/a11y.html"
43
+ Then every button should have an accessible name
44
+ And every link should have an accessible name
45
+ And every image should have an alt attribute
46
+ And every form field should have an accessible label
47
+
48
+ Scenario: The impact gate covers everything worse than the level named
49
+ Given I am on "/a11y.html"
50
+ Then the page should have no minor accessibility violations
51
+ And the page should have no moderate accessibility violations
52
+ And the page should have no serious accessibility violations
53
+ And the page should have no critical accessibility violations
54
+ And the page should have no accessibility violations
55
+
56
+ Scenario: One step for the whole page
57
+ Given I am on "/a11y.html"
58
+ Then the page should pass the full accessibility check
59
+ And the page should pass the full accessibility check at level "AA"
60
+ And the element "main" should not violate the accessibility rule "image-alt"
61
+ And I print the full accessibility check
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ Feature: Smart wait stays inside its budget
2
+
3
+ A page with analytics, a chat widget or a self-rescheduling timer never
4
+ reaches network idle and never drains its pending timers. The smart wait has
5
+ to spend its budget and hand control back, rather than block until cucumber
6
+ kills the step.
7
+
8
+ Scenario: A page that never settles does not stall the run
9
+ Given I am on "/never-settles.html"
10
+ Then I should see "Never Settles"
11
+ When I wait until the page is loaded
12
+ Then I should see "Never Settles"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes