@vardot/varbase-e2e 2.0.0
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/AGENTS.md +148 -0
- package/CLAUDE.md +544 -0
- package/README.md +22 -0
- package/bin/generate-reports.js +363 -0
- package/bin/init-varbase-e2e.js +330 -0
- package/bin/postinstall.js +26 -0
- package/cucumber.js +125 -0
- package/docs/00-quick-start.md +102 -0
- package/docs/01-getting-started.md +102 -0
- package/docs/02-bbr-smart-waits.md +77 -0
- package/docs/03-selector-registry.md +95 -0
- package/docs/04-step-reference.md +801 -0
- package/docs/05-web-first-assertions.md +91 -0
- package/docs/06-network-and-dialogs.md +83 -0
- package/docs/07-auth-state.md +75 -0
- package/docs/08-clock-mocking.md +59 -0
- package/docs/09-api-testing.md +114 -0
- package/docs/10-accessibility.md +167 -0
- package/docs/11-debugging.md +129 -0
- package/docs/12-ai-agent-guide.md +338 -0
- package/docs/13-faq.md +236 -0
- package/docs/14-recipes-cookbook.md +255 -0
- package/docs/15-tag-conventions.md +76 -0
- package/docs/16-ci-cd.md +90 -0
- package/docs/README.md +125 -0
- package/docs/advanced-screenshots/then-i-save-fullscreen-screenshot.md +36 -0
- package/docs/advanced-screenshots/then-i-save-width-x-height-screenshot.md +34 -0
- package/docs/advanced-screenshots/when-i-save-screenshot-name-filename.md +45 -0
- package/docs/advanced-screenshots.md +52 -0
- package/docs/advanced-selectors.md +18 -0
- package/docs/api-step-definitions.md +45 -0
- package/docs/global-settings.md +267 -0
- package/docs/install-varbase-e2e/ddev-varbase-e2e.md +52 -0
- package/docs/install-varbase-e2e.md +34 -0
- package/docs/overview.md +40 -0
- package/docs/step-definitions/given-i-am-anonymous-user.md +67 -0
- package/docs/step-definitions/given-i-am-homepage.md +68 -0
- package/docs/step-definitions/given-i-am-specific-page.md +72 -0
- package/docs/step-definitions/then-i-should-be.md +56 -0
- package/docs/step-definitions/then-i-should-see.md +62 -0
- package/docs/step-definitions/then-item-checkbox.md +54 -0
- package/docs/step-definitions/then-item-link-should-contain-url.md +84 -0
- package/docs/step-definitions/then-item-should-contain.md +67 -0
- package/docs/step-definitions/then-radio-button-value-should-be-selected.md +68 -0
- package/docs/step-definitions/then-response-status-code-should-be-number.md +69 -0
- package/docs/step-definitions/then-value-radio-button-selected.md +62 -0
- package/docs/step-definitions/when-i-attach-file-file-name-element.md +71 -0
- package/docs/step-definitions/when-i-check-checkbox.md +60 -0
- package/docs/step-definitions/when-i-click-link.md +51 -0
- package/docs/step-definitions/when-i-click-operation-text-row.md +71 -0
- package/docs/step-definitions/when-i-fill.md +59 -0
- package/docs/step-definitions/when-i-go-homepage.md +60 -0
- package/docs/step-definitions/when-i-go-specific-page.md +67 -0
- package/docs/step-definitions/when-i-move-backward-one-page.md +49 -0
- package/docs/step-definitions/when-i-move-forward-one-page.md +58 -0
- package/docs/step-definitions/when-i-press-button.md +58 -0
- package/docs/step-definitions/when-i-reload-page.md +51 -0
- package/docs/step-definitions/when-i-scroll.md +73 -0
- package/docs/step-definitions/when-i-select-option-select-list.md +53 -0
- package/docs/step-definitions/when-i-select-radio-button-value.md +62 -0
- package/docs/step-definitions/when-i-uncheck-checkbox.md +57 -0
- package/docs/step-definitions/when-i-wait-ajax-finish.md +64 -0
- package/docs/step-definitions/when-i-wait.md +62 -0
- package/docs/step-definitions.md +82 -0
- package/docs/steps/README.md +137 -0
- package/docs/steps/a11y.md +731 -0
- package/docs/steps/action.md +181 -0
- package/docs/steps/api.md +679 -0
- package/docs/steps/assertion.md +328 -0
- package/docs/steps/auth.md +108 -0
- package/docs/steps/clock.md +171 -0
- package/docs/steps/cookie.md +293 -0
- package/docs/steps/debug.md +52 -0
- package/docs/steps/dialog.md +226 -0
- package/docs/steps/drupal-canvas.md +414 -0
- package/docs/steps/drupal-ckeditor.md +118 -0
- package/docs/steps/drupal-core.md +688 -0
- package/docs/steps/drupal-layout-builder.md +437 -0
- package/docs/steps/drupal-media.md +107 -0
- package/docs/steps/drupal-moderation.md +81 -0
- package/docs/steps/drupal-paragraphs.md +36 -0
- package/docs/steps/element.md +455 -0
- package/docs/steps/field.md +648 -0
- package/docs/steps/file-download.md +235 -0
- package/docs/steps/form.md +344 -0
- package/docs/steps/iframe.md +248 -0
- package/docs/steps/input.md +220 -0
- package/docs/steps/javascript.md +111 -0
- package/docs/steps/keyboard.md +107 -0
- package/docs/steps/link.md +217 -0
- package/docs/steps/metatag.md +99 -0
- package/docs/steps/modal.md +232 -0
- package/docs/steps/navigation.md +275 -0
- package/docs/steps/network.md +284 -0
- package/docs/steps/path.md +203 -0
- package/docs/steps/response.md +102 -0
- package/docs/steps/responsive.md +139 -0
- package/docs/steps/rest.md +140 -0
- package/docs/steps/screenshot.md +211 -0
- package/docs/steps/scroll.md +266 -0
- package/docs/steps/selectors.md +848 -0
- package/docs/steps/storage.md +254 -0
- package/docs/steps/table.md +216 -0
- package/docs/steps/varbase.md +391 -0
- package/docs/steps/video.md +111 -0
- package/docs/steps/wait.md +553 -0
- package/docs/steps/web-first.md +289 -0
- package/docs/steps/xml.md +505 -0
- package/docs/steps/yaml.md +951 -0
- package/examples/a11y.html +31 -0
- package/examples/about-us.html +11 -0
- package/examples/account.html +32 -0
- package/examples/ajax-wait-examples.html +147 -0
- package/examples/contact-us.html +10 -0
- package/examples/cookies.html +10 -0
- package/examples/date.html +12 -0
- package/examples/dynamic-examples.html +498 -0
- package/examples/element.html +11 -0
- package/examples/example-api.json +28 -0
- package/examples/existing-page.html +11 -0
- package/examples/field.html +24 -0
- package/examples/index.html +37 -0
- package/examples/keyboard.html +11 -0
- package/examples/links.html +9 -0
- package/examples/modal.html +14 -0
- package/examples/path.html +3 -0
- package/examples/table.html +13 -0
- package/examples/test--modal-dialogs.html +252 -0
- package/examples/test--then--i-should--not--see-text-in-element.html +48 -0
- package/examples/test--then--i-should--see-text-in-element.html +48 -0
- package/examples/test--then--i-should--see-text-matching-pattern.html +31 -0
- package/examples/test--then--i-should-see-text-in-table-row.html +232 -0
- package/examples/test--then--the-checkbox-checked.html +68 -0
- package/examples/test--then--the-element-should_not-contain-cssproperty.html +47 -0
- package/examples/test--then--the-link-should-contain.html +21 -0
- package/examples/test--when--i-additionally-select.html +27 -0
- package/examples/test--when--i-attach-file-to-feild.html +50 -0
- package/examples/test--when--i-check-uncheck-checkbox.html +47 -0
- package/examples/test--when--i-click-link.html +18 -0
- package/examples/test--when--i-click-text-in-table-row.html +178 -0
- package/examples/test--when--i-fill-in.html +48 -0
- package/examples/test--when--i-press-button.html +31 -0
- package/examples/test--when--i-reload-page.html +27 -0
- package/examples/test--when--i-scroll-functionality.html +177 -0
- package/examples/test--when--i-scroll-left-right-functionality.html +149 -0
- package/examples/test--when--i-select-option-from-dropdownlist.html +35 -0
- package/examples/test--when--i-select-radio-button.html +95 -0
- package/examples/test--when-i-wait-max-of-time.html +39 -0
- package/examples/test--when-i-wait-page-until-is-loaded.html +47 -0
- package/examples/test--when-i-wait-specific-time.html +39 -0
- package/examples/test-acceptable-url-path.html +11 -0
- package/examples/video-demo.html +43 -0
- package/package.json +56 -0
- package/playwright.config.ts +39 -0
- package/tests/assets/test-document.pdf +14 -0
- package/tests/assets/vardot.png +0 -0
- package/tests/features/a11y.feature +39 -0
- package/tests/features/ajax-wait-examples.feature +24 -0
- package/tests/features/api-step-definitions-individual.feature +185 -0
- package/tests/features/complete-api-testing-examples.feature +205 -0
- package/tests/features/cookie.feature +13 -0
- package/tests/features/date.feature +11 -0
- package/tests/features/dynamic-content-examples.feature +156 -0
- package/tests/features/element.feature +16 -0
- package/tests/features/field.feature +25 -0
- package/tests/features/keyboard.feature +10 -0
- package/tests/features/link.feature +11 -0
- package/tests/features/modal-advanced-example.feature +54 -0
- package/tests/features/modal-basic-example.feature +42 -0
- package/tests/features/modal-error-handling-example.feature +37 -0
- package/tests/features/modal.feature +11 -0
- package/tests/features/path.feature +16 -0
- package/tests/features/response.feature +8 -0
- package/tests/features/responsive.feature +10 -0
- package/tests/features/table.feature +18 -0
- package/tests/features/test--given--i-am-an-anonymous-user.feature +10 -0
- package/tests/features/test--given--i-am-on-homepage.feature +16 -0
- package/tests/features/test--then--i-save-screenshot.feature +33 -0
- package/tests/features/test--then--i-see-locator.feature +320 -0
- package/tests/features/test--then--i-should--not--see-text-in-element.feature +13 -0
- package/tests/features/test--then--i-should--see-text-in-element-by-attr.feature +10 -0
- package/tests/features/test--then--i-should--see-text-in-element.feature +10 -0
- package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +13 -0
- package/tests/features/test--then--i-should--see-text-matching-pattern.feature +18 -0
- package/tests/features/test--then--i-should-be-on-page.feature +10 -0
- package/tests/features/test--then--i-should-be-on-the-homepage.feature +10 -0
- package/tests/features/test--then--i-should-not-see-an-element-by-attr.feature +8 -0
- package/tests/features/test--then--i-should-not-see-an-element.feature +8 -0
- package/tests/features/test--then--i-should-see-an-element-by-attr.feature +8 -0
- package/tests/features/test--then--i-should-see-an-element.feature +8 -0
- package/tests/features/test--then--i-should-see-n-elements.feature +24 -0
- package/tests/features/test--then--i-should-see-text-in-table-row.feature +96 -0
- package/tests/features/test--then--print-current-url-and-response.feature +21 -0
- package/tests/features/test--then--the-checkbox-is-checked.feature +18 -0
- package/tests/features/test--then--the-checkbox-should-be-checked.feature +16 -0
- package/tests/features/test--then--the-element-should-contain-cssproperty.feature +9 -0
- package/tests/features/test--then--the-element-should-not-contain-cssproperty.feature +10 -0
- package/tests/features/test--then--the-field-should-contain-value.feature +11 -0
- package/tests/features/test--then--the-response-should-contain.feature +11 -0
- package/tests/features/test--then--the-response-status-code-should-be.feature +31 -0
- package/tests/features/test--then--the-url-should-match.feature +7 -0
- package/tests/features/test--then-the-link-should-contain-by-attribute.feature +18 -0
- package/tests/features/test--then-the-link-should-contain.feature +7 -0
- package/tests/features/test--when--i-additionally-select.feature +30 -0
- package/tests/features/test--when--i-attach-file-to-feild.feature +9 -0
- package/tests/features/test--when--i-check-checkbox.feature +21 -0
- package/tests/features/test--when--i-click-link-by-attribute.feature +21 -0
- package/tests/features/test--when--i-click-link.feature +9 -0
- package/tests/features/test--when--i-click-text-in-table-row.feature +37 -0
- package/tests/features/test--when--i-fill-in-by-attr.feature +31 -0
- package/tests/features/test--when--i-fill-in-table-by-attr.feature +19 -0
- package/tests/features/test--when--i-fill-in.feature +32 -0
- package/tests/features/test--when--i-follow.feature +22 -0
- package/tests/features/test--when--i-go-to-homepage.feature +9 -0
- package/tests/features/test--when--i-move-forward-backward-one-page.feature +14 -0
- package/tests/features/test--when--i-press-button-by-attribute.feature +18 -0
- package/tests/features/test--when--i-press-button.feature +13 -0
- package/tests/features/test--when--i-reload-page.feature +11 -0
- package/tests/features/test--when--i-scroll-left-right.feature +48 -0
- package/tests/features/test--when--i-scroll.feature +48 -0
- package/tests/features/test--when--i-select-option-from-dropdownlist.feature +21 -0
- package/tests/features/test--when--i-select-radio-button.feature +37 -0
- package/tests/features/test--when--i-wait-page-is-loaded.feature +8 -0
- package/tests/features/test--when--i-wait-time.feature +21 -0
- package/tests/features/video.feature +18 -0
- package/tests/features/wait.feature +7 -0
- package/tests/features/yaml.feature +102 -0
- package/tests/selectors/_canonical-keys.json +113 -0
- package/tests/selectors/back-end-selectors.json +19 -0
- package/tests/selectors/cms-contentful-admin.json +35 -0
- package/tests/selectors/cms-craft-admin.json +39 -0
- package/tests/selectors/cms-drupal-cms-gin.json +56 -0
- package/tests/selectors/cms-drupal-core-claro.json +50 -0
- package/tests/selectors/cms-generic-admin.json +34 -0
- package/tests/selectors/cms-ghost-admin.json +34 -0
- package/tests/selectors/cms-joomla-admin.json +41 -0
- package/tests/selectors/cms-magento2-admin.json +32 -0
- package/tests/selectors/cms-prestashop-admin.json +38 -0
- package/tests/selectors/cms-shopify-admin.json +25 -0
- package/tests/selectors/cms-strapi-admin.json +42 -0
- package/tests/selectors/cms-typo3-admin.json +41 -0
- package/tests/selectors/cms-woocommerce-front.json +50 -0
- package/tests/selectors/cms-wordpress-admin.json +31 -0
- package/tests/selectors/framework-ant-design.json +80 -0
- package/tests/selectors/framework-bootstrap.json +86 -0
- package/tests/selectors/framework-bulma.json +74 -0
- package/tests/selectors/framework-chakra.json +58 -0
- package/tests/selectors/framework-foundation.json +51 -0
- package/tests/selectors/framework-material-ui.json +72 -0
- package/tests/selectors/framework-shadcn.json +51 -0
- package/tests/selectors/framework-tailwind.json +40 -0
- package/tests/selectors/framework-vuetify.json +61 -0
- package/tests/selectors/front-end-selectors.json +16 -0
- package/tests/selectors/homepage-selectors.json +13 -0
- package/tests/step-definitions/a11y.steps.js +800 -0
- package/tests/step-definitions/action.steps.js +167 -0
- package/tests/step-definitions/api.steps.js +732 -0
- package/tests/step-definitions/assertion.steps.js +352 -0
- package/tests/step-definitions/auth.steps.js +126 -0
- package/tests/step-definitions/clock.steps.js +128 -0
- package/tests/step-definitions/cookie.steps.js +216 -0
- package/tests/step-definitions/debug.steps.js +39 -0
- package/tests/step-definitions/dialog.steps.js +193 -0
- package/tests/step-definitions/drupal-canvas.steps.js +764 -0
- package/tests/step-definitions/drupal-ckeditor.steps.js +108 -0
- package/tests/step-definitions/drupal-core.steps.js +665 -0
- package/tests/step-definitions/drupal-helpers.js +371 -0
- package/tests/step-definitions/drupal-layout-builder.steps.js +466 -0
- package/tests/step-definitions/drupal-media.steps.js +99 -0
- package/tests/step-definitions/drupal-moderation.steps.js +71 -0
- package/tests/step-definitions/drupal-paragraphs.steps.js +50 -0
- package/tests/step-definitions/element.steps.js +356 -0
- package/tests/step-definitions/field.steps.js +653 -0
- package/tests/step-definitions/file-download.steps.js +211 -0
- package/tests/step-definitions/form.steps.js +333 -0
- package/tests/step-definitions/iframe.steps.js +228 -0
- package/tests/step-definitions/input.steps.js +202 -0
- package/tests/step-definitions/javascript.steps.js +232 -0
- package/tests/step-definitions/keyboard.steps.js +112 -0
- package/tests/step-definitions/link.steps.js +142 -0
- package/tests/step-definitions/metatag.steps.js +91 -0
- package/tests/step-definitions/modal.steps.js +244 -0
- package/tests/step-definitions/navigation.steps.js +218 -0
- package/tests/step-definitions/network.steps.js +280 -0
- package/tests/step-definitions/path.steps.js +141 -0
- package/tests/step-definitions/response.steps.js +98 -0
- package/tests/step-definitions/responsive.steps.js +125 -0
- package/tests/step-definitions/rest.steps.js +111 -0
- package/tests/step-definitions/screenshot.steps.js +423 -0
- package/tests/step-definitions/scroll.steps.js +189 -0
- package/tests/step-definitions/selectors.steps.js +1003 -0
- package/tests/step-definitions/storage.steps.js +194 -0
- package/tests/step-definitions/table.steps.js +181 -0
- package/tests/step-definitions/varbase-e2e.js +897 -0
- package/tests/step-definitions/varbase.steps.js +458 -0
- package/tests/step-definitions/video.steps.js +178 -0
- package/tests/step-definitions/wait.steps.js +400 -0
- package/tests/step-definitions/web-first.steps.js +298 -0
- package/tests/step-definitions/xml.steps.js +411 -0
- package/tests/step-definitions/yaml.steps.js +913 -0
- package/tsconfig.json +26 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# AGENTS.md — varbase-e2e
|
|
2
|
+
|
|
3
|
+
This file follows the [agents.md](https://agents.md) convention: short,
|
|
4
|
+
machine-readable rules for any AI agent (Claude, Codex, Cursor, Copilot,
|
|
5
|
+
etc.) working on the repository.
|
|
6
|
+
|
|
7
|
+
For full project context, read `CLAUDE.md` in the same directory — it is
|
|
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.
|
|
13
|
+
|
|
14
|
+
## Identity
|
|
15
|
+
|
|
16
|
+
varbase-e2e is a BDD browser-automation harness built on Playwright +
|
|
17
|
+
Cucumber-js. It is its own product. Never reference Behat, DrevOps,
|
|
18
|
+
Drupal, or PHP in code, file names, comments, or step phrasings.
|
|
19
|
+
|
|
20
|
+
## Hard rules
|
|
21
|
+
|
|
22
|
+
1. **No git commits.** The user commits manually. Never invoke
|
|
23
|
+
`git commit`, `git push`, `npm publish`, or anything that mutates a
|
|
24
|
+
shared repository / registry without explicit per-action consent.
|
|
25
|
+
2. **Update docs in the same change.** Step / selector / config changes
|
|
26
|
+
must update the matching page in `docs/`. A `worldParameters` change
|
|
27
|
+
must also update the scaffold template in `bin/init-varbase-e2e.js`.
|
|
28
|
+
3. **Stay green.** Every change must keep `npx cucumber-js --dry-run`
|
|
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.
|
|
33
|
+
4. **Backups.** When asked, bump `package.json` `version` and emit
|
|
34
|
+
`~/workspace/products/varbase-e2e-<version>.zip` excluding
|
|
35
|
+
`node_modules/`, `tests/reports/`, `screenshots/`, `.git/`.
|
|
36
|
+
|
|
37
|
+
## Step definition rules
|
|
38
|
+
|
|
39
|
+
* Use a regex with `(I |we )*` — never `'I ...'` Cucumber Expressions
|
|
40
|
+
unless the step genuinely cannot start with a pronoun.
|
|
41
|
+
* Write step text in plain English. Avoid camelCase identifiers
|
|
42
|
+
(`local storage`, not `localStorage`).
|
|
43
|
+
* Every step needs a JSDoc block with at least 5 `Example #N:` Gherkin
|
|
44
|
+
lines. Each example header line must match the step pattern when the
|
|
45
|
+
Gherkin keyword is stripped.
|
|
46
|
+
* No static `sleep` calls. Wait steps go through `smartSettle()` in
|
|
47
|
+
`varbase-e2e.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.
|
|
51
|
+
* Place new steps in the file whose topic matches. Don't create a new
|
|
52
|
+
file unless the topic is genuinely orthogonal to every existing one.
|
|
53
|
+
|
|
54
|
+
## Do-not-merge boundaries
|
|
55
|
+
|
|
56
|
+
| Pair | Reason |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `modal.steps.js` vs `dialog.steps.js` | HTML modal overlay vs native browser alert/confirm/prompt. |
|
|
59
|
+
| `field.steps.js` vs `form.steps.js` | CSS-selector field control vs label/placeholder/name form fills. |
|
|
60
|
+
| `xml.steps.js` vs `yaml.steps.js` | Different parsers and different path conventions. |
|
|
61
|
+
| `api.steps.js` vs `rest.steps.js` | Long-form (header + body table) vs short-form REST steps. |
|
|
62
|
+
| `web-first.steps.js` vs `assertion.steps.js` | Auto-retrying matchers vs single-snapshot assertions. |
|
|
63
|
+
| `element.steps.js` vs `input.steps.js` | Element-scoped (`the element "X"`) vs short pointer (`"X"`). |
|
|
64
|
+
|
|
65
|
+
## Quick prompt templates
|
|
66
|
+
|
|
67
|
+
**New feature file:** REASONS canvas → comments → Background → Scenarios →
|
|
68
|
+
tags → run.
|
|
69
|
+
|
|
70
|
+
**New step:** search first — if a match exists, point at it instead of
|
|
71
|
+
duplicating. Place by topic. Regex with `(I |we )*`. Plain English. JSDoc
|
|
72
|
+
with ≥5 examples. Friendly try/catch for locator actions.
|
|
73
|
+
|
|
74
|
+
**Maintenance:** run suite → group failures → fix selectors in JSON
|
|
75
|
+
preset (not feature files) → re-run → iterate.
|
|
76
|
+
|
|
77
|
+
**Flaky debug:** `HEADLESS=false SLOW_MO=800` → screenshots/ → replace
|
|
78
|
+
sleeps with edge waits.
|
|
79
|
+
|
|
80
|
+
## Workflow checklist
|
|
81
|
+
|
|
82
|
+
Before reporting a task complete:
|
|
83
|
+
|
|
84
|
+
* [ ] Ran `npx cucumber-js --dry-run` — no ambiguity, no undefined steps.
|
|
85
|
+
* [ ] Ran the affected feature(s) via `LAUNCH_URL=http://localhost:8080 npx cucumber-js <path>`.
|
|
86
|
+
* [ ] Updated `docs/04-step-reference.md` and the topic doc if a step or
|
|
87
|
+
selector preset changed.
|
|
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-varbase-e2e.js` if `worldParameters` changed.
|
|
91
|
+
* [ ] Verified examples match patterns (no audit mismatches).
|
|
92
|
+
* [ ] Bumped version + produced backup zip if user requested it.
|
|
93
|
+
|
|
94
|
+
## Wisdom from the Recipes book
|
|
95
|
+
|
|
96
|
+
`docs/12-ai-agent-guide.md` is the AI-specific guide distilled from
|
|
97
|
+
*Varbase-E2E-Recipes v1.0.30*. Read it before authoring features or
|
|
98
|
+
step definitions. Critical takeaways:
|
|
99
|
+
|
|
100
|
+
* **AI generates. Humans validate. Tests verify.**
|
|
101
|
+
* **Test-Drive-Develop:** human writes Gherkin → AI implements → tests
|
|
102
|
+
decide pass / fail.
|
|
103
|
+
* **SPDD REASONS canvas** (Requirements, Entities, Approach, Structure,
|
|
104
|
+
Operations, Norms, Safeguards) — apply it before writing any
|
|
105
|
+
`Scenario:` lines on high-value features.
|
|
106
|
+
* **Fix the prompt first** when reality diverges.
|
|
107
|
+
* **One scenario, one behaviour. Wait for events, not time. Test
|
|
108
|
+
behaviour, not implementation.**
|
|
109
|
+
|
|
110
|
+
## Source map
|
|
111
|
+
|
|
112
|
+
Step definitions: `tests/step-definitions/` — 495 steps across 44
|
|
113
|
+
`*.steps.js` files, all auto-loaded, including the Drupal and Varbase packs
|
|
114
|
+
(`drupal-core`, `drupal-ckeditor`, `drupal-media`, `drupal-moderation`,
|
|
115
|
+
`drupal-layout-builder`, `drupal-paragraphs`, `drupal-canvas`, `varbase`)
|
|
116
|
+
with their shared plumbing in `drupal-helpers.js`. The `varbase-e2e.js` file there is the
|
|
117
|
+
single canonical entry point — World, hooks, init script, and shared
|
|
118
|
+
helpers (`smartSettle`, `waitForPageLoad`, `buildSelector`, `gotoUrl`,
|
|
119
|
+
`fillField`, `getLocatorText`, `pad`, the modal probes
|
|
120
|
+
`getModalSelector` / `getModalLocator` / `waitForModalState` /
|
|
121
|
+
`findVisibleModal` / `isAnyModalVisible`, the date helpers
|
|
122
|
+
`resolveRelativeDate` / `parseRelativeOffset` / `formatRelativeDate`, and
|
|
123
|
+
the error builders `friendly` / `humanize`). It also owns two
|
|
124
|
+
process-level side effects: the stdout hook-line filter and the auto HTML
|
|
125
|
+
report on exit.
|
|
126
|
+
|
|
127
|
+
Docs: `docs/` — see `docs/README.md` for the reading order.
|
|
128
|
+
|
|
129
|
+
Selector presets: `tests/selectors/*.json` — 26 presets. Canonical key
|
|
130
|
+
list: `tests/selectors/_canonical-keys.json`.
|
|
131
|
+
|
|
132
|
+
Config: `cucumber.js` (`worldParameters`, annotated) and
|
|
133
|
+
`playwright.config.ts` (browser launch + context), plus the scaffold
|
|
134
|
+
template in `bin/init-varbase-e2e.js` that must mirror them.
|
|
135
|
+
|
|
136
|
+
Visual regression: extracted to the [`diffy-steps`](https://github.com/webship/diffy-steps)
|
|
137
|
+
plugin — not in this repository.
|
|
138
|
+
|
|
139
|
+
## This repo is the package
|
|
140
|
+
|
|
141
|
+
varbase-e2e ships `tests/` to consumers on npm, so `tests/` is both the
|
|
142
|
+
step library and its own test suite. The local agents and skills that
|
|
143
|
+
drive this project (`agent-varbase-e2e`, `varbase-e2e-ai-agent`, and the
|
|
144
|
+
`/varbase-e2e-*` skills) all read `node_modules/@vardot/varbase-e2e/...` as their
|
|
145
|
+
source of truth. That path does not exist here — translate it to
|
|
146
|
+
`tests/step-definitions/`, `docs/`, `bin/`. Running one of them
|
|
147
|
+
unmodified inside this repository reads the published copy from GitHub,
|
|
148
|
+
not the working tree. See `CLAUDE.md` §11.
|