webship-js 2.0.4 → 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 (208) 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 +0 -13
  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 +0 -12
  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 +0 -0
  21. package/docs/03-selector-registry.md +0 -0
  22. package/docs/04-step-reference.md +0 -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 +0 -0
  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 +4 -1
  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 +0 -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 +0 -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/path.html +0 -0
  87. package/examples/table.html +0 -0
  88. package/examples/test--modal-dialogs.html +0 -0
  89. package/examples/test--when--i-additionally-select.html +0 -0
  90. package/examples/test--when--i-select-radio-button.html +0 -0
  91. package/examples/video-demo.html +0 -0
  92. package/package.json +1 -1
  93. package/playwright.config.ts +0 -0
  94. package/tests/assets/test-document.pdf +0 -0
  95. package/tests/features/a11y.feature +0 -0
  96. package/tests/features/ajax-wait-examples.feature +0 -0
  97. package/tests/features/cookie.feature +0 -0
  98. package/tests/features/date.feature +0 -0
  99. package/tests/features/dynamic-content-examples.feature +0 -0
  100. package/tests/features/element.feature +0 -0
  101. package/tests/features/field.feature +0 -0
  102. package/tests/features/keyboard.feature +0 -0
  103. package/tests/features/link.feature +0 -0
  104. package/tests/features/modal-advanced-example.feature +0 -0
  105. package/tests/features/modal-basic-example.feature +0 -0
  106. package/tests/features/modal-error-handling-example.feature +0 -0
  107. package/tests/features/modal.feature +0 -0
  108. package/tests/features/path.feature +0 -0
  109. package/tests/features/response.feature +0 -0
  110. package/tests/features/responsive.feature +0 -0
  111. package/tests/features/table.feature +0 -0
  112. package/tests/features/test--given--i-am-an-anonymous-user.feature +0 -0
  113. package/tests/features/test--then--i-save-screenshot.feature +0 -0
  114. package/tests/features/test--then--i-see-locator.feature +0 -0
  115. package/tests/features/test--then--i-should-see-n-elements.feature +0 -0
  116. package/tests/features/test--then--print-current-url-and-response.feature +0 -0
  117. package/tests/features/test--when--i-additionally-select.feature +0 -0
  118. package/tests/features/test--when--i-follow.feature +0 -0
  119. package/tests/features/test--when--i-select-radio-button.feature +0 -0
  120. package/tests/features/video.feature +0 -0
  121. package/tests/features/wait.feature +0 -0
  122. package/tests/features/yaml.feature +0 -0
  123. package/tests/reports/README.md +0 -0
  124. package/tests/selectors/_canonical-keys.json +0 -0
  125. package/tests/selectors/back-end-selectors.json +0 -0
  126. package/tests/selectors/cms-contentful-admin.json +0 -0
  127. package/tests/selectors/cms-craft-admin.json +0 -0
  128. package/tests/selectors/cms-drupal-cms-gin.json +0 -0
  129. package/tests/selectors/cms-drupal-core-claro.json +0 -0
  130. package/tests/selectors/cms-generic-admin.json +0 -0
  131. package/tests/selectors/cms-ghost-admin.json +0 -0
  132. package/tests/selectors/cms-joomla-admin.json +0 -0
  133. package/tests/selectors/cms-magento2-admin.json +0 -0
  134. package/tests/selectors/cms-prestashop-admin.json +0 -0
  135. package/tests/selectors/cms-shopify-admin.json +0 -0
  136. package/tests/selectors/cms-strapi-admin.json +0 -0
  137. package/tests/selectors/cms-typo3-admin.json +0 -0
  138. package/tests/selectors/cms-woocommerce-front.json +0 -0
  139. package/tests/selectors/cms-wordpress-admin.json +0 -0
  140. package/tests/selectors/framework-ant-design.json +0 -0
  141. package/tests/selectors/framework-bootstrap.json +0 -0
  142. package/tests/selectors/framework-bulma.json +0 -0
  143. package/tests/selectors/framework-chakra.json +0 -0
  144. package/tests/selectors/framework-foundation.json +0 -0
  145. package/tests/selectors/framework-material-ui.json +0 -0
  146. package/tests/selectors/framework-shadcn.json +0 -0
  147. package/tests/selectors/framework-tailwind.json +0 -0
  148. package/tests/selectors/framework-vuetify.json +0 -0
  149. package/tests/selectors/front-end-selectors.json +0 -0
  150. package/tests/selectors/homepage-selectors.json +0 -0
  151. package/tests/step-definitions/a11y.steps.js +0 -0
  152. package/tests/step-definitions/action.steps.js +0 -0
  153. package/tests/step-definitions/assertion.steps.js +0 -0
  154. package/tests/step-definitions/auth.steps.js +0 -0
  155. package/tests/step-definitions/clock.steps.js +0 -0
  156. package/tests/step-definitions/cookie.steps.js +0 -0
  157. package/tests/step-definitions/debug.steps.js +0 -0
  158. package/tests/step-definitions/dialog.steps.js +0 -0
  159. package/tests/step-definitions/element.steps.js +0 -0
  160. package/tests/step-definitions/field.steps.js +0 -0
  161. package/tests/step-definitions/file-download.steps.js +0 -0
  162. package/tests/step-definitions/form.steps.js +0 -0
  163. package/tests/step-definitions/iframe.steps.js +0 -0
  164. package/tests/step-definitions/input.steps.js +0 -0
  165. package/tests/step-definitions/javascript.steps.js +0 -0
  166. package/tests/step-definitions/keyboard.steps.js +0 -0
  167. package/tests/step-definitions/link.steps.js +0 -0
  168. package/tests/step-definitions/metatag.steps.js +0 -0
  169. package/tests/step-definitions/modal.steps.js +0 -0
  170. package/tests/step-definitions/navigation.steps.js +0 -0
  171. package/tests/step-definitions/network.steps.js +0 -0
  172. package/tests/step-definitions/path.steps.js +0 -0
  173. package/tests/step-definitions/response.steps.js +0 -0
  174. package/tests/step-definitions/responsive.steps.js +0 -0
  175. package/tests/step-definitions/rest.steps.js +0 -0
  176. package/tests/step-definitions/screenshot.steps.js +0 -0
  177. package/tests/step-definitions/scroll.steps.js +0 -0
  178. package/tests/step-definitions/selectors.steps.js +0 -0
  179. package/tests/step-definitions/storage.steps.js +0 -0
  180. package/tests/step-definitions/table.steps.js +0 -0
  181. package/tests/step-definitions/video.steps.js +0 -0
  182. package/tests/step-definitions/wait.steps.js +0 -0
  183. package/tests/step-definitions/web-first.steps.js +0 -0
  184. package/tests/step-definitions/xml.steps.js +0 -0
  185. package/tests/step-definitions/yaml.steps.js +0 -0
  186. package/tsconfig.json +0 -0
  187. package/videos/README.md +0 -0
  188. package/docs/diffy-step-definitions/then-compare-diffy-env1-env2.md +0 -30
  189. package/docs/diffy-step-definitions/then-create-diffy-comparison-name-value.md +0 -21
  190. package/docs/diffy-step-definitions/then-create-diffy-comparison.md +0 -25
  191. package/docs/diffy-step-definitions/then-create-diffy-screenshot-environment-name.md +0 -35
  192. package/docs/diffy-step-definitions/then-i-take-screenshot.md +0 -21
  193. package/docs/diffy-step-definitions/then-i-take-screenshots-all-breakpoints.md +0 -27
  194. package/docs/diffy-step-definitions/then-send-screenshots-diffy-name-value.md +0 -27
  195. package/docs/diffy-step-definitions/then-upload-folder-url-diffy-snapshotname.md +0 -28
  196. package/docs/diffy-step-definitions/then-wait-diffy-comparison-complete.md +0 -21
  197. package/docs/diffy-step-definitions/when-i-resize-window-number.md +0 -29
  198. package/docs/diffy-step-definitions.md +0 -21
  199. package/examples/diffy/baseline.html +0 -54
  200. package/examples/diffy/changed.html +0 -63
  201. package/examples/diffy/index.html +0 -52
  202. package/tests/features/diffy/test--diffy-01-example-demo.feature +0 -22
  203. package/tests/features/diffy/test--diffy-02-all-steps.feature +0 -52
  204. package/tests/features/diffy/test--diffy-03-real-api.feature +0 -21
  205. package/tests/step-definitions-diffy/README.md +0 -329
  206. package/tests/step-definitions-diffy/mock-diffy-api/server.js +0 -84
  207. package/tests/step-definitions-diffy/webship-diffy-mock.js +0 -31
  208. package/tests/step-definitions-diffy/webship-diffy.js +0 -459
@@ -1,35 +0,0 @@
1
-
2
- # Then create diffy screenshot from "environment name" environment
3
-
4
- ## Overview
5
-
6
- This Webship JS step definition instructs Diffy to capture a snapshot remotely from a specified environment within your project. The step accepts both abbreviated and full environment names, including custom environments.
7
-
8
- ## Gherkin Step Pattern
9
-
10
- ```
11
- Then (I |we )*create diffy screenshot from "([^"]*)" environment
12
- ```
13
-
14
- ## Description
15
-
16
- "Ask Diffy to capture a snapshot remotely from a named environment on the project. Accepts short (prod/stage/dev) or long (production/staging/development) forms, plus 'custom'."
17
-
18
- ## Examples
19
-
20
- ```gherkin
21
- Then create diffy screenshot from "production" environment
22
- Then create diffy screenshot from "prod" environment
23
- Then create diffy screenshot from "staging" environment
24
- Then create diffy screenshot from "stage" environment
25
- Then create diffy screenshot from "development" environment
26
- Then create diffy screenshot from "dev" environment
27
- Then create diffy screenshot from "custom" environment
28
- ```
29
-
30
- ## Supported Environment Names
31
-
32
- - **Production**: "production" or "prod"
33
- - **Staging**: "staging" or "stage"
34
- - **Development**: "development" or "dev"
35
- - **Custom**: "custom" (for user-defined environments)
@@ -1,21 +0,0 @@
1
-
2
- # Then I take screenshot
3
-
4
- ## Description
5
-
6
- "Capture a full-page screenshot at the current viewport. Held in-memory (and optionally written to DIFFY_SCREENSHOTS_DIR) until 'send screenshots to diffy with name' uploads the batch."
7
-
8
- ## Gherkin Step Definition
9
-
10
- ```
11
- Then(/^(?:I |we )?take screenshot$)
12
- ```
13
-
14
- ## Usage Examples
15
-
16
- - `Then I take screenshot`
17
- - `Then we take screenshot`
18
- - `And I take screenshot`
19
- - `And we take screenshot`
20
- - `Then take screenshot`
21
- - `And take screenshot`
@@ -1,27 +0,0 @@
1
-
2
- # Then I take screenshots for all breakpoints
3
-
4
- ## Description
5
-
6
- This step definition resizes the browser window to each configured breakpoint and captures a screenshot at each breakpoint. The breakpoints are sourced from the `DIFFY_BREAKPOINTS` environment variable or `worldParameters.diffy.breakpoints`.
7
-
8
- ## Gherkin Step Pattern
9
-
10
- ```
11
- Then(/^(?:I |we )?take screenshots for all breakpoints$)
12
- ```
13
-
14
- ## Usage Examples
15
-
16
- - `Then I take screenshots for all breakpoints`
17
- - `Then we take screenshots for all breakpoints`
18
- - `And I take screenshots for all breakpoints`
19
- - `And we take screenshots for all breakpoints`
20
- - `Then take screenshots for all breakpoints`
21
- - `And take screenshots for all breakpoints`
22
-
23
- ## Configuration
24
-
25
- Breakpoints are configured via:
26
- - `DIFFY_BREAKPOINTS` environment variable, or
27
- - `worldParameters.diffy.breakpoints` parameter
@@ -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)
@@ -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