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
package/.drone.yml CHANGED
File without changes
File without changes
File without changes
package/.teamcity/pom.xml CHANGED
File without changes
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. This file extracts the critical rules that
9
- every agent must respect.
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
- `/var/www/html/products/webship-js-<version>.zip` excluding
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 new step file was added.
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/`. The `webship.js` file there
100
- is the single canonical entry point — World, hooks, init script, and
101
- shared helpers (`smartSettle`, `getModalLocator`, `buildSelector`,
102
- `gotoUrl`, `fillField`, `getLocatorText`, `pad`, `waitForPageLoad`,
103
- `waitForModalState`, `findVisibleModal`, `isAnyModalVisible`,
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`. Canonical key list:
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.