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.
- package/.drone.yml +0 -0
- package/.harness/webship-js-pipeline.yml +0 -0
- package/.semaphore/semaphore.yml +0 -0
- package/.teamcity/pom.xml +0 -0
- package/.teamcity/settings.kts +0 -0
- package/.travis.yml +0 -0
- package/AGENTS.md +50 -14
- package/CLAUDE.md +326 -104
- package/Jenkinsfile +0 -0
- package/azure-pipelines.yml +0 -0
- package/bamboo-specs/bamboo.yml +0 -0
- package/bin/init-webship.js +0 -13
- package/bin/postinstall.js +0 -0
- package/buildspec.yml +0 -0
- package/cloudbuild.yaml +0 -0
- package/codefresh.yml +0 -0
- package/cucumber.js +0 -12
- 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 +0 -0
- 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 +0 -0
- package/docs/README.md +4 -1
- 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 +0 -28
- 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 +0 -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 +0 -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 +0 -0
- package/tests/step-definitions/action.steps.js +0 -0
- package/tests/step-definitions/assertion.steps.js +0 -0
- package/tests/step-definitions/auth.steps.js +0 -0
- package/tests/step-definitions/clock.steps.js +0 -0
- package/tests/step-definitions/cookie.steps.js +0 -0
- package/tests/step-definitions/debug.steps.js +0 -0
- package/tests/step-definitions/dialog.steps.js +0 -0
- package/tests/step-definitions/element.steps.js +0 -0
- package/tests/step-definitions/field.steps.js +0 -0
- package/tests/step-definitions/file-download.steps.js +0 -0
- package/tests/step-definitions/form.steps.js +0 -0
- package/tests/step-definitions/iframe.steps.js +0 -0
- package/tests/step-definitions/input.steps.js +0 -0
- package/tests/step-definitions/javascript.steps.js +0 -0
- package/tests/step-definitions/keyboard.steps.js +0 -0
- 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 +0 -0
- package/tests/step-definitions/navigation.steps.js +0 -0
- package/tests/step-definitions/network.steps.js +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- package/tests/step-definitions/wait.steps.js +0 -0
- package/tests/step-definitions/web-first.steps.js +0 -0
- package/tests/step-definitions/xml.steps.js +0 -0
- package/tests/step-definitions/yaml.steps.js +0 -0
- package/tsconfig.json +0 -0
- package/videos/README.md +0 -0
- 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/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
package/.drone.yml
CHANGED
|
File without changes
|
|
File without changes
|
package/.semaphore/semaphore.yml
CHANGED
|
File without changes
|
package/.teamcity/pom.xml
CHANGED
|
File without changes
|
package/.teamcity/settings.kts
CHANGED
|
File without changes
|
package/.travis.yml
CHANGED
|
File without changes
|
package/AGENTS.md
CHANGED
|
@@ -5,8 +5,11 @@ machine-readable rules for any AI agent (Claude, Codex, Cursor, Copilot,
|
|
|
5
5
|
etc.) working on the repository.
|
|
6
6
|
|
|
7
7
|
For full project context, read `CLAUDE.md` in the same directory — it is
|
|
8
|
-
the canonical, longer policy
|
|
9
|
-
|
|
8
|
+
the canonical, longer policy (commands §1, architecture §2, file
|
|
9
|
+
organisation §5, BBR waits §6, local agents and skills §11). This file
|
|
10
|
+
extracts the critical rules that every agent must respect. When the two
|
|
11
|
+
disagree, `CLAUDE.md` wins — and the disagreement is a bug to fix in the
|
|
12
|
+
same change.
|
|
10
13
|
|
|
11
14
|
## Identity
|
|
12
15
|
|
|
@@ -20,11 +23,15 @@ Drupal, or PHP in code, file names, comments, or step phrasings.
|
|
|
20
23
|
`git commit`, `git push`, `npm publish`, or anything that mutates a
|
|
21
24
|
shared repository / registry without explicit per-action consent.
|
|
22
25
|
2. **Update docs in the same change.** Step / selector / config changes
|
|
23
|
-
must update the matching page in `docs/`.
|
|
26
|
+
must update the matching page in `docs/`. A `worldParameters` change
|
|
27
|
+
must also update the scaffold template in `bin/init-webship.js`.
|
|
24
28
|
3. **Stay green.** Every change must keep `npx cucumber-js --dry-run`
|
|
25
|
-
ambiguity-free and `npx cucumber-js` passing.
|
|
29
|
+
ambiguity-free and `npx cucumber-js` passing. `node_modules/` is not
|
|
30
|
+
committed — run `npm install` first, and `npm start` (the `examples/`
|
|
31
|
+
fixture server on :8080) before the suite. If you could not run it,
|
|
32
|
+
say so; never imply green.
|
|
26
33
|
4. **Backups.** When asked, bump `package.json` `version` and emit
|
|
27
|
-
|
|
34
|
+
`~/workspace/products/webship-js-<version>.zip` excluding
|
|
28
35
|
`node_modules/`, `tests/reports/`, `screenshots/`, `.git/`.
|
|
29
36
|
|
|
30
37
|
## Step definition rules
|
|
@@ -38,6 +45,9 @@ Drupal, or PHP in code, file names, comments, or step phrasings.
|
|
|
38
45
|
Gherkin keyword is stripped.
|
|
39
46
|
* No static `sleep` calls. Wait steps go through `smartSettle()` in
|
|
40
47
|
`webship.js`.
|
|
48
|
+
* Never let a raw Playwright error reach the tester. Wrap risky locator
|
|
49
|
+
work and re-throw through `friendly()` / `humanize()` — see
|
|
50
|
+
`actOrExplain()` in `action.steps.js` for the reference shape.
|
|
41
51
|
* Place new steps in the file whose topic matches. Don't create a new
|
|
42
52
|
file unless the topic is genuinely orthogonal to every existing one.
|
|
43
53
|
|
|
@@ -71,10 +81,13 @@ sleeps with edge waits.
|
|
|
71
81
|
|
|
72
82
|
Before reporting a task complete:
|
|
73
83
|
|
|
84
|
+
* [ ] Ran `npx cucumber-js --dry-run` — no ambiguity, no undefined steps.
|
|
74
85
|
* [ ] Ran the affected feature(s) via `LAUNCH_URL=http://localhost:8080 npx cucumber-js <path>`.
|
|
75
86
|
* [ ] Updated `docs/04-step-reference.md` and the topic doc if a step or
|
|
76
87
|
selector preset changed.
|
|
77
|
-
* [ ] Updated `docs/README.md` source layout if a
|
|
88
|
+
* [ ] Updated `docs/README.md` source layout + step counts if a step file
|
|
89
|
+
was added or steps were added / removed.
|
|
90
|
+
* [ ] Updated `bin/init-webship.js` if `worldParameters` changed.
|
|
78
91
|
* [ ] Verified examples match patterns (no audit mismatches).
|
|
79
92
|
* [ ] Bumped version + produced backup zip if user requested it.
|
|
80
93
|
|
|
@@ -96,14 +109,37 @@ step definitions. Critical takeaways:
|
|
|
96
109
|
|
|
97
110
|
## Source map
|
|
98
111
|
|
|
99
|
-
Step definitions: `tests/step-definitions
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`
|
|
104
|
-
`getModalSelector`
|
|
112
|
+
Step definitions: `tests/step-definitions/` — 413 steps across 36
|
|
113
|
+
`*.steps.js` files, all auto-loaded. The `webship.js` file there is the
|
|
114
|
+
single canonical entry point — World, hooks, init script, and shared
|
|
115
|
+
helpers (`smartSettle`, `waitForPageLoad`, `buildSelector`, `gotoUrl`,
|
|
116
|
+
`fillField`, `getLocatorText`, `pad`, the modal probes
|
|
117
|
+
`getModalSelector` / `getModalLocator` / `waitForModalState` /
|
|
118
|
+
`findVisibleModal` / `isAnyModalVisible`, the date helpers
|
|
119
|
+
`resolveRelativeDate` / `parseRelativeOffset` / `formatRelativeDate`, and
|
|
120
|
+
the error builders `friendly` / `humanize`). It also owns two
|
|
121
|
+
process-level side effects: the stdout hook-line filter and the auto HTML
|
|
122
|
+
report on exit.
|
|
105
123
|
|
|
106
124
|
Docs: `docs/` — see `docs/README.md` for the reading order.
|
|
107
125
|
|
|
108
|
-
Selector presets: `tests/selectors/*.json
|
|
109
|
-
`tests/selectors/_canonical-keys.json`.
|
|
126
|
+
Selector presets: `tests/selectors/*.json` — 26 presets. Canonical key
|
|
127
|
+
list: `tests/selectors/_canonical-keys.json`.
|
|
128
|
+
|
|
129
|
+
Config: `cucumber.js` (`worldParameters`, annotated) and
|
|
130
|
+
`playwright.config.ts` (browser launch + context), plus the scaffold
|
|
131
|
+
template in `bin/init-webship.js` that must mirror them.
|
|
132
|
+
|
|
133
|
+
Visual regression: extracted to the [`diffy-steps`](https://github.com/webship/diffy-steps)
|
|
134
|
+
plugin — not in this repository.
|
|
135
|
+
|
|
136
|
+
## This repo is the package
|
|
137
|
+
|
|
138
|
+
webship-js ships `tests/` to consumers on npm, so `tests/` is both the
|
|
139
|
+
step library and its own test suite. The local agents and skills that
|
|
140
|
+
drive this project (`agent-webship-js`, `webship-ai-agent`, and the
|
|
141
|
+
`/webship-js-*` skills) all read `node_modules/webship-js/...` as their
|
|
142
|
+
source of truth. That path does not exist here — translate it to
|
|
143
|
+
`tests/step-definitions/`, `docs/`, `bin/`. Running one of them
|
|
144
|
+
unmodified inside this repository reads the published copy from GitHub,
|
|
145
|
+
not the working tree. See `CLAUDE.md` §11.
|