@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
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
# Waits steps
|
|
2
|
+
|
|
3
|
+
21 steps, defined in `tests/step-definitions/wait.steps.js`.
|
|
4
|
+
|
|
5
|
+
Cucumber-js loads every `*.steps.js` in that directory automatically — you never `require()` a step file from a feature.
|
|
6
|
+
|
|
7
|
+
| # | Step |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| 1 | `When I wait for 1 second` |
|
|
10
|
+
| 2 | `When I wait for 1 second for AJAX to finish` |
|
|
11
|
+
| 3 | `When I wait 1 second` |
|
|
12
|
+
| 4 | `When I wait max of 1 second` |
|
|
13
|
+
| 5 | `When I wait 1 minute` |
|
|
14
|
+
| 6 | `When I wait max of 1 minute` |
|
|
15
|
+
| 7 | `When I wait until the page is loaded` |
|
|
16
|
+
| 8 | `When I wait for AJAX to finish` |
|
|
17
|
+
| 9 | `When I wait for the modal to appear` |
|
|
18
|
+
| 10 | `When I wait for "#dashboard" to appear` |
|
|
19
|
+
| 11 | `When I wait for "#loading-spinner" to disappear` |
|
|
20
|
+
| 12 | `When I wait for the text "Dashboard" to appear` |
|
|
21
|
+
| 13 | `When I wait for the text "Loading…" to disappear` |
|
|
22
|
+
| 14 | `When I wait until the URL contains "/dashboard"` |
|
|
23
|
+
| 15 | `When I wait until the page title is "Dashboard - MyApp"` |
|
|
24
|
+
| 16 | `When I wait until 5 elements match ".product-card"` |
|
|
25
|
+
| 17 | `When I wait until at least 3 elements match ".item"` |
|
|
26
|
+
| 18 | `When I wait until the network is idle` |
|
|
27
|
+
| 19 | `When I wait until the page is interactive` |
|
|
28
|
+
| 20 | `When I wait until pending timers settle` |
|
|
29
|
+
| 21 | `Then eventually I should see "Done"` |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 1. When I wait for 1 second
|
|
34
|
+
|
|
35
|
+
Wait UP TO N seconds for the page to settle. Returns early on idle.
|
|
36
|
+
|
|
37
|
+
"Settle" = DOM ready, no in-flight fetch/XHR, no pending setTimeout
|
|
38
|
+
callbacks, and no MutationObserver activity for at least 250 ms.
|
|
39
|
+
|
|
40
|
+
**Keyword**: `When`
|
|
41
|
+
|
|
42
|
+
**Pattern**
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
/^(I |we )*wait for (\d+) seconds?$/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Examples**
|
|
49
|
+
|
|
50
|
+
```gherkin
|
|
51
|
+
When I wait for 1 second
|
|
52
|
+
When I wait for 5 seconds
|
|
53
|
+
And I wait for 3 seconds
|
|
54
|
+
When we wait for 2 seconds
|
|
55
|
+
And we wait for 10 seconds
|
|
56
|
+
When I press "Save"
|
|
57
|
+
And I wait for 2 seconds
|
|
58
|
+
Then I should see "Saved"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 2. When I wait for 1 second for AJAX to finish
|
|
62
|
+
|
|
63
|
+
Wait UP TO N seconds for the page (and AJAX) to settle. Returns early.
|
|
64
|
+
|
|
65
|
+
Same probe as `wait for N seconds` — kept for legacy phrasing parity with
|
|
66
|
+
older feature files that say "for AJAX to finish" explicitly.
|
|
67
|
+
|
|
68
|
+
**Keyword**: `When`
|
|
69
|
+
|
|
70
|
+
**Pattern**
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
/^(I |we )*wait for (\d+) seconds? for AJAX to finish$/
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Examples**
|
|
77
|
+
|
|
78
|
+
```gherkin
|
|
79
|
+
When I wait for 1 second for AJAX to finish
|
|
80
|
+
When I wait for 3 seconds for AJAX to finish
|
|
81
|
+
And I wait for 5 seconds for AJAX to finish
|
|
82
|
+
When we wait for 2 seconds for AJAX to finish
|
|
83
|
+
When I press "Search"
|
|
84
|
+
And I wait for 5 seconds for AJAX to finish
|
|
85
|
+
Then I should see "Results"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 3. When I wait 1 second
|
|
89
|
+
|
|
90
|
+
Wait UP TO a number of seconds for the page to settle.
|
|
91
|
+
|
|
92
|
+
**Keyword**: `When`
|
|
93
|
+
|
|
94
|
+
**Pattern**
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
/^(I |we )*wait (\d+)( second| seconds|s)?$/
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Examples**
|
|
101
|
+
|
|
102
|
+
```gherkin
|
|
103
|
+
When I wait 1 second
|
|
104
|
+
When I wait 5 seconds
|
|
105
|
+
When we wait 3s
|
|
106
|
+
And wait 2s
|
|
107
|
+
And wait 2 seconds
|
|
108
|
+
When we wait 1 second
|
|
109
|
+
When we wait 5 seconds
|
|
110
|
+
When we wait 4s
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 4. When I wait max of 1 second
|
|
114
|
+
|
|
115
|
+
Wait UP TO a maximum number of seconds for the page to settle.
|
|
116
|
+
|
|
117
|
+
**Keyword**: `When`
|
|
118
|
+
|
|
119
|
+
**Pattern**
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
/^(I |we )*wait max of (\d+)( second| seconds|s)?$/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Examples**
|
|
126
|
+
|
|
127
|
+
```gherkin
|
|
128
|
+
When I wait max of 1 second
|
|
129
|
+
When I wait max of 5 seconds
|
|
130
|
+
When we wait max of 3s
|
|
131
|
+
And wait max of 2s
|
|
132
|
+
And wait max of 2 seconds
|
|
133
|
+
When we wait max of 1 second
|
|
134
|
+
When we wait max of 5 seconds
|
|
135
|
+
When we wait max of 4s
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 5. When I wait 1 minute
|
|
139
|
+
|
|
140
|
+
Wait UP TO a number of minutes for the page to settle.
|
|
141
|
+
|
|
142
|
+
**Keyword**: `When`
|
|
143
|
+
|
|
144
|
+
**Pattern**
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
/^(I |we )*wait (\d+)( minute| minutes|m)?$/
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Examples**
|
|
151
|
+
|
|
152
|
+
```gherkin
|
|
153
|
+
When I wait 1 minute
|
|
154
|
+
When I wait 10 minutes
|
|
155
|
+
When we wait 1m
|
|
156
|
+
And wait 2m
|
|
157
|
+
And wait 2 minutes
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## 6. When I wait max of 1 minute
|
|
161
|
+
|
|
162
|
+
Wait UP TO a maximum number of minutes for the page to settle.
|
|
163
|
+
|
|
164
|
+
**Keyword**: `When`
|
|
165
|
+
|
|
166
|
+
**Pattern**
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
/^(I |we )*wait max of (\d+)( minute| minutes|m)?$/
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Examples**
|
|
173
|
+
|
|
174
|
+
```gherkin
|
|
175
|
+
When I wait max of 1 minute
|
|
176
|
+
When I wait max of 10 minutes
|
|
177
|
+
When we wait max of 1m
|
|
178
|
+
And wait max of 2m
|
|
179
|
+
And wait max of 2 minutes
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## 7. When I wait until the page is loaded
|
|
183
|
+
|
|
184
|
+
Wait until the page is loaded.
|
|
185
|
+
|
|
186
|
+
**Keyword**: `When`
|
|
187
|
+
|
|
188
|
+
**Pattern**
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
/^(I |we )*wait until( the)* page( is)* loaded*$/
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Examples**
|
|
195
|
+
|
|
196
|
+
```gherkin
|
|
197
|
+
When I wait until the page is loaded
|
|
198
|
+
When we wait until the page is loaded
|
|
199
|
+
When wait until page loaded
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## 8. When I wait for AJAX to finish
|
|
203
|
+
|
|
204
|
+
Wait for active XHR/fetch requests to complete.
|
|
205
|
+
|
|
206
|
+
**Keyword**: `When`
|
|
207
|
+
|
|
208
|
+
**Pattern**
|
|
209
|
+
|
|
210
|
+
```js
|
|
211
|
+
/^(I |we )*wait for AJAX to finish$/
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Examples**
|
|
215
|
+
|
|
216
|
+
```gherkin
|
|
217
|
+
When I wait for AJAX to finish
|
|
218
|
+
And I wait for AJAX to finish
|
|
219
|
+
When we wait for AJAX to finish
|
|
220
|
+
And wait for AJAX to finish
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 9. When I wait for the modal to appear
|
|
224
|
+
|
|
225
|
+
Wait for a modal dialog to appear or disappear.
|
|
226
|
+
|
|
227
|
+
**Keyword**: `When`
|
|
228
|
+
|
|
229
|
+
**Pattern**
|
|
230
|
+
|
|
231
|
+
```js
|
|
232
|
+
/^(I |we )*wait for( the)* modal( dialog)* to (appear|disappear)$/
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Examples**
|
|
236
|
+
|
|
237
|
+
```gherkin
|
|
238
|
+
When I wait for the modal to appear
|
|
239
|
+
When I wait for the modal to disappear
|
|
240
|
+
When we wait for modal to appear
|
|
241
|
+
And I wait for the modal dialog to disappear
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## 10. When I wait for "#dashboard" to appear
|
|
245
|
+
|
|
246
|
+
Wait until a CSS selector becomes visible. Returns the moment the
|
|
247
|
+
matching element is on screen (display !== 'none', visibility !== 'hidden',
|
|
248
|
+
has a non-zero box). This is the canonical "wait until X appears" probe.
|
|
249
|
+
|
|
250
|
+
**Keyword**: `When`
|
|
251
|
+
|
|
252
|
+
**Pattern**
|
|
253
|
+
|
|
254
|
+
```js
|
|
255
|
+
/^(I |we )*wait for "([^"]*)" to appear$/
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Examples**
|
|
259
|
+
|
|
260
|
+
```gherkin
|
|
261
|
+
When I wait for "#dashboard" to appear
|
|
262
|
+
When I wait for ".success-banner" to appear
|
|
263
|
+
And I wait for "[data-testid=user-list]" to appear
|
|
264
|
+
When we wait for ".modal.show" to appear
|
|
265
|
+
When I press "Save"
|
|
266
|
+
And I wait for ".toast-success" to appear
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## 11. When I wait for "#loading-spinner" to disappear
|
|
270
|
+
|
|
271
|
+
Wait until a CSS selector becomes hidden (display:none, visibility:hidden,
|
|
272
|
+
detached, or zero-size).
|
|
273
|
+
|
|
274
|
+
**Keyword**: `When`
|
|
275
|
+
|
|
276
|
+
**Pattern**
|
|
277
|
+
|
|
278
|
+
```js
|
|
279
|
+
/^(I |we )*wait for "([^"]*)" to disappear$/
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Examples**
|
|
283
|
+
|
|
284
|
+
```gherkin
|
|
285
|
+
When I wait for "#loading-spinner" to disappear
|
|
286
|
+
When I wait for ".overlay" to disappear
|
|
287
|
+
And I wait for ".modal.show" to disappear
|
|
288
|
+
When we wait for "[data-testid=skeleton]" to disappear
|
|
289
|
+
When I press "Submit"
|
|
290
|
+
And I wait for ".loader" to disappear
|
|
291
|
+
Then I should see "Saved"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## 12. When I wait for the text "Dashboard" to appear
|
|
295
|
+
|
|
296
|
+
Wait until visible text appears anywhere on the page.
|
|
297
|
+
|
|
298
|
+
Polls `document.body.innerText` every 100 ms for up to 10 s. Match is
|
|
299
|
+
case-sensitive substring.
|
|
300
|
+
|
|
301
|
+
**Keyword**: `When`
|
|
302
|
+
|
|
303
|
+
**Pattern**
|
|
304
|
+
|
|
305
|
+
```js
|
|
306
|
+
/^(I |we )*wait for( the)* text "([^"]*)" to appear$/
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Examples**
|
|
310
|
+
|
|
311
|
+
```gherkin
|
|
312
|
+
When I wait for the text "Dashboard" to appear
|
|
313
|
+
When I wait for the text "Loading complete" to appear
|
|
314
|
+
And I wait for text "Welcome" to appear
|
|
315
|
+
When we wait for the text "Order #1234" to appear
|
|
316
|
+
When I press "Submit"
|
|
317
|
+
And I wait for the text "Thank you" to appear
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## 13. When I wait for the text "Loading…" to disappear
|
|
321
|
+
|
|
322
|
+
Wait until visible text is gone from the page.
|
|
323
|
+
|
|
324
|
+
**Keyword**: `When`
|
|
325
|
+
|
|
326
|
+
**Pattern**
|
|
327
|
+
|
|
328
|
+
```js
|
|
329
|
+
/^(I |we )*wait for( the)* text "([^"]*)" to disappear$/
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**Examples**
|
|
333
|
+
|
|
334
|
+
```gherkin
|
|
335
|
+
When I wait for the text "Loading…" to disappear
|
|
336
|
+
When I wait for the text "Saving" to disappear
|
|
337
|
+
And I wait for text "Pending" to disappear
|
|
338
|
+
When we wait for the text "Connecting" to disappear
|
|
339
|
+
When I press "Submit"
|
|
340
|
+
And I wait for the text "Validating" to disappear
|
|
341
|
+
Then I should see "Done"
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## 14. When I wait until the URL contains "/dashboard"
|
|
345
|
+
|
|
346
|
+
Wait until the current URL contains a fragment.
|
|
347
|
+
|
|
348
|
+
Useful after a redirect, push-state navigation, or hash-based routing.
|
|
349
|
+
|
|
350
|
+
**Keyword**: `When`
|
|
351
|
+
|
|
352
|
+
**Pattern**
|
|
353
|
+
|
|
354
|
+
```js
|
|
355
|
+
/^(I |we )*wait until( the)* URL contains "([^"]*)"$/
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Examples**
|
|
359
|
+
|
|
360
|
+
```gherkin
|
|
361
|
+
When I wait until the URL contains "/dashboard"
|
|
362
|
+
When I wait until the URL contains "?step=2"
|
|
363
|
+
And I wait until the URL contains "#confirmation"
|
|
364
|
+
When we wait until the URL contains "/orders/"
|
|
365
|
+
When I follow "Sign in"
|
|
366
|
+
And I wait until the URL contains "/auth/callback"
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## 15. When I wait until the page title is "Dashboard - MyApp"
|
|
370
|
+
|
|
371
|
+
Wait until `document.title` equals (`is`) or contains the given value.
|
|
372
|
+
|
|
373
|
+
**Keyword**: `When`
|
|
374
|
+
|
|
375
|
+
**Pattern**
|
|
376
|
+
|
|
377
|
+
```js
|
|
378
|
+
/^(I |we )*wait until( the)* page title (is|contains) "([^"]*)"$/
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Examples**
|
|
382
|
+
|
|
383
|
+
```gherkin
|
|
384
|
+
When I wait until the page title is "Dashboard - MyApp"
|
|
385
|
+
When I wait until the page title contains "Dashboard"
|
|
386
|
+
And I wait until the page title contains "(3 unread)"
|
|
387
|
+
When we wait until the page title is "Order Placed"
|
|
388
|
+
When I follow "Inbox"
|
|
389
|
+
And I wait until the page title contains "Inbox"
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## 16. When I wait until 5 elements match ".product-card"
|
|
393
|
+
|
|
394
|
+
Wait until exactly N elements match a CSS selector.
|
|
395
|
+
|
|
396
|
+
Use 0 to wait for elements to disappear, or a positive count to wait for
|
|
397
|
+
a specific number to render.
|
|
398
|
+
|
|
399
|
+
**Keyword**: `When`
|
|
400
|
+
|
|
401
|
+
**Pattern**
|
|
402
|
+
|
|
403
|
+
```js
|
|
404
|
+
/^(I |we )*wait until (\d+) elements? match(?:es)? "([^"]*)"$/
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Examples**
|
|
408
|
+
|
|
409
|
+
```gherkin
|
|
410
|
+
When I wait until 5 elements match ".product-card"
|
|
411
|
+
When I wait until 0 elements match ".loading-skeleton"
|
|
412
|
+
And I wait until 1 element matches ".active-row"
|
|
413
|
+
When we wait until 10 elements match "tr.user"
|
|
414
|
+
When I press "Load more"
|
|
415
|
+
And I wait until 20 elements match ".feed-item"
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
## 17. When I wait until at least 3 elements match ".item"
|
|
419
|
+
|
|
420
|
+
Wait until at least N elements match a CSS selector.
|
|
421
|
+
|
|
422
|
+
Useful for infinite-scroll / pagination tests where the lower bound matters
|
|
423
|
+
but the exact count may vary.
|
|
424
|
+
|
|
425
|
+
**Keyword**: `When`
|
|
426
|
+
|
|
427
|
+
**Pattern**
|
|
428
|
+
|
|
429
|
+
```js
|
|
430
|
+
/^(I |we )*wait until at least (\d+) elements? match(?:es)? "([^"]*)"$/
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Examples**
|
|
434
|
+
|
|
435
|
+
```gherkin
|
|
436
|
+
When I wait until at least 3 elements match ".item"
|
|
437
|
+
When I wait until at least 1 element matches ".notification"
|
|
438
|
+
And I wait until at least 10 elements match ".feed-item"
|
|
439
|
+
When we wait until at least 5 elements match "tr"
|
|
440
|
+
When I scroll to the bottom
|
|
441
|
+
And I wait until at least 25 elements match ".product-card"
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## 18. When I wait until the network is idle
|
|
445
|
+
|
|
446
|
+
Wait until the network goes quiet (full smart settle, 10 s budget).
|
|
447
|
+
|
|
448
|
+
Three equivalent phrasings.
|
|
449
|
+
|
|
450
|
+
**Keyword**: `When`
|
|
451
|
+
|
|
452
|
+
**Pattern**
|
|
453
|
+
|
|
454
|
+
```js
|
|
455
|
+
/^(I |we )*wait until (the network is idle|requests are complete|network goes quiet)$/
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Examples**
|
|
459
|
+
|
|
460
|
+
```gherkin
|
|
461
|
+
When I wait until the network is idle
|
|
462
|
+
And I wait until requests are complete
|
|
463
|
+
When we wait until network goes quiet
|
|
464
|
+
When I press "Search"
|
|
465
|
+
And I wait until the network is idle
|
|
466
|
+
Then I should see "Results"
|
|
467
|
+
When I press "Refresh"
|
|
468
|
+
And I wait until requests are complete
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## 19. When I wait until the page is interactive
|
|
472
|
+
|
|
473
|
+
Wait until the page is interactive (DOMContentLoaded + body attached).
|
|
474
|
+
|
|
475
|
+
Lighter than `wait until the network is idle` — does not wait for late
|
|
476
|
+
fetch/XHR. Useful when you need to interact with the document early.
|
|
477
|
+
|
|
478
|
+
**Keyword**: `When`
|
|
479
|
+
|
|
480
|
+
**Pattern**
|
|
481
|
+
|
|
482
|
+
```js
|
|
483
|
+
/^(I |we )*wait until( the)* page is interactive$/
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
**Examples**
|
|
487
|
+
|
|
488
|
+
```gherkin
|
|
489
|
+
When I wait until the page is interactive
|
|
490
|
+
Given I am on "/heavy-page"
|
|
491
|
+
When I wait until the page is interactive
|
|
492
|
+
And I wait until the page is interactive
|
|
493
|
+
When we wait until the page is interactive
|
|
494
|
+
Given I am on "/spa"
|
|
495
|
+
When I wait until the page is interactive
|
|
496
|
+
Then "<#root>" should be attached
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
## 20. When I wait until pending timers settle
|
|
500
|
+
|
|
501
|
+
Wait until every tracked `setTimeout` callback has fired.
|
|
502
|
+
|
|
503
|
+
Catches "fade-out then display:none" close transitions, debounced renders,
|
|
504
|
+
and any UI flow that schedules a delayed update without making a network
|
|
505
|
+
request. Reads `window.__varbaseE2ePendingTimers`, the counter installed by
|
|
506
|
+
varbase-e2e.js's init script.
|
|
507
|
+
|
|
508
|
+
**Keyword**: `When`
|
|
509
|
+
|
|
510
|
+
**Pattern**
|
|
511
|
+
|
|
512
|
+
```js
|
|
513
|
+
/^(I |we )*wait until pending timers settle$/
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**Examples**
|
|
517
|
+
|
|
518
|
+
```gherkin
|
|
519
|
+
When I wait until pending timers settle
|
|
520
|
+
When I press "Close"
|
|
521
|
+
And I wait until pending timers settle
|
|
522
|
+
Then I should not see the modal
|
|
523
|
+
And I wait until pending timers settle
|
|
524
|
+
When we wait until pending timers settle
|
|
525
|
+
When I press "Toast"
|
|
526
|
+
And I wait until pending timers settle
|
|
527
|
+
Then I should not see "Saved"
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
## 21. Then eventually I should see "Done"
|
|
531
|
+
|
|
532
|
+
Pollable text assertion — retries the inner step until passing or timeout.
|
|
533
|
+
|
|
534
|
+
Use sparingly; prefer explicit edge waits (`wait for "X" to appear`).
|
|
535
|
+
|
|
536
|
+
**Keyword**: `When`
|
|
537
|
+
|
|
538
|
+
**Pattern**
|
|
539
|
+
|
|
540
|
+
```js
|
|
541
|
+
/^eventually (I |we )*should see "([^"]*)"(?: within (\d+) seconds?)?$/
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
**Examples**
|
|
545
|
+
|
|
546
|
+
```gherkin
|
|
547
|
+
Then eventually I should see "Done"
|
|
548
|
+
Then eventually I should see "Loaded" within 5 seconds
|
|
549
|
+
And eventually we should see "Saved"
|
|
550
|
+
Then eventually I should see "Order Confirmed" within 30 seconds
|
|
551
|
+
When I press "Submit"
|
|
552
|
+
Then eventually I should see "Submitted" within 8 seconds
|
|
553
|
+
```
|