webship-js 2.0.3 → 2.0.5

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 (213) hide show
  1. package/.circleci/config.yml +7 -31
  2. package/.drone.yml +68 -0
  3. package/.harness/webship-js-pipeline.yml +101 -0
  4. package/.semaphore/semaphore.yml +58 -0
  5. package/.teamcity/pom.xml +52 -0
  6. package/.teamcity/settings.kts +92 -0
  7. package/.travis.yml +24 -3
  8. package/AGENTS.md +53 -17
  9. package/CLAUDE.md +327 -105
  10. package/Jenkinsfile +54 -0
  11. package/azure-pipelines.yml +82 -0
  12. package/bamboo-specs/bamboo.yml +131 -0
  13. package/bin/init-webship.js +0 -13
  14. package/bin/postinstall.js +0 -0
  15. package/buildspec.yml +56 -0
  16. package/cloudbuild.yaml +49 -0
  17. package/codefresh.yml +77 -0
  18. package/cucumber.js +39 -14
  19. package/docs/00-quick-start.md +0 -0
  20. package/docs/01-getting-started.md +0 -0
  21. package/docs/02-bbr-smart-waits.md +0 -0
  22. package/docs/03-selector-registry.md +0 -0
  23. package/docs/04-step-reference.md +74 -3
  24. package/docs/05-web-first-assertions.md +0 -0
  25. package/docs/06-network-and-dialogs.md +0 -0
  26. package/docs/07-auth-state.md +0 -0
  27. package/docs/08-clock-mocking.md +0 -0
  28. package/docs/09-api-testing.md +0 -0
  29. package/docs/10-accessibility.md +0 -0
  30. package/docs/11-debugging.md +0 -0
  31. package/docs/12-ai-agent-guide.md +0 -0
  32. package/docs/13-faq.md +0 -0
  33. package/docs/14-recipes-cookbook.md +0 -0
  34. package/docs/15-tag-conventions.md +0 -0
  35. package/docs/16-ci-cd.md +879 -0
  36. package/docs/README.md +116 -0
  37. package/docs/advanced-screenshots/then-i-save-fullscreen-screenshot.md +0 -0
  38. package/docs/advanced-screenshots/then-i-save-width-x-height-screenshot.md +0 -0
  39. package/docs/advanced-screenshots/when-i-save-screenshot-name-filename.md +0 -0
  40. package/docs/advanced-screenshots.md +0 -0
  41. package/docs/advanced-selectors.md +0 -0
  42. package/docs/api-step-definitions.md +0 -0
  43. package/docs/global-settings.md +45 -22
  44. package/docs/install-webship-js/ddev-webship-js.md +0 -0
  45. package/docs/install-webship-js.md +0 -1
  46. package/docs/overview.md +0 -1
  47. package/docs/step-definitions/given-i-am-anonymous-user.md +0 -0
  48. package/docs/step-definitions/given-i-am-homepage.md +0 -0
  49. package/docs/step-definitions/given-i-am-specific-page.md +0 -0
  50. package/docs/step-definitions/then-i-should-be.md +0 -0
  51. package/docs/step-definitions/then-i-should-see.md +0 -0
  52. package/docs/step-definitions/then-item-checkbox.md +0 -0
  53. package/docs/step-definitions/then-item-link-should-contain-url.md +0 -0
  54. package/docs/step-definitions/then-item-should-contain.md +0 -0
  55. package/docs/step-definitions/then-radio-button-value-should-be-selected.md +0 -0
  56. package/docs/step-definitions/then-response-status-code-should-be-number.md +0 -0
  57. package/docs/step-definitions/then-value-radio-button-selected.md +0 -0
  58. package/docs/step-definitions/when-i-attach-file-file-name-element.md +0 -0
  59. package/docs/step-definitions/when-i-check-checkbox.md +0 -0
  60. package/docs/step-definitions/when-i-click-link.md +0 -0
  61. package/docs/step-definitions/when-i-click-operation-text-row.md +0 -0
  62. package/docs/step-definitions/when-i-fill.md +0 -0
  63. package/docs/step-definitions/when-i-go-homepage.md +0 -0
  64. package/docs/step-definitions/when-i-go-specific-page.md +0 -0
  65. package/docs/step-definitions/when-i-move-backward-one-page.md +0 -0
  66. package/docs/step-definitions/when-i-move-forward-one-page.md +0 -0
  67. package/docs/step-definitions/when-i-press-button.md +0 -0
  68. package/docs/step-definitions/when-i-reload-page.md +0 -0
  69. package/docs/step-definitions/when-i-scroll.md +0 -0
  70. package/docs/step-definitions/when-i-select-option-select-list.md +0 -0
  71. package/docs/step-definitions/when-i-select-radio-button-value.md +0 -0
  72. package/docs/step-definitions/when-i-uncheck-checkbox.md +0 -0
  73. package/docs/step-definitions/when-i-wait-ajax-finish.md +0 -0
  74. package/docs/step-definitions/when-i-wait.md +0 -0
  75. package/docs/step-definitions.md +0 -0
  76. package/examples/a11y.html +0 -0
  77. package/examples/account.html +0 -0
  78. package/examples/ajax-wait-examples.html +0 -0
  79. package/examples/cookies.html +0 -0
  80. package/examples/date.html +0 -0
  81. package/examples/dynamic-examples.html +0 -0
  82. package/examples/element.html +0 -0
  83. package/examples/field.html +0 -0
  84. package/examples/keyboard.html +0 -0
  85. package/examples/links.html +0 -0
  86. package/examples/modal.html +0 -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 +43 -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 +0 -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/table.feature +0 -0
  113. package/tests/features/test--given--i-am-an-anonymous-user.feature +0 -0
  114. package/tests/features/test--then--i-save-screenshot.feature +0 -0
  115. package/tests/features/test--then--i-see-locator.feature +0 -0
  116. package/tests/features/test--then--i-should-see-n-elements.feature +0 -0
  117. package/tests/features/test--then--print-current-url-and-response.feature +0 -0
  118. package/tests/features/test--when--i-additionally-select.feature +0 -0
  119. package/tests/features/test--when--i-follow.feature +0 -0
  120. package/tests/features/test--when--i-select-radio-button.feature +0 -0
  121. package/tests/features/video.feature +18 -0
  122. package/tests/features/wait.feature +0 -0
  123. package/tests/features/yaml.feature +0 -0
  124. package/tests/reports/README.md +0 -0
  125. package/tests/selectors/_canonical-keys.json +0 -0
  126. package/tests/selectors/back-end-selectors.json +0 -0
  127. package/tests/selectors/cms-contentful-admin.json +0 -0
  128. package/tests/selectors/cms-craft-admin.json +0 -0
  129. package/tests/selectors/cms-drupal-cms-gin.json +0 -0
  130. package/tests/selectors/cms-drupal-core-claro.json +0 -0
  131. package/tests/selectors/cms-generic-admin.json +0 -0
  132. package/tests/selectors/cms-ghost-admin.json +0 -0
  133. package/tests/selectors/cms-joomla-admin.json +0 -0
  134. package/tests/selectors/cms-magento2-admin.json +0 -0
  135. package/tests/selectors/cms-prestashop-admin.json +0 -0
  136. package/tests/selectors/cms-shopify-admin.json +0 -0
  137. package/tests/selectors/cms-strapi-admin.json +0 -0
  138. package/tests/selectors/cms-typo3-admin.json +0 -0
  139. package/tests/selectors/cms-woocommerce-front.json +0 -0
  140. package/tests/selectors/cms-wordpress-admin.json +0 -0
  141. package/tests/selectors/framework-ant-design.json +0 -0
  142. package/tests/selectors/framework-bootstrap.json +0 -0
  143. package/tests/selectors/framework-bulma.json +0 -0
  144. package/tests/selectors/framework-chakra.json +0 -0
  145. package/tests/selectors/framework-foundation.json +0 -0
  146. package/tests/selectors/framework-material-ui.json +0 -0
  147. package/tests/selectors/framework-shadcn.json +0 -0
  148. package/tests/selectors/framework-tailwind.json +0 -0
  149. package/tests/selectors/framework-vuetify.json +0 -0
  150. package/tests/selectors/front-end-selectors.json +0 -0
  151. package/tests/selectors/homepage-selectors.json +0 -0
  152. package/tests/step-definitions/a11y.steps.js +3 -1
  153. package/tests/step-definitions/action.steps.js +2 -2
  154. package/tests/step-definitions/api.steps.js +17 -16
  155. package/tests/step-definitions/assertion.steps.js +2 -2
  156. package/tests/step-definitions/auth.steps.js +3 -1
  157. package/tests/step-definitions/clock.steps.js +38 -38
  158. package/tests/step-definitions/cookie.steps.js +0 -0
  159. package/tests/step-definitions/debug.steps.js +13 -5
  160. package/tests/step-definitions/dialog.steps.js +0 -0
  161. package/tests/step-definitions/element.steps.js +47 -5
  162. package/tests/step-definitions/field.steps.js +0 -0
  163. package/tests/step-definitions/file-download.steps.js +38 -20
  164. package/tests/step-definitions/form.steps.js +6 -6
  165. package/tests/step-definitions/iframe.steps.js +65 -15
  166. package/tests/step-definitions/input.steps.js +47 -8
  167. package/tests/step-definitions/javascript.steps.js +195 -34
  168. package/tests/step-definitions/keyboard.steps.js +38 -4
  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 +39 -14
  172. package/tests/step-definitions/navigation.steps.js +0 -0
  173. package/tests/step-definitions/network.steps.js +61 -19
  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 +3 -1
  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 +19 -17
  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 +178 -0
  184. package/tests/step-definitions/wait.steps.js +0 -0
  185. package/tests/step-definitions/web-first.steps.js +3 -1
  186. package/tests/step-definitions/webship.js +234 -15
  187. package/tests/step-definitions/xml.steps.js +4 -2
  188. package/tests/step-definitions/yaml.steps.js +13 -11
  189. package/tsconfig.json +0 -0
  190. package/videos/README.md +32 -0
  191. package/.travis-ci.yml +0 -16
  192. package/docs/diffy-step-definitions/then-compare-diffy-env1-env2.md +0 -30
  193. package/docs/diffy-step-definitions/then-create-diffy-comparison-name-value.md +0 -21
  194. package/docs/diffy-step-definitions/then-create-diffy-comparison.md +0 -25
  195. package/docs/diffy-step-definitions/then-create-diffy-screenshot-environment-name.md +0 -35
  196. package/docs/diffy-step-definitions/then-i-take-screenshot.md +0 -21
  197. package/docs/diffy-step-definitions/then-i-take-screenshots-all-breakpoints.md +0 -27
  198. package/docs/diffy-step-definitions/then-send-screenshots-diffy-name-value.md +0 -27
  199. package/docs/diffy-step-definitions/then-upload-folder-url-diffy-snapshotname.md +0 -28
  200. package/docs/diffy-step-definitions/then-wait-diffy-comparison-complete.md +0 -21
  201. package/docs/diffy-step-definitions/when-i-resize-window-number.md +0 -29
  202. package/docs/diffy-step-definitions.md +0 -21
  203. package/docs/index.md +0 -104
  204. package/examples/diffy/baseline.html +0 -54
  205. package/examples/diffy/changed.html +0 -63
  206. package/examples/diffy/index.html +0 -52
  207. package/tests/features/diffy/test--diffy-01-example-demo.feature +0 -22
  208. package/tests/features/diffy/test--diffy-02-all-steps.feature +0 -52
  209. package/tests/features/diffy/test--diffy-03-real-api.feature +0 -21
  210. package/tests/step-definitions-diffy/README.md +0 -329
  211. package/tests/step-definitions-diffy/mock-diffy-api/server.js +0 -84
  212. package/tests/step-definitions-diffy/webship-diffy-mock.js +0 -31
  213. package/tests/step-definitions-diffy/webship-diffy.js +0 -459
@@ -1,27 +0,0 @@
1
-
2
- # Then send screenshots to diffy with name "value"
3
-
4
- ## Overview
5
- This step definition uploads all captured screenshots to Diffy as a named custom snapshot. Upon successful execution, it clears both the in-memory buffer and on-disk screenshotsDir.
6
-
7
- ## Gherkin Pattern
8
- ```
9
- Then (I |we )*send screenshots to diffy with name "([^"]*)"
10
- ```
11
-
12
- ## Examples
13
-
14
- ```
15
- Then send screenshots to diffy with name "baseline"
16
- Then send screenshots to diffy with name "changed"
17
- Then send screenshots to diffy with name "homepage-release-2.0"
18
- Then send screenshots to diffy with name "after-deploy"
19
- Then send screenshots to diffy with name "smoke-run"
20
- Then send screenshots to diffy with name "webship.co-prod"
21
- ```
22
-
23
- ## Parameters
24
- - **name** (required): A custom snapshot identifier string passed in quotes
25
-
26
- ## Functionality
27
- The step captures all previously taken screenshots and uploads them to Diffy with the specified snapshot name. After successful upload, it automatically clears both the internal screenshot buffer and the local screenshots directory.
@@ -1,28 +0,0 @@
1
-
2
- # Then upload folder "URL" to diffy as "snapshotName"
3
-
4
- ## Description
5
-
6
- This step uploads all PNG and WebP images from a local directory to Diffy as a named custom snapshot. The breakpoint dimensions are extracted from image width metadata, while the URL slug is determined from the filename.
7
-
8
- ## Gherkin Pattern
9
-
10
- ```
11
- Then (I |we )*upload folder "([^"]*)" to diffy as "([^"]*)"
12
- ```
13
-
14
- ## Examples
15
-
16
- ```gherkin
17
- Then upload folder "./screenshots/baseline" to diffy as "baseline"
18
- Then upload folder "./screenshots/changed" to diffy as "changed"
19
- Then upload folder "./reports/screenshots" to diffy as "nightly"
20
- Then upload folder "/tmp/webship-shots" to diffy as "webship.co-snapshot"
21
- Then upload folder "./out/homepage" to diffy as "homepage-release-2.0"
22
- Then upload folder "./diffy/before" to diffy as "before-deploy"
23
- ```
24
-
25
- ## Parameters
26
-
27
- - **Folder Path**: Local directory containing PNG/WebP files (required)
28
- - **Snapshot Name**: Label for the uploaded custom snapshot in Diffy (required)
@@ -1,21 +0,0 @@
1
-
2
- # Then wait for diffy comparison to complete
3
-
4
- ## Description
5
-
6
- This step polls the most recently created Diffy comparison until it reaches a terminal state. The default timeout is set to `DIFFY_MAX_WAIT` seconds, which defaults to 1200 seconds.
7
-
8
- ## Gherkin Syntax
9
-
10
- ```
11
- Then (I |we )*wait for diffy comparison to complete
12
- ```
13
-
14
- ## Examples
15
-
16
- - `Then wait for diffy comparison to complete`
17
- - `And wait for diffy comparison to complete`
18
- - `Then I wait for diffy comparison to complete`
19
- - `Then we wait for diffy comparison to complete`
20
- - `And I wait for diffy comparison to complete`
21
- - `And we wait for diffy comparison to complete`
@@ -1,29 +0,0 @@
1
-
2
- # When I resize window to "number"
3
-
4
- ## Step Definition
5
-
6
- ```
7
- When(/^(?:I |we )?resize window to "([^"]*)")
8
- ```
9
-
10
- ## Description
11
-
12
- "Resize browser viewport to a breakpoint width (plus Diffy window padding)."
13
-
14
- ## Examples
15
-
16
- ```
17
- When I resize window to "1200"
18
- When we resize window to "640"
19
- When I resize window to "320"
20
- When we resize window to "768"
21
- When I resize window to "1024"
22
- When we resize window to "1440"
23
- When I resize window to "1920"
24
- When we resize window to "375"
25
- ```
26
-
27
- ## Parameters
28
-
29
- - `number`: The viewport width in pixels to resize the browser window to
@@ -1,21 +0,0 @@
1
-
2
- # Diffy Step Definitions
3
-
4
- ## Overview
5
-
6
- This documentation page describes Diffy Step Definitions for Webship JS 2.0.x. The feature enables opt-in visual-regression testing capabilities, allowing developers to capture full-page Playwright screenshots at multiple breakpoints and upload them to Diffy for comparison via REST API.
7
-
8
- **Key characteristic:** "Kept in a separate folder (tests/step-definitions-diffy/) so the default npm test run does not load them."
9
-
10
- ## Available Step Definitions
11
-
12
- - [Then I take screenshot](/docs/webship-js/2.0.x/diffy-step-definitions/then-i-take-screenshot)
13
- - [Then I take screenshots for all breakpoints](/docs/webship-js/2.0.x/diffy-step-definitions/then-i-take-screenshots-all-breakpoints)
14
- - [Then compare diffy "ENV1" with "ENV2"](/docs/webship-js/2.0.x/diffy-step-definitions/then-compare-diffy-env1-env2)
15
- - [Then create diffy comparison](/docs/webship-js/2.0.x/diffy-step-definitions/then-create-diffy-comparison)
16
- - [Then create diffy comparison with name "value"](/docs/webship-js/2.0.x/diffy-step-definitions/then-create-diffy-comparison-name-value)
17
- - [Then create diffy screenshot from "environment name" environment](/docs/webship-js/2.0.x/diffy-step-definitions/then-create-diffy-screenshot-environment-name)
18
- - [Then send screenshots to diffy with name "value"](/docs/webship-js/2.0.x/diffy-step-definitions/then-send-screenshots-diffy-name-value)
19
- - [Then upload folder "URL" to diffy as "snapshotName"](/docs/webship-js/2.0.x/diffy-step-definitions/then-upload-folder-url-diffy-snapshotname)
20
- - [Then wait for diffy comparison to complete](/docs/webship-js/2.0.x/diffy-step-definitions/then-wait-diffy-comparison-complete)
21
- - [When I resize window to "number"](/docs/webship-js/2.0.x/diffy-step-definitions/when-i-resize-window-number)
package/docs/index.md DELETED
@@ -1,104 +0,0 @@
1
- # Webship-js Documentation
2
-
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
-
5
- ## Reading order
6
-
7
- ### Webship-js essentials (custom)
8
-
9
- | Doc | Topic |
10
- | --- | --- |
11
- | [00 Quick start](00-quick-start.md) | 5-minute path for newcomers |
12
- | [01 Getting started](01-getting-started.md) | Install, project layout, run modes |
13
- | [02 BBR smart waits](02-bbr-smart-waits.md) | Why we never `sleep N seconds` |
14
- | [03 Selector registry](03-selector-registry.md) | Named selectors + CMS / framework presets |
15
- | [04 Step reference](04-step-reference.md) | Every built-in step, by topic |
16
- | [05 Web-first assertions](05-web-first-assertions.md) | Auto-retrying matchers |
17
- | [06 Networking & dialogs](06-network-and-dialogs.md) | Request mocking, alerts, prompts |
18
- | [07 Auth state](07-auth-state.md) | Save / restore login |
19
- | [08 Clock mocking](08-clock-mocking.md) | Control time |
20
- | [09 API testing](09-api-testing.md) | Direct HTTP from BDD |
21
- | [10 Accessibility](10-accessibility.md) | POUR smoke checks |
22
- | [11 Debugging](11-debugging.md) | Screenshots, headed, traces, reports |
23
- | [12 AI agent guide](12-ai-agent-guide.md) | Wisdom + recipes from the Recipes book v1.0.30 (TDD AI / SPDD / Three Amigos / golden rules) |
24
- | [13 FAQ](13-faq.md) | Common questions for newcomers |
25
- | [14 Recipes cookbook](14-recipes-cookbook.md) | 20 paste-and-go scenarios |
26
- | [15 Tag conventions](15-tag-conventions.md) | Standard tags + CI lane patterns |
27
-
28
- ### Reference (mirrored from webship.co/docs/webship-js/2.0.x)
29
-
30
- | Doc | Topic |
31
- | --- | --- |
32
- | [Overview](overview.md) | Webship-js v2.0.x at a glance |
33
- | [Install](install-webship-js.md) | Install Webship-js |
34
- | [Install — DDEV](install-webship-js/ddev-webship-js.md) | DDEV-Webship-js variant |
35
- | [Global settings](global-settings.md) | `cucumber.js` `worldParameters` reference |
36
- | [Commands](commands.md) | CLI commands |
37
- | [Assertions](assertions.md) | Built-in assertions |
38
- | [Step definitions](step-definitions.md) | Step-definition catalogue (28 sub-pages under `step-definitions/`) |
39
- | [API step definitions](api-step-definitions.md) | REST step definitions |
40
- | [Advanced screenshots](advanced-screenshots.md) | Per-size, full-page, named (3 sub-pages under `advanced-screenshots/`) |
41
- | [Advanced selectors](advanced-selectors.md) | Named selector registry, position assertions |
42
- | [Diffy step definitions](diffy-step-definitions.md) | Visual-diff workflow (10 sub-pages under `diffy-step-definitions/`) |
43
-
44
- ## At a glance
45
-
46
- ```gherkin
47
- Feature: Smoke
48
-
49
- Background:
50
- Given I restore the auth state from "tests/auth/admin.json"
51
-
52
- @javascript
53
- Scenario: Dashboard renders without JS errors
54
- Given I am on "/dashboard"
55
- And I wait until the network is idle
56
- Then the page should have a main landmark
57
- And "<#user-list>" should have a count of 5 within 5 seconds
58
- And "<.notification>" should not be visible
59
- ```
60
-
61
- ## Source layout
62
-
63
- ```
64
- webship-js/
65
- ├── docs/ <— You are here
66
- ├── tests/
67
- │ ├── features/ <— Your *.feature files
68
- │ ├── selectors/ <— CMS / framework JSON presets
69
- │ └── step-definitions/ <— Built-in steps (auto-loaded)
70
- │ ├── webship.js # World setup, hooks, shared helpers (smartSettle, modal, selectors)
71
- │ ├── navigation.steps.js # homepage / paths / history / URL assertions
72
- │ ├── action.steps.js # press, click, follow, attach
73
- │ ├── form.steps.js # fill, select, check, radio
74
- │ ├── assertion.steps.js # see / not see, in row, in element, response, count
75
- │ ├── api.steps.js # REST API steps
76
- │ ├── screenshot.steps.js # Screenshot hooks
77
- │ ├── selectors.steps.js # Named selector registry
78
- │ ├── wait.steps.js # All wait phrasings (BBR)
79
- │ ├── web-first.steps.js # Auto-retrying matchers
80
- │ ├── auth.steps.js # Auth state save/restore
81
- │ ├── clock.steps.js # Time mocking
82
- │ ├── network.steps.js # Route stubs / blocks / delays
83
- │ ├── dialog.steps.js # alert/confirm/prompt
84
- │ ├── a11y.steps.js # Accessibility smoke checks
85
- │ ├── javascript.steps.js # JS error tracking
86
- │ ├── element.steps.js # Element interactions
87
- │ ├── field.steps.js # Form field assertions
88
- │ ├── cookie.steps.js # Cookie helpers
89
- │ ├── modal.steps.js # Modal helpers
90
- │ ├── keyboard.steps.js # Key press steps
91
- │ ├── link.steps.js # Link assertions
92
- │ ├── path.steps.js # URL path assertions
93
- │ ├── response.steps.js # Response header inspection
94
- │ ├── responsive.steps.js # Viewport breakpoints
95
- │ ├── table.steps.js # Table assertions
96
- │ ├── metatag.steps.js # <meta> assertions
97
- │ ├── iframe.steps.js # Iframe context steps
98
- │ ├── file-download.steps.js # Download capture
99
- │ ├── rest.steps.js # REST helpers
100
- │ └── xml.steps.js # XML body assertions
101
- ├── examples/ <— Static HTML fixtures
102
- ├── cucumber.js <— Profiles + worldParameters
103
- └── playwright.config.ts <— Browser launch + context options
104
- ```
@@ -1,54 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Diffy Example — Baseline</title>
7
- <style>
8
- body { font-family: system-ui, sans-serif; margin: 0; color: #222; }
9
- header { background: #1e40af; color: #fff; padding: 24px 32px; }
10
- header h1 { margin: 0; font-size: 28px; }
11
- nav { background: #eef2ff; padding: 12px 32px; }
12
- nav a { margin-right: 16px; color: #1e40af; text-decoration: none; }
13
- main { padding: 32px; max-width: 960px; margin: 0 auto; }
14
- .card {
15
- background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
16
- padding: 20px; margin-bottom: 16px;
17
- }
18
- .card h2 { margin-top: 0; color: #1e40af; }
19
- .cta {
20
- display: inline-block; background: #1e40af; color: #fff;
21
- padding: 10px 20px; border-radius: 6px; text-decoration: none;
22
- }
23
- footer { background: #f3f4f6; padding: 16px 32px; color: #6b7280; font-size: 14px; }
24
- </style>
25
- </head>
26
- <body>
27
- <header>
28
- <h1>Webship-JS — Diffy Baseline</h1>
29
- <p>Stable layout captured as the reference snapshot.</p>
30
- </header>
31
- <nav>
32
- <a href="../index.html">Home</a>
33
- <a href="index.html">Diffy index</a>
34
- <a href="baseline.html">Baseline</a>
35
- <a href="changed.html">Changed</a>
36
- </nav>
37
- <main>
38
- <div class="card">
39
- <h2>Feature A</h2>
40
- <p>Baseline copy for feature A. This block is unchanged between versions.</p>
41
- </div>
42
- <div class="card">
43
- <h2>Feature B</h2>
44
- <p>Original baseline copy. Diffy should flag differences on the changed page.</p>
45
- <a class="cta" href="#">Call to action</a>
46
- </div>
47
- <div class="card">
48
- <h2>Pricing</h2>
49
- <p>Plan: <strong>$19/month</strong></p>
50
- </div>
51
- </main>
52
- <footer>&copy; 2026 Webship-JS Diffy example — baseline</footer>
53
- </body>
54
- </html>
@@ -1,63 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Diffy Example — Changed</title>
7
- <style>
8
- body { font-family: system-ui, sans-serif; margin: 0; color: #222; }
9
- header { background: #b91c1c; color: #fff; padding: 24px 32px; }
10
- header h1 { margin: 0; font-size: 32px; }
11
- nav { background: #fee2e2; padding: 12px 32px; }
12
- nav a { margin-right: 16px; color: #b91c1c; text-decoration: none; }
13
- main { padding: 32px; max-width: 960px; margin: 0 auto; }
14
- .card {
15
- background: #fff; border: 2px solid #fca5a5; border-radius: 12px;
16
- padding: 24px; margin-bottom: 20px;
17
- }
18
- .card h2 { margin-top: 0; color: #b91c1c; }
19
- .cta {
20
- display: inline-block; background: #b91c1c; color: #fff;
21
- padding: 12px 28px; border-radius: 999px; text-decoration: none;
22
- font-weight: bold;
23
- }
24
- .badge {
25
- display: inline-block; background: #fbbf24; color: #7c2d12;
26
- padding: 4px 10px; border-radius: 4px; font-size: 13px; margin-left: 8px;
27
- }
28
- footer { background: #fef2f2; padding: 16px 32px; color: #7f1d1d; font-size: 14px; }
29
- </style>
30
- </head>
31
- <body>
32
- <header>
33
- <h1>Webship-JS — Diffy Changed <span style="font-size:14px;">(v2)</span></h1>
34
- <p>Layout + palette shifted. Diffy should report regressions vs baseline.</p>
35
- </header>
36
- <nav>
37
- <a href="../index.html">Home</a>
38
- <a href="index.html">Diffy index</a>
39
- <a href="baseline.html">Baseline</a>
40
- <a href="changed.html">Changed</a>
41
- </nav>
42
- <main>
43
- <div class="card">
44
- <h2>Feature A</h2>
45
- <p>Baseline copy for feature A. This block is unchanged between versions.</p>
46
- </div>
47
- <div class="card">
48
- <h2>Feature B <span class="badge">NEW</span></h2>
49
- <p><strong>Redesigned</strong> copy with a new badge and fatter card padding.</p>
50
- <a class="cta" href="#">Buy now</a>
51
- </div>
52
- <div class="card">
53
- <h2>Pricing</h2>
54
- <p>Plan: <strong>$29/month</strong> (was $19)</p>
55
- </div>
56
- <div class="card">
57
- <h2>Testimonials</h2>
58
- <p>Entirely new section — Diffy should flag this as added content.</p>
59
- </div>
60
- </main>
61
- <footer>&copy; 2026 Webship-JS Diffy example — changed build</footer>
62
- </body>
63
- </html>
@@ -1,52 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Diffy examples — Webship-JS</title>
7
- <style>
8
- body { font-family: system-ui, sans-serif; margin: 0; color: #222; }
9
- header { background: #0f172a; color: #fff; padding: 24px 32px; }
10
- header h1 { margin: 0; font-size: 26px; }
11
- main { padding: 32px; max-width: 820px; margin: 0 auto; }
12
- .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
13
- .pair a {
14
- display: block; padding: 20px; border-radius: 8px;
15
- text-decoration: none; color: #fff;
16
- }
17
- .pair a.base { background: #1e40af; }
18
- .pair a.changed { background: #b91c1c; }
19
- .pair h2 { margin: 0 0 8px 0; }
20
- .pair small { opacity: 0.85; }
21
- p { line-height: 1.5; }
22
- code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; }
23
- footer { background: #f3f4f6; padding: 14px 32px; color: #6b7280; font-size: 14px; }
24
- a.back { color: #1e40af; }
25
- </style>
26
- </head>
27
- <body>
28
- <header>
29
- <h1>Webship-JS — Diffy visual-regression examples</h1>
30
- </header>
31
- <main>
32
- <p><a class="back" href="/">&larr; Back to examples index</a></p>
33
- <p>
34
- Two deliberately different pages. Run
35
- <code>npx cucumber-js --config cucumber.js -p diffy</code>
36
- (against a mock or real Diffy API) to capture screenshots of both pages
37
- at each breakpoint and request a comparison.
38
- </p>
39
- <div class="pair">
40
- <a class="base" href="baseline.html">
41
- <h2>Baseline</h2>
42
- <small>Reference snapshot — blue palette, rect CTA, $19/mo</small>
43
- </a>
44
- <a class="changed" href="changed.html">
45
- <h2>Changed</h2>
46
- <small>Visible regressions — red palette, NEW badge, pill CTA, $29/mo, added Testimonials</small>
47
- </a>
48
- </div>
49
- </main>
50
- <footer>&copy; 2026 Webship-JS Diffy examples</footer>
51
- </body>
52
- </html>
@@ -1,22 +0,0 @@
1
- Feature: Diffy — example pages demo
2
- Drive the bundled /diffy/baseline.html and /diffy/changed.html example
3
- pages through the Diffy capture + comparison flow. Safe to run against
4
- the mock Diffy API for local development.
5
-
6
- Config resolution (per-scenario):
7
- 1. process.env.DIFFY_*
8
- 2. cucumber.js worldParameters.diffy.*
9
- 3. built-in defaults
10
-
11
- @diffy @example
12
- Scenario: Capture baseline and changed, send to diffy, compare
13
- Given I am on "/diffy/baseline.html"
14
- Then I take screenshots for all breakpoints
15
- Then send screenshots to diffy with name "example-baseline"
16
-
17
- Given I am on "/diffy/changed.html"
18
- Then I take screenshots for all breakpoints
19
- Then send screenshots to diffy with name "example-changed"
20
-
21
- Then create diffy comparison with name "example-demo"
22
- Then wait for diffy comparison to complete
@@ -1,52 +0,0 @@
1
- Feature: Diffy — all step definitions smoke test
2
- Exercise every Diffy step at least once against the example pages.
3
- Intended for mock-Diffy runs (some steps require specific Diffy plan
4
- features and may fail against production with a valid key).
5
-
6
- @diffy @smoke
7
- Scenario: Resize, take screenshot, breakpoints loop, send
8
- Given I am on "/diffy/baseline.html"
9
- When I resize window to "640"
10
- Then I take screenshot
11
- Given I am on "/diffy/changed.html"
12
- Then I take screenshots for all breakpoints
13
- Then send screenshots to diffy with name "smoke-set-1"
14
-
15
- Given I am on "/diffy/baseline.html"
16
- Then I take screenshots for all breakpoints
17
- Then send screenshots to diffy with name "smoke-set-2"
18
-
19
- Then create diffy comparison
20
- Then wait for diffy comparison to complete
21
-
22
- @diffy @smoke @named-compare
23
- Scenario: Named comparison variant
24
- Given I am on "/diffy/baseline.html"
25
- Then I take screenshots for all breakpoints
26
- Then send screenshots to diffy with name "smoke-named-a"
27
-
28
- Given I am on "/diffy/changed.html"
29
- Then I take screenshots for all breakpoints
30
- Then send screenshots to diffy with name "smoke-named-b"
31
-
32
- Then create diffy comparison with name "PR-smoke"
33
- Then wait for diffy comparison to complete
34
-
35
- @diffy @smoke @env-compare
36
- Scenario: Server-side environment compare
37
- Then compare diffy "prod" with "stage"
38
- Then wait for diffy comparison to complete
39
-
40
- @diffy @smoke @env-screenshot
41
- Scenario: Trigger Diffy-side screenshot run per environment
42
- Then create diffy screenshot from "production" environment
43
- Then create diffy screenshot from "staging" environment
44
- Then create diffy comparison with name "env-pair"
45
- Then wait for diffy comparison to complete
46
-
47
- @diffy @smoke @folder-upload
48
- Scenario: Upload PNG folders to Diffy
49
- Then upload folder "/tmp/diffy-test-screenshots/baseline" to diffy as "folder-baseline"
50
- Then upload folder "/tmp/diffy-test-screenshots/feature" to diffy as "folder-feature"
51
- Then create diffy comparison with name "folder-pair"
52
- Then wait for diffy comparison to complete
@@ -1,21 +0,0 @@
1
- Feature: Diffy — real API smoke
2
- Run the minimum set against the production Diffy API. Requires valid
3
- DIFFY_API_KEY and DIFFY_PROJECT_ID for a project whose allowed URLs
4
- match LAUNCH_URL (e.g. http://localhost:8080 via ngrok, or a hosted
5
- copy of /examples).
6
-
7
- Do NOT run without a live key. Scoped behind @real-api so mock runs
8
- skip it automatically (cucumber-js --tags "not @real-api").
9
-
10
- @diffy @real-api
11
- Scenario: Real API baseline + changed comparison
12
- Given I am on "/diffy/baseline.html"
13
- Then I take screenshots for all breakpoints
14
- Then send screenshots to diffy with name "real-baseline"
15
-
16
- Given I am on "/diffy/changed.html"
17
- Then I take screenshots for all breakpoints
18
- Then send screenshots to diffy with name "real-changed"
19
-
20
- Then create diffy comparison with name "real-api-demo"
21
- Then wait for diffy comparison to complete