@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,62 @@
|
|
|
1
|
+
|
|
2
|
+
# When I select radio button "value"
|
|
3
|
+
|
|
4
|
+
## Step Definition
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
When (I |we ) select radio button "([^"]*)?"`
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Selects the radio button specified by label text, value, or selector.
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
When I select radio button "Male"
|
|
18
|
+
When I select radio button "female"
|
|
19
|
+
When I select radio button "#gender-male"
|
|
20
|
+
When we select radio button "option1"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage Notes
|
|
24
|
+
|
|
25
|
+
The step accepts multiple input types: label text, value attributes, or CSS selectors to identify and select the target radio button element.
|
|
26
|
+
|
|
27
|
+
## More examples
|
|
28
|
+
|
|
29
|
+
<!-- generated: extended-examples -->
|
|
30
|
+
|
|
31
|
+
### Example 1
|
|
32
|
+
|
|
33
|
+
```gherkin
|
|
34
|
+
When I select radio button "Male"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Example 2
|
|
38
|
+
|
|
39
|
+
```gherkin
|
|
40
|
+
When I select radio button "#gender-female"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Example 3
|
|
44
|
+
|
|
45
|
+
```gherkin
|
|
46
|
+
And we select radio button "Premium"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Example 4
|
|
50
|
+
|
|
51
|
+
```gherkin
|
|
52
|
+
When I select radio button "monthly"
|
|
53
|
+
Then the radio button with value "monthly" should be selected
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Example 5
|
|
57
|
+
|
|
58
|
+
```gherkin
|
|
59
|
+
When I select radio button "Yes"
|
|
60
|
+
And I press "Continue"
|
|
61
|
+
```
|
|
62
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
# When I uncheck "checkbox"
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
This step definition serves as a command to clear/deselect a checkbox element.
|
|
6
|
+
|
|
7
|
+
## Gherkin Syntax
|
|
8
|
+
```
|
|
9
|
+
When (I|we)* uncheck "([^"]*)?"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
Define the step of unchecking the checkbox element specified by id|class|name|label.
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
**Example (1): label**
|
|
18
|
+
```
|
|
19
|
+
When we uncheck "Remember me"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Example (2): id/class**
|
|
23
|
+
```
|
|
24
|
+
When I uncheck "rememberme"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## More examples
|
|
28
|
+
|
|
29
|
+
<!-- generated: extended-examples -->
|
|
30
|
+
|
|
31
|
+
### Example 1
|
|
32
|
+
|
|
33
|
+
```gherkin
|
|
34
|
+
When I uncheck "Remember me"
|
|
35
|
+
And I press "Sign in"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Example 2
|
|
39
|
+
|
|
40
|
+
```gherkin
|
|
41
|
+
When I uncheck "#newsletter"
|
|
42
|
+
Then the "#newsletter" checkbox should not be checked
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Example 3
|
|
46
|
+
|
|
47
|
+
```gherkin
|
|
48
|
+
When we uncheck ".terms"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Example 4
|
|
52
|
+
|
|
53
|
+
```gherkin
|
|
54
|
+
When I uncheck "Subscribe to updates"
|
|
55
|
+
Then the checkbox "#subscribe" is not checked
|
|
56
|
+
```
|
|
57
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
# When I wait for AJAX to finish
|
|
3
|
+
|
|
4
|
+
## Step Definition
|
|
5
|
+
|
|
6
|
+
```gherkin
|
|
7
|
+
'When (I |we )*wait for AJAX to finish'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
"This step waits for an active XMLHttpRequest and Fetch API requests to complete."
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
```gherkin
|
|
17
|
+
When I wait for AJAX to finish
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```gherkin
|
|
21
|
+
And I wait for AJAX to finish
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```gherkin
|
|
25
|
+
When we wait for AJAX to finish
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```gherkin
|
|
29
|
+
And wait for AJAX to finish
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## More examples
|
|
33
|
+
|
|
34
|
+
<!-- generated: extended-examples -->
|
|
35
|
+
|
|
36
|
+
### Example 1
|
|
37
|
+
|
|
38
|
+
```gherkin
|
|
39
|
+
When I press "Search"
|
|
40
|
+
And I wait for AJAX to finish
|
|
41
|
+
Then I should see "Results"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Example 2
|
|
45
|
+
|
|
46
|
+
```gherkin
|
|
47
|
+
When I follow "Inbox"
|
|
48
|
+
And I wait for AJAX to finish
|
|
49
|
+
Then I should see at least 1 ".message" element
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Example 3
|
|
53
|
+
|
|
54
|
+
```gherkin
|
|
55
|
+
And I wait for AJAX to finish
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Example 4
|
|
59
|
+
|
|
60
|
+
```gherkin
|
|
61
|
+
When we wait for AJAX to finish
|
|
62
|
+
Then "<.toast-success>" should be visible
|
|
63
|
+
```
|
|
64
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
# When I Wait
|
|
3
|
+
|
|
4
|
+
## Description
|
|
5
|
+
|
|
6
|
+
"This step definition indicates that the user will pause or wait for the specified number of seconds/minutes or the maximum number of seconds/minutes before moving to the next step." The functionality is designed for scenarios requiring time-based delays or expected pauses during test execution.
|
|
7
|
+
|
|
8
|
+
## Available Step Definitions
|
|
9
|
+
|
|
10
|
+
The "When I wait" category encompasses five distinct variations:
|
|
11
|
+
|
|
12
|
+
1. **When I wait until the page loaded** - Pauses execution until page load completion
|
|
13
|
+
|
|
14
|
+
2. **When I wait {number} seconds** - Implements a fixed pause for the specified seconds duration
|
|
15
|
+
|
|
16
|
+
3. **When I wait max {number} seconds** - Establishes a maximum wait period in seconds with early completion upon condition satisfaction
|
|
17
|
+
|
|
18
|
+
4. **When I wait {number} minutes** - Creates a fixed pause measured in minutes
|
|
19
|
+
|
|
20
|
+
5. **When I wait max {number} minutes** - Sets a maximum wait period in minutes, allowing early termination when conditions are met
|
|
21
|
+
|
|
22
|
+
## Use Cases
|
|
23
|
+
|
|
24
|
+
These steps prove particularly useful in automated testing scenarios where applications require time-dependent behavior verification or asynchronous operations demand explicit wait periods before proceeding with subsequent test steps.
|
|
25
|
+
|
|
26
|
+
## More examples
|
|
27
|
+
|
|
28
|
+
<!-- generated: extended-examples -->
|
|
29
|
+
|
|
30
|
+
### Example 1
|
|
31
|
+
|
|
32
|
+
```gherkin
|
|
33
|
+
When I press "Save"
|
|
34
|
+
And I wait 2 seconds
|
|
35
|
+
Then I should see "Saved"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Example 2
|
|
39
|
+
|
|
40
|
+
```gherkin
|
|
41
|
+
When I follow "Pricing"
|
|
42
|
+
And I wait until the page is loaded
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Example 3
|
|
46
|
+
|
|
47
|
+
```gherkin
|
|
48
|
+
And I wait 1 second
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Example 4
|
|
52
|
+
|
|
53
|
+
```gherkin
|
|
54
|
+
When I wait max of 5 seconds
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Example 5
|
|
58
|
+
|
|
59
|
+
```gherkin
|
|
60
|
+
And I wait until pending timers settle
|
|
61
|
+
```
|
|
62
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Step definitions
|
|
2
|
+
|
|
3
|
+
A step definition is the bridge between a sentence in a `.feature` file and the
|
|
4
|
+
browser work that sentence stands for. The tester writes the sentence; the step
|
|
5
|
+
definition does the clicking, waiting and asserting.
|
|
6
|
+
|
|
7
|
+
Varbase E2E ships **495 of them across 44 categories** — the full catalogue,
|
|
8
|
+
one page per category, is in [`steps/`](steps/README.md).
|
|
9
|
+
|
|
10
|
+
## Start here
|
|
11
|
+
|
|
12
|
+
| I want to… | Go to |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Browse every step by category | [Step catalogue](steps/README.md) |
|
|
15
|
+
| Test a Drupal or Varbase screen | [Drupal and Varbase steps](steps/README.md#drupal-and-varbase) |
|
|
16
|
+
| Look up one topic quickly | [Step reference](04-step-reference.md) |
|
|
17
|
+
| Write my first feature file | [Quick start](00-quick-start.md) |
|
|
18
|
+
| Add a step of my own | [Writing your own](steps/README.md#writing-your-own) |
|
|
19
|
+
|
|
20
|
+
## What a feature file looks like
|
|
21
|
+
|
|
22
|
+
```gherkin
|
|
23
|
+
Feature: Example test for "Then I should be on 'page'"
|
|
24
|
+
As a tester
|
|
25
|
+
I want to be sure I am on "page"
|
|
26
|
+
|
|
27
|
+
Scenario: Check "Then I should be on the 'page'" step definition
|
|
28
|
+
Given I am on the homepage
|
|
29
|
+
When I follow "About Us"
|
|
30
|
+
Then I should be on "about-us.html"
|
|
31
|
+
When I move backward one page
|
|
32
|
+
Then I should be on "/"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Nothing is imported and nothing is wired up: cucumber-js loads every
|
|
36
|
+
`*.steps.js` under `tests/step-definitions/` on its own, matches each sentence
|
|
37
|
+
against the shipped patterns, and runs the first one that fits.
|
|
38
|
+
|
|
39
|
+
## The rules every shipped step follows
|
|
40
|
+
|
|
41
|
+
- **Pronouns are optional.** `I click`, `we click` and bare `click` all match.
|
|
42
|
+
- **Plain English, never code.** `local storage`, not `localStorage`.
|
|
43
|
+
- **Technical identifiers stay verbatim.** A CSS selector, a JSON Pointer or a
|
|
44
|
+
header name is domain language, so it is written exactly as it is.
|
|
45
|
+
- **At least five examples per step**, in the JSDoc above the definition and on
|
|
46
|
+
the catalogue page generated from it.
|
|
47
|
+
- **Failures read as sentences.** A step that cannot do its job explains what it
|
|
48
|
+
was trying to do and why it could not, rather than surfacing a raw stack
|
|
49
|
+
trace.
|
|
50
|
+
|
|
51
|
+
## Per-step pages
|
|
52
|
+
|
|
53
|
+
Older per-step pages, kept for the links that point at them:
|
|
54
|
+
|
|
55
|
+
- [Given I am on homepage](step-definitions/given-i-am-homepage.md)
|
|
56
|
+
- [Given I am on "specific" page](step-definitions/given-i-am-specific-page.md)
|
|
57
|
+
- [Given I am an anonymous user](step-definitions/given-i-am-anonymous-user.md)
|
|
58
|
+
- [When I go to the homepage](step-definitions/when-i-go-homepage.md)
|
|
59
|
+
- [When I go to "specific page"](step-definitions/when-i-go-specific-page.md)
|
|
60
|
+
- [When I reload the page](step-definitions/when-i-reload-page.md)
|
|
61
|
+
- [When I move backward one page](step-definitions/when-i-move-backward-one-page.md)
|
|
62
|
+
- [When I move forward one page](step-definitions/when-i-move-forward-one-page.md)
|
|
63
|
+
- [When I fill in](step-definitions/when-i-fill.md)
|
|
64
|
+
- [When I press "button"](step-definitions/when-i-press-button.md)
|
|
65
|
+
- [When I click "link"](step-definitions/when-i-click-link.md)
|
|
66
|
+
- [When I check "checkbox"](step-definitions/when-i-check-checkbox.md)
|
|
67
|
+
- [When I uncheck "checkbox"](step-definitions/when-i-uncheck-checkbox.md)
|
|
68
|
+
- [When I select "option" from "select list"](step-definitions/when-i-select-option-select-list.md)
|
|
69
|
+
- [When I select radio button "value"](step-definitions/when-i-select-radio-button-value.md)
|
|
70
|
+
- [When I click "operation" in "text" row](step-definitions/when-i-click-operation-text-row.md)
|
|
71
|
+
- [When I attach the file "file name" to "element"](step-definitions/when-i-attach-file-file-name-element.md)
|
|
72
|
+
- [When I scroll](step-definitions/when-i-scroll.md)
|
|
73
|
+
- [When I wait](step-definitions/when-i-wait.md)
|
|
74
|
+
- [When I wait for AJAX to finish](step-definitions/when-i-wait-ajax-finish.md)
|
|
75
|
+
- [Then I should see](step-definitions/then-i-should-see.md)
|
|
76
|
+
- [Then I should be](step-definitions/then-i-should-be.md)
|
|
77
|
+
- [Then the "item" checkbox](step-definitions/then-item-checkbox.md)
|
|
78
|
+
- [Then the item should contain](step-definitions/then-item-should-contain.md)
|
|
79
|
+
- [Then the "item" link should contain "url"](step-definitions/then-item-link-should-contain-url.md)
|
|
80
|
+
- [Then the "value" radio button is selected](step-definitions/then-value-radio-button-selected.md)
|
|
81
|
+
- [Then the radio button "value" should be selected](step-definitions/then-radio-button-value-should-be-selected.md)
|
|
82
|
+
- [Then the response status code should be {number}](step-definitions/then-response-status-code-should-be-number.md)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Step definitions
|
|
2
|
+
|
|
3
|
+
Every step Varbase E2E ships, one page per category, generated from the step
|
|
4
|
+
definitions themselves — so the phrasing, the pattern and the examples on these
|
|
5
|
+
pages are exactly what the runner matches.
|
|
6
|
+
|
|
7
|
+
**495 steps across 44 categories.**
|
|
8
|
+
|
|
9
|
+
Cucumber-js loads every `*.steps.js` under `tests/step-definitions/`
|
|
10
|
+
automatically. You never `require()` a step file from a feature: write the
|
|
11
|
+
sentence, and the runner finds it.
|
|
12
|
+
|
|
13
|
+
## How to read a step
|
|
14
|
+
|
|
15
|
+
Each entry gives you three things:
|
|
16
|
+
|
|
17
|
+
- **The sentence** — the heading is a real, runnable Gherkin line. Copy it.
|
|
18
|
+
- **The pattern** — the regular expression the runner matches. It tells you
|
|
19
|
+
which words are optional (`(?:the )?`) and which are yours to fill in
|
|
20
|
+
(`"([^"]*)"`).
|
|
21
|
+
- **The examples** — at least five valid phrasings per step, so you can see the
|
|
22
|
+
shape of the sentence rather than decode the regex.
|
|
23
|
+
|
|
24
|
+
Every step accepts the pronoun prefix: `I click`, `we click` and bare
|
|
25
|
+
`click` all match.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Drupal and Varbase
|
|
29
|
+
|
|
30
|
+
Steps for the Drupal and Varbase surfaces the team tests every day — the node and entity forms, the media library, Layout Builder, Drupal Canvas and Varbase's own screens.
|
|
31
|
+
|
|
32
|
+
| Category | Steps | Page |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| Drupal core | 27 | [`drupal-core.md`](drupal-core.md) |
|
|
35
|
+
| CKEditor 5 | 4 | [`drupal-ckeditor.md`](drupal-ckeditor.md) |
|
|
36
|
+
| Media library | 4 | [`drupal-media.md`](drupal-media.md) |
|
|
37
|
+
| Content moderation | 3 | [`drupal-moderation.md`](drupal-moderation.md) |
|
|
38
|
+
| Layout Builder | 17 | [`drupal-layout-builder.md`](drupal-layout-builder.md) |
|
|
39
|
+
| Paragraphs | 1 | [`drupal-paragraphs.md`](drupal-paragraphs.md) |
|
|
40
|
+
| Drupal Canvas | 12 | [`drupal-canvas.md`](drupal-canvas.md) |
|
|
41
|
+
| Varbase | 14 | [`varbase.md`](varbase.md) |
|
|
42
|
+
|
|
43
|
+
**82 steps.**
|
|
44
|
+
|
|
45
|
+
## User journeys
|
|
46
|
+
|
|
47
|
+
Driving the browser the way a person does: going somewhere, filling something in, clicking, typing, scrolling.
|
|
48
|
+
|
|
49
|
+
| Category | Steps | Page |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| Navigation | 11 | [`navigation.md`](navigation.md) |
|
|
52
|
+
| Actions | 7 | [`action.md`](action.md) |
|
|
53
|
+
| Forms | 13 | [`form.md`](form.md) |
|
|
54
|
+
| Field state | 27 | [`field.md`](field.md) |
|
|
55
|
+
| Pointer input | 9 | [`input.md`](input.md) |
|
|
56
|
+
| Keyboard | 4 | [`keyboard.md`](keyboard.md) |
|
|
57
|
+
| Scrolling | 12 | [`scroll.md`](scroll.md) |
|
|
58
|
+
| Links | 9 | [`link.md`](link.md) |
|
|
59
|
+
| Modals | 9 | [`modal.md`](modal.md) |
|
|
60
|
+
| Browser dialogs | 8 | [`dialog.md`](dialog.md) |
|
|
61
|
+
|
|
62
|
+
**109 steps.**
|
|
63
|
+
|
|
64
|
+
## Outcome verification
|
|
65
|
+
|
|
66
|
+
Asserting what the page ended up showing.
|
|
67
|
+
|
|
68
|
+
| Category | Steps | Page |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| Assertions | 14 | [`assertion.md`](assertion.md) |
|
|
71
|
+
| Web-first matchers | 12 | [`web-first.md`](web-first.md) |
|
|
72
|
+
| Element interactions | 19 | [`element.md`](element.md) |
|
|
73
|
+
| Tables | 8 | [`table.md`](table.md) |
|
|
74
|
+
| Meta tags | 3 | [`metatag.md`](metatag.md) |
|
|
75
|
+
| Response headers | 4 | [`response.md`](response.md) |
|
|
76
|
+
|
|
77
|
+
**60 steps.**
|
|
78
|
+
|
|
79
|
+
## APIs and data formats
|
|
80
|
+
|
|
81
|
+
Talking to an endpoint and asserting on what comes back.
|
|
82
|
+
|
|
83
|
+
| Category | Steps | Page |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| API (long form) | 22 | [`api.md`](api.md) |
|
|
86
|
+
| REST (short form) | 5 | [`rest.md`](rest.md) |
|
|
87
|
+
| XML responses | 20 | [`xml.md`](xml.md) |
|
|
88
|
+
| YAML responses | 38 | [`yaml.md`](yaml.md) |
|
|
89
|
+
| URL paths | 8 | [`path.md`](path.md) |
|
|
90
|
+
|
|
91
|
+
**93 steps.**
|
|
92
|
+
|
|
93
|
+
## Test resilience and instrumentation
|
|
94
|
+
|
|
95
|
+
Everything that keeps a suite honest and debuggable: waits, mocks, state, capture.
|
|
96
|
+
|
|
97
|
+
| Category | Steps | Page |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| Waits | 21 | [`wait.md`](wait.md) |
|
|
100
|
+
| Clock | 7 | [`clock.md`](clock.md) |
|
|
101
|
+
| Network | 10 | [`network.md`](network.md) |
|
|
102
|
+
| Storage | 9 | [`storage.md`](storage.md) |
|
|
103
|
+
| Cookies | 12 | [`cookie.md`](cookie.md) |
|
|
104
|
+
| Auth state | 3 | [`auth.md`](auth.md) |
|
|
105
|
+
| JavaScript errors | 4 | [`javascript.md`](javascript.md) |
|
|
106
|
+
| Accessibility | 26 | [`a11y.md`](a11y.md) |
|
|
107
|
+
| Iframes | 10 | [`iframe.md`](iframe.md) |
|
|
108
|
+
| File downloads | 8 | [`file-download.md`](file-download.md) |
|
|
109
|
+
| Selector registry | 24 | [`selectors.md`](selectors.md) |
|
|
110
|
+
| Responsive viewports | 5 | [`responsive.md`](responsive.md) |
|
|
111
|
+
| Screenshots | 6 | [`screenshot.md`](screenshot.md) |
|
|
112
|
+
| Video recording | 4 | [`video.md`](video.md) |
|
|
113
|
+
| Debug | 2 | [`debug.md`](debug.md) |
|
|
114
|
+
|
|
115
|
+
**151 steps.**
|
|
116
|
+
|
|
117
|
+
## Writing your own
|
|
118
|
+
|
|
119
|
+
When no shipped step fits, add one to your project's own
|
|
120
|
+
`tests/step-definitions/`. Follow the same contract these pages are generated
|
|
121
|
+
from:
|
|
122
|
+
|
|
123
|
+
- Use a regular expression with the `(?:I |we )*` prefix, never a Cucumber
|
|
124
|
+
Expression that hard-codes `I`.
|
|
125
|
+
- Plain English in the sentence — `local storage`, not `localStorage`.
|
|
126
|
+
- A JSDoc block above the definition with a one-line description and **at least
|
|
127
|
+
five `Example #N:` lines** of valid Gherkin.
|
|
128
|
+
- Wrap risky locator work so the tester gets a sentence, not a stack trace.
|
|
129
|
+
|
|
130
|
+
Search these pages before writing anything: most of what a Varbase suite needs
|
|
131
|
+
is already here.
|
|
132
|
+
|
|
133
|
+
## Regenerating these pages
|
|
134
|
+
|
|
135
|
+
They are generated from the JSDoc in `tests/step-definitions/*.steps.js`. Edit
|
|
136
|
+
the step, not the page — a page edited by hand is overwritten on the next
|
|
137
|
+
generation.
|