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.
- package/.circleci/config.yml +7 -31
- package/.drone.yml +68 -0
- package/.harness/webship-js-pipeline.yml +101 -0
- package/.semaphore/semaphore.yml +58 -0
- package/.teamcity/pom.xml +52 -0
- package/.teamcity/settings.kts +92 -0
- package/.travis.yml +24 -3
- package/AGENTS.md +53 -17
- package/CLAUDE.md +327 -105
- package/Jenkinsfile +54 -0
- package/azure-pipelines.yml +82 -0
- package/bamboo-specs/bamboo.yml +131 -0
- package/bin/init-webship.js +0 -13
- package/bin/postinstall.js +0 -0
- package/buildspec.yml +56 -0
- package/cloudbuild.yaml +49 -0
- package/codefresh.yml +77 -0
- package/cucumber.js +39 -14
- package/docs/00-quick-start.md +0 -0
- package/docs/01-getting-started.md +0 -0
- package/docs/02-bbr-smart-waits.md +0 -0
- package/docs/03-selector-registry.md +0 -0
- package/docs/04-step-reference.md +74 -3
- package/docs/05-web-first-assertions.md +0 -0
- package/docs/06-network-and-dialogs.md +0 -0
- package/docs/07-auth-state.md +0 -0
- package/docs/08-clock-mocking.md +0 -0
- package/docs/09-api-testing.md +0 -0
- package/docs/10-accessibility.md +0 -0
- package/docs/11-debugging.md +0 -0
- package/docs/12-ai-agent-guide.md +0 -0
- package/docs/13-faq.md +0 -0
- package/docs/14-recipes-cookbook.md +0 -0
- package/docs/15-tag-conventions.md +0 -0
- package/docs/16-ci-cd.md +879 -0
- package/docs/README.md +116 -0
- package/docs/advanced-screenshots/then-i-save-fullscreen-screenshot.md +0 -0
- package/docs/advanced-screenshots/then-i-save-width-x-height-screenshot.md +0 -0
- package/docs/advanced-screenshots/when-i-save-screenshot-name-filename.md +0 -0
- package/docs/advanced-screenshots.md +0 -0
- package/docs/advanced-selectors.md +0 -0
- package/docs/api-step-definitions.md +0 -0
- package/docs/global-settings.md +45 -22
- package/docs/install-webship-js/ddev-webship-js.md +0 -0
- package/docs/install-webship-js.md +0 -1
- package/docs/overview.md +0 -1
- package/docs/step-definitions/given-i-am-anonymous-user.md +0 -0
- package/docs/step-definitions/given-i-am-homepage.md +0 -0
- package/docs/step-definitions/given-i-am-specific-page.md +0 -0
- package/docs/step-definitions/then-i-should-be.md +0 -0
- package/docs/step-definitions/then-i-should-see.md +0 -0
- package/docs/step-definitions/then-item-checkbox.md +0 -0
- package/docs/step-definitions/then-item-link-should-contain-url.md +0 -0
- package/docs/step-definitions/then-item-should-contain.md +0 -0
- package/docs/step-definitions/then-radio-button-value-should-be-selected.md +0 -0
- package/docs/step-definitions/then-response-status-code-should-be-number.md +0 -0
- package/docs/step-definitions/then-value-radio-button-selected.md +0 -0
- package/docs/step-definitions/when-i-attach-file-file-name-element.md +0 -0
- package/docs/step-definitions/when-i-check-checkbox.md +0 -0
- package/docs/step-definitions/when-i-click-link.md +0 -0
- package/docs/step-definitions/when-i-click-operation-text-row.md +0 -0
- package/docs/step-definitions/when-i-fill.md +0 -0
- package/docs/step-definitions/when-i-go-homepage.md +0 -0
- package/docs/step-definitions/when-i-go-specific-page.md +0 -0
- package/docs/step-definitions/when-i-move-backward-one-page.md +0 -0
- package/docs/step-definitions/when-i-move-forward-one-page.md +0 -0
- package/docs/step-definitions/when-i-press-button.md +0 -0
- package/docs/step-definitions/when-i-reload-page.md +0 -0
- package/docs/step-definitions/when-i-scroll.md +0 -0
- package/docs/step-definitions/when-i-select-option-select-list.md +0 -0
- package/docs/step-definitions/when-i-select-radio-button-value.md +0 -0
- package/docs/step-definitions/when-i-uncheck-checkbox.md +0 -0
- package/docs/step-definitions/when-i-wait-ajax-finish.md +0 -0
- package/docs/step-definitions/when-i-wait.md +0 -0
- package/docs/step-definitions.md +0 -0
- package/examples/a11y.html +0 -0
- package/examples/account.html +0 -0
- package/examples/ajax-wait-examples.html +0 -0
- package/examples/cookies.html +0 -0
- package/examples/date.html +0 -0
- package/examples/dynamic-examples.html +0 -0
- package/examples/element.html +0 -0
- package/examples/field.html +0 -0
- package/examples/keyboard.html +0 -0
- package/examples/links.html +0 -0
- package/examples/modal.html +0 -0
- package/examples/path.html +0 -0
- package/examples/table.html +0 -0
- package/examples/test--modal-dialogs.html +0 -0
- package/examples/test--when--i-additionally-select.html +0 -0
- package/examples/test--when--i-select-radio-button.html +0 -0
- package/examples/video-demo.html +43 -0
- package/package.json +1 -1
- package/playwright.config.ts +0 -0
- package/tests/assets/test-document.pdf +0 -0
- package/tests/features/a11y.feature +0 -0
- package/tests/features/ajax-wait-examples.feature +0 -0
- package/tests/features/cookie.feature +0 -0
- package/tests/features/date.feature +0 -0
- package/tests/features/dynamic-content-examples.feature +0 -0
- package/tests/features/element.feature +0 -0
- package/tests/features/field.feature +0 -0
- package/tests/features/keyboard.feature +0 -0
- package/tests/features/link.feature +0 -0
- package/tests/features/modal-advanced-example.feature +0 -0
- package/tests/features/modal-basic-example.feature +0 -0
- package/tests/features/modal-error-handling-example.feature +0 -0
- package/tests/features/modal.feature +0 -0
- package/tests/features/path.feature +0 -0
- package/tests/features/response.feature +0 -0
- package/tests/features/responsive.feature +0 -0
- package/tests/features/table.feature +0 -0
- package/tests/features/test--given--i-am-an-anonymous-user.feature +0 -0
- package/tests/features/test--then--i-save-screenshot.feature +0 -0
- package/tests/features/test--then--i-see-locator.feature +0 -0
- package/tests/features/test--then--i-should-see-n-elements.feature +0 -0
- package/tests/features/test--then--print-current-url-and-response.feature +0 -0
- package/tests/features/test--when--i-additionally-select.feature +0 -0
- package/tests/features/test--when--i-follow.feature +0 -0
- package/tests/features/test--when--i-select-radio-button.feature +0 -0
- package/tests/features/video.feature +18 -0
- package/tests/features/wait.feature +0 -0
- package/tests/features/yaml.feature +0 -0
- package/tests/reports/README.md +0 -0
- package/tests/selectors/_canonical-keys.json +0 -0
- package/tests/selectors/back-end-selectors.json +0 -0
- package/tests/selectors/cms-contentful-admin.json +0 -0
- package/tests/selectors/cms-craft-admin.json +0 -0
- package/tests/selectors/cms-drupal-cms-gin.json +0 -0
- package/tests/selectors/cms-drupal-core-claro.json +0 -0
- package/tests/selectors/cms-generic-admin.json +0 -0
- package/tests/selectors/cms-ghost-admin.json +0 -0
- package/tests/selectors/cms-joomla-admin.json +0 -0
- package/tests/selectors/cms-magento2-admin.json +0 -0
- package/tests/selectors/cms-prestashop-admin.json +0 -0
- package/tests/selectors/cms-shopify-admin.json +0 -0
- package/tests/selectors/cms-strapi-admin.json +0 -0
- package/tests/selectors/cms-typo3-admin.json +0 -0
- package/tests/selectors/cms-woocommerce-front.json +0 -0
- package/tests/selectors/cms-wordpress-admin.json +0 -0
- package/tests/selectors/framework-ant-design.json +0 -0
- package/tests/selectors/framework-bootstrap.json +0 -0
- package/tests/selectors/framework-bulma.json +0 -0
- package/tests/selectors/framework-chakra.json +0 -0
- package/tests/selectors/framework-foundation.json +0 -0
- package/tests/selectors/framework-material-ui.json +0 -0
- package/tests/selectors/framework-shadcn.json +0 -0
- package/tests/selectors/framework-tailwind.json +0 -0
- package/tests/selectors/framework-vuetify.json +0 -0
- package/tests/selectors/front-end-selectors.json +0 -0
- package/tests/selectors/homepage-selectors.json +0 -0
- package/tests/step-definitions/a11y.steps.js +3 -1
- package/tests/step-definitions/action.steps.js +2 -2
- package/tests/step-definitions/api.steps.js +17 -16
- package/tests/step-definitions/assertion.steps.js +2 -2
- package/tests/step-definitions/auth.steps.js +3 -1
- package/tests/step-definitions/clock.steps.js +38 -38
- package/tests/step-definitions/cookie.steps.js +0 -0
- package/tests/step-definitions/debug.steps.js +13 -5
- package/tests/step-definitions/dialog.steps.js +0 -0
- package/tests/step-definitions/element.steps.js +47 -5
- package/tests/step-definitions/field.steps.js +0 -0
- package/tests/step-definitions/file-download.steps.js +38 -20
- package/tests/step-definitions/form.steps.js +6 -6
- package/tests/step-definitions/iframe.steps.js +65 -15
- package/tests/step-definitions/input.steps.js +47 -8
- package/tests/step-definitions/javascript.steps.js +195 -34
- package/tests/step-definitions/keyboard.steps.js +38 -4
- package/tests/step-definitions/link.steps.js +0 -0
- package/tests/step-definitions/metatag.steps.js +0 -0
- package/tests/step-definitions/modal.steps.js +39 -14
- package/tests/step-definitions/navigation.steps.js +0 -0
- package/tests/step-definitions/network.steps.js +61 -19
- package/tests/step-definitions/path.steps.js +0 -0
- package/tests/step-definitions/response.steps.js +0 -0
- package/tests/step-definitions/responsive.steps.js +3 -1
- package/tests/step-definitions/rest.steps.js +0 -0
- package/tests/step-definitions/screenshot.steps.js +0 -0
- package/tests/step-definitions/scroll.steps.js +0 -0
- package/tests/step-definitions/selectors.steps.js +19 -17
- package/tests/step-definitions/storage.steps.js +0 -0
- package/tests/step-definitions/table.steps.js +0 -0
- package/tests/step-definitions/video.steps.js +178 -0
- package/tests/step-definitions/wait.steps.js +0 -0
- package/tests/step-definitions/web-first.steps.js +3 -1
- package/tests/step-definitions/webship.js +234 -15
- package/tests/step-definitions/xml.steps.js +4 -2
- package/tests/step-definitions/yaml.steps.js +13 -11
- package/tsconfig.json +0 -0
- package/videos/README.md +32 -0
- package/.travis-ci.yml +0 -16
- package/docs/diffy-step-definitions/then-compare-diffy-env1-env2.md +0 -30
- package/docs/diffy-step-definitions/then-create-diffy-comparison-name-value.md +0 -21
- package/docs/diffy-step-definitions/then-create-diffy-comparison.md +0 -25
- package/docs/diffy-step-definitions/then-create-diffy-screenshot-environment-name.md +0 -35
- package/docs/diffy-step-definitions/then-i-take-screenshot.md +0 -21
- package/docs/diffy-step-definitions/then-i-take-screenshots-all-breakpoints.md +0 -27
- package/docs/diffy-step-definitions/then-send-screenshots-diffy-name-value.md +0 -27
- package/docs/diffy-step-definitions/then-upload-folder-url-diffy-snapshotname.md +0 -28
- package/docs/diffy-step-definitions/then-wait-diffy-comparison-complete.md +0 -21
- package/docs/diffy-step-definitions/when-i-resize-window-number.md +0 -29
- package/docs/diffy-step-definitions.md +0 -21
- package/docs/index.md +0 -104
- package/examples/diffy/baseline.html +0 -54
- package/examples/diffy/changed.html +0 -63
- package/examples/diffy/index.html +0 -52
- package/tests/features/diffy/test--diffy-01-example-demo.feature +0 -22
- package/tests/features/diffy/test--diffy-02-all-steps.feature +0 -52
- package/tests/features/diffy/test--diffy-03-real-api.feature +0 -21
- package/tests/step-definitions-diffy/README.md +0 -329
- package/tests/step-definitions-diffy/mock-diffy-api/server.js +0 -84
- package/tests/step-definitions-diffy/webship-diffy-mock.js +0 -31
- 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>© 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>© 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="/">← 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>© 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
|