@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,235 @@
|
|
|
1
|
+
# File downloads steps
|
|
2
|
+
|
|
3
|
+
8 steps, defined in `tests/step-definitions/file-download.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 download the file from the URL "/exports/users.csv"` |
|
|
10
|
+
| 2 | `When I download the file from the link "Download report"` |
|
|
11
|
+
| 3 | `Then the downloaded file should contain:` |
|
|
12
|
+
| 4 | `Then the downloaded file name should be "report.pdf"` |
|
|
13
|
+
| 5 | `Then the downloaded file name should contain "report"` |
|
|
14
|
+
| 6 | `Then the downloaded file should be a zip archive containing the following files named:` |
|
|
15
|
+
| 7 | `Then the downloaded file should be a zip archive containing the following files partially named:` |
|
|
16
|
+
| 8 | `Then the downloaded file should be a zip archive not containing the following files partially named:` |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. When I download the file from the URL "/exports/users.csv"
|
|
21
|
+
|
|
22
|
+
Download the file at a URL using the browser's request context. The result
|
|
23
|
+
is captured on `this._lastDownload` for follow-up assertions.
|
|
24
|
+
|
|
25
|
+
Relative paths are joined to `launchUrl`. Absolute URLs (`http(s)://...`)
|
|
26
|
+
are used as-is.
|
|
27
|
+
|
|
28
|
+
**Keyword**: `When`
|
|
29
|
+
|
|
30
|
+
**Pattern**
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
/^(I |we )*download the file from the URL "([^"]*)"$/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Examples**
|
|
37
|
+
|
|
38
|
+
```gherkin
|
|
39
|
+
When I download the file from the URL "/exports/users.csv"
|
|
40
|
+
When I download the file from the URL "https://example.com/doc.pdf"
|
|
41
|
+
And we download the file from the URL "/api/report?format=pdf"
|
|
42
|
+
When I download the file from the URL "/files/logo.svg"
|
|
43
|
+
When I download the file from the URL "/exports/data-2026.json"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 2. When I download the file from the link "Download report"
|
|
47
|
+
|
|
48
|
+
Click a link by visible text and capture the resulting download.
|
|
49
|
+
|
|
50
|
+
**Keyword**: `When`
|
|
51
|
+
|
|
52
|
+
**Pattern**
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
/^(I |we )*download the file from the link "([^"]*)"$/
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Examples**
|
|
59
|
+
|
|
60
|
+
```gherkin
|
|
61
|
+
When I download the file from the link "Download report"
|
|
62
|
+
When I download the file from the link "Export CSV"
|
|
63
|
+
And we download the file from the link "Get logo"
|
|
64
|
+
When I download the file from the link "Download archive"
|
|
65
|
+
When I download the file from the link "Export JSON"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 3. Then the downloaded file should contain:
|
|
69
|
+
|
|
70
|
+
Assert the most recent download's body contains an expected substring.
|
|
71
|
+
|
|
72
|
+
Body is decoded as UTF-8.
|
|
73
|
+
|
|
74
|
+
**Keyword**: `Then`
|
|
75
|
+
|
|
76
|
+
**Pattern**
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
'the downloaded file should contain:'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Examples**
|
|
83
|
+
|
|
84
|
+
```gherkin
|
|
85
|
+
Then the downloaded file should contain:
|
|
86
|
+
"""
|
|
87
|
+
Order #1234
|
|
88
|
+
"""
|
|
89
|
+
Then the downloaded file should contain:
|
|
90
|
+
"""
|
|
91
|
+
name,email
|
|
92
|
+
"""
|
|
93
|
+
And the downloaded file should contain:
|
|
94
|
+
"""
|
|
95
|
+
<svg
|
|
96
|
+
"""
|
|
97
|
+
Then the downloaded file should contain:
|
|
98
|
+
"""
|
|
99
|
+
"version": "1.0"
|
|
100
|
+
"""
|
|
101
|
+
Then the downloaded file should contain:
|
|
102
|
+
"""
|
|
103
|
+
%PDF-
|
|
104
|
+
"""
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 4. Then the downloaded file name should be "report.pdf"
|
|
108
|
+
|
|
109
|
+
Assert the most recent download's filename equals an expected value.
|
|
110
|
+
|
|
111
|
+
**Keyword**: `Then`
|
|
112
|
+
|
|
113
|
+
**Pattern**
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
'the downloaded file name should be {string}'
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Examples**
|
|
120
|
+
|
|
121
|
+
```gherkin
|
|
122
|
+
Then the downloaded file name should be "report.pdf"
|
|
123
|
+
Then the downloaded file name should be "users.csv"
|
|
124
|
+
And the downloaded file name should be "logo.svg"
|
|
125
|
+
Then the downloaded file name should be "archive.zip"
|
|
126
|
+
Then the downloaded file name should be "data-2026.json"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## 5. Then the downloaded file name should contain "report"
|
|
130
|
+
|
|
131
|
+
Assert the most recent download's filename contains a substring.
|
|
132
|
+
|
|
133
|
+
Useful when filenames embed timestamps or hashes.
|
|
134
|
+
|
|
135
|
+
**Keyword**: `Then`
|
|
136
|
+
|
|
137
|
+
**Pattern**
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
'the downloaded file name should contain {string}'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Examples**
|
|
144
|
+
|
|
145
|
+
```gherkin
|
|
146
|
+
Then the downloaded file name should contain "report"
|
|
147
|
+
Then the downloaded file name should contain ".pdf"
|
|
148
|
+
And the downloaded file name should contain "2026"
|
|
149
|
+
Then the downloaded file name should contain "users"
|
|
150
|
+
Then the downloaded file name should contain "export"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 6. Then the downloaded file should be a zip archive containing the following files named:
|
|
154
|
+
|
|
155
|
+
(Pending) Assert the downloaded ZIP archive contains the listed filenames exactly.
|
|
156
|
+
|
|
157
|
+
**Keyword**: `Then`
|
|
158
|
+
|
|
159
|
+
**Pattern**
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
'the downloaded file should be a zip archive containing the following files named:'
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Examples**
|
|
166
|
+
|
|
167
|
+
```gherkin
|
|
168
|
+
Then the downloaded file should be a zip archive containing the following files named:
|
|
169
|
+
| report.pdf |
|
|
170
|
+
| summary.csv |
|
|
171
|
+
Then the downloaded file should be a zip archive containing the following files named:
|
|
172
|
+
| a.txt | b.txt |
|
|
173
|
+
Then the downloaded file should be a zip archive containing the following files named:
|
|
174
|
+
| data.json |
|
|
175
|
+
Then the downloaded file should be a zip archive containing the following files named:
|
|
176
|
+
| logo.svg | favicon.ico |
|
|
177
|
+
Then the downloaded file should be a zip archive containing the following files named:
|
|
178
|
+
| manifest.json |
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## 7. Then the downloaded file should be a zip archive containing the following files partially named:
|
|
182
|
+
|
|
183
|
+
(Pending) Assert the downloaded ZIP contains files whose names contain the listed substrings.
|
|
184
|
+
|
|
185
|
+
**Keyword**: `Then`
|
|
186
|
+
|
|
187
|
+
**Pattern**
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
'the downloaded file should be a zip archive containing the following files partially named:'
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Examples**
|
|
194
|
+
|
|
195
|
+
```gherkin
|
|
196
|
+
Then the downloaded file should be a zip archive containing the following files partially named:
|
|
197
|
+
| report |
|
|
198
|
+
| csv |
|
|
199
|
+
Then the downloaded file should be a zip archive containing the following files partially named:
|
|
200
|
+
| 2026 |
|
|
201
|
+
Then the downloaded file should be a zip archive containing the following files partially named:
|
|
202
|
+
| json |
|
|
203
|
+
Then the downloaded file should be a zip archive containing the following files partially named:
|
|
204
|
+
| logo | favicon |
|
|
205
|
+
Then the downloaded file should be a zip archive containing the following files partially named:
|
|
206
|
+
| manifest |
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## 8. Then the downloaded file should be a zip archive not containing the following files partially named:
|
|
210
|
+
|
|
211
|
+
(Pending) Assert the downloaded ZIP does NOT contain files whose names contain the listed substrings.
|
|
212
|
+
|
|
213
|
+
**Keyword**: `Then`
|
|
214
|
+
|
|
215
|
+
**Pattern**
|
|
216
|
+
|
|
217
|
+
```js
|
|
218
|
+
'the downloaded file should be a zip archive not containing the following files partially named:'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Examples**
|
|
222
|
+
|
|
223
|
+
```gherkin
|
|
224
|
+
Then the downloaded file should be a zip archive not containing the following files partially named:
|
|
225
|
+
| secret |
|
|
226
|
+
| .env |
|
|
227
|
+
Then the downloaded file should be a zip archive not containing the following files partially named:
|
|
228
|
+
| private |
|
|
229
|
+
Then the downloaded file should be a zip archive not containing the following files partially named:
|
|
230
|
+
| tmp |
|
|
231
|
+
Then the downloaded file should be a zip archive not containing the following files partially named:
|
|
232
|
+
| DS_Store |
|
|
233
|
+
Then the downloaded file should be a zip archive not containing the following files partially named:
|
|
234
|
+
| __MACOSX |
|
|
235
|
+
```
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
# Forms steps
|
|
2
|
+
|
|
3
|
+
13 steps, defined in `tests/step-definitions/form.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 fill in "Username" with "John Smith"` |
|
|
10
|
+
| 2 | `When I fill in "#uname" with "John Smith" by attr` |
|
|
11
|
+
| 3 | `When I fill in "Username" with:` |
|
|
12
|
+
| 4 | `When I fill in "#uname" with: by attr` |
|
|
13
|
+
| 5 | `When I fill in "jon-smith" for "Username"` |
|
|
14
|
+
| 6 | `When I fill in "John Smith" for "#uname" by attr` |
|
|
15
|
+
| 7 | `When I fill in the following:` |
|
|
16
|
+
| 8 | `When I fill in the following: by attr` |
|
|
17
|
+
| 9 | `When I select "Mercedes" from "Cars"` |
|
|
18
|
+
| 10 | `When I additionally select "Red" from "Colors"` |
|
|
19
|
+
| 11 | `When I check "Remember me"` |
|
|
20
|
+
| 12 | `When I uncheck "Remember me"` |
|
|
21
|
+
| 13 | `When I select radio button "Male"` |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. When I fill in "Username" with "John Smith"
|
|
26
|
+
|
|
27
|
+
Fill an input field located by its label, placeholder, or name.
|
|
28
|
+
|
|
29
|
+
**Keyword**: `When`
|
|
30
|
+
|
|
31
|
+
**Pattern**
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
/^(I |we )*fill in "([^"]*)?" with "([^"]*)?"$/
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Examples**
|
|
38
|
+
|
|
39
|
+
```gherkin
|
|
40
|
+
When I fill in "Username" with "John Smith"
|
|
41
|
+
When I fill in "Email" with "jon@example.com"
|
|
42
|
+
And we fill in "Organization" with "Vardot"
|
|
43
|
+
And I fill in "Password" with "1234"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 2. When I fill in "#uname" with "John Smith" by attr
|
|
47
|
+
|
|
48
|
+
Fill an input field located by its attribute.
|
|
49
|
+
|
|
50
|
+
**Keyword**: `When`
|
|
51
|
+
|
|
52
|
+
**Pattern**
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
/^(I |we )*fill in "([^"]*)?" with "([^"]*)?" by( its)*(?: "([^"]*)?")* (attribute|attr)$/
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Examples**
|
|
59
|
+
|
|
60
|
+
```gherkin
|
|
61
|
+
When I fill in "#uname" with "John Smith" by attr
|
|
62
|
+
When I fill in "uname" with "John Smith" by attr
|
|
63
|
+
And I fill in "pwordcss" with "1234" by "class" attr
|
|
64
|
+
And I fill in "Your full name" with "John Smith" by its "placeholder" attribute
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 3. When I fill in "Username" with:
|
|
68
|
+
|
|
69
|
+
Clear an input field located by its label.
|
|
70
|
+
|
|
71
|
+
**Keyword**: `When`
|
|
72
|
+
|
|
73
|
+
**Pattern**
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
/^(I |we )*fill in "([^"]*)?" with:$/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Examples**
|
|
80
|
+
|
|
81
|
+
```gherkin
|
|
82
|
+
When I fill in "Username" with:
|
|
83
|
+
And we fill in "Email" with:
|
|
84
|
+
And I fill in "Password" with:
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 4. When I fill in "#uname" with: by attr
|
|
88
|
+
|
|
89
|
+
Clear an input field located by its attribute.
|
|
90
|
+
|
|
91
|
+
**Keyword**: `When`
|
|
92
|
+
|
|
93
|
+
**Pattern**
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
/^(I |we )*fill in "([^"]*)?" with: by( its)*(?: "([^"]*)?")* (attribute|attr)$/
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Examples**
|
|
100
|
+
|
|
101
|
+
```gherkin
|
|
102
|
+
When I fill in "#uname" with: by attr
|
|
103
|
+
When I fill in "uname" with: by attr
|
|
104
|
+
And I fill in "pwordcss" with: by "class" attr
|
|
105
|
+
And I fill in "Your full name" with: by its "placeholder" attribute
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 5. When I fill in "jon-smith" for "Username"
|
|
109
|
+
|
|
110
|
+
Fill an input field located by label (reverse syntax).
|
|
111
|
+
|
|
112
|
+
**Keyword**: `When`
|
|
113
|
+
|
|
114
|
+
**Pattern**
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
/^(I |we )*fill in "([^"]*)?" for "([^"]*)?"$/
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Examples**
|
|
121
|
+
|
|
122
|
+
```gherkin
|
|
123
|
+
When I fill in "jon-smith" for "Username"
|
|
124
|
+
When we fill in "Testing" for "Organization options"
|
|
125
|
+
And I fill in "1234" for "Password"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 6. When I fill in "John Smith" for "#uname" by attr
|
|
129
|
+
|
|
130
|
+
Fill an input field located by attribute (reverse syntax).
|
|
131
|
+
|
|
132
|
+
**Keyword**: `When`
|
|
133
|
+
|
|
134
|
+
**Pattern**
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
/^(I |we )*fill in "([^"]*)?" for "([^"]*)?" by( its)*(?: "([^"]*)?")* (attribute|attr)$/
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Examples**
|
|
141
|
+
|
|
142
|
+
```gherkin
|
|
143
|
+
When I fill in "John Smith" for "#uname" by attr
|
|
144
|
+
When I fill in "John Smith" for "uname" by attr
|
|
145
|
+
And I fill in "1234" for "password" by "class" attr
|
|
146
|
+
And I fill in "John Smith" for "Your full name" by its "placeholder" attribute
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 7. When I fill in the following:
|
|
150
|
+
|
|
151
|
+
Fills multiple form fields from a data table, located by their labels.
|
|
152
|
+
|
|
153
|
+
Each row is `| label | value |`. Labels resolve via `<label for=...>`,
|
|
154
|
+
`placeholder`, or `[name]` — whichever matches first.
|
|
155
|
+
|
|
156
|
+
**Keyword**: `When`
|
|
157
|
+
|
|
158
|
+
**Pattern**
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
/^(I |we )*fill in( the)* following:$/
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Examples**
|
|
165
|
+
|
|
166
|
+
```gherkin
|
|
167
|
+
When I fill in the following:
|
|
168
|
+
| Username | vardot |
|
|
169
|
+
| Password | s3cret |
|
|
170
|
+
When we fill in the following:
|
|
171
|
+
| Email | jon@example.com |
|
|
172
|
+
| Organization | Vardot |
|
|
173
|
+
And I fill in the following:
|
|
174
|
+
| First name | Alice |
|
|
175
|
+
| Last name | Smith |
|
|
176
|
+
| Country | Jordan |
|
|
177
|
+
When I fill in the following:
|
|
178
|
+
| Subject | Bug report |
|
|
179
|
+
| Message | The submit button is hidden |
|
|
180
|
+
When I fill in the following:
|
|
181
|
+
| Card number | 4242 4242 4242 4242 |
|
|
182
|
+
| Expiry | 12/30 |
|
|
183
|
+
| CVV | 123 |
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 8. When I fill in the following: by attr
|
|
187
|
+
|
|
188
|
+
Fills multiple form fields from a data table, located by attribute.
|
|
189
|
+
|
|
190
|
+
Without an explicit attribute, each key is matched against id / class /
|
|
191
|
+
name / data-testid / data-test-id / data-test / data-cy / aria-label /
|
|
192
|
+
value / placeholder / title.
|
|
193
|
+
|
|
194
|
+
**Keyword**: `When`
|
|
195
|
+
|
|
196
|
+
**Pattern**
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
/^(I |we )*fill in( the)* following: by( its)*(?: "([^"]*)?")* (attribute|attr)$/
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Examples**
|
|
203
|
+
|
|
204
|
+
```gherkin
|
|
205
|
+
When I fill in the following: by attr
|
|
206
|
+
| #uname | John Smith |
|
|
207
|
+
| password | s3cret |
|
|
208
|
+
When I fill in the following: by its "placeholder" attribute
|
|
209
|
+
| Your full name | John Smith |
|
|
210
|
+
| Your Password | s3cret |
|
|
211
|
+
When I fill in the following: by attribute
|
|
212
|
+
| [data-testid=email] | a@b.c |
|
|
213
|
+
| [data-testid=username] | alice |
|
|
214
|
+
When we fill in the following: by attr
|
|
215
|
+
| first-name | Alice |
|
|
216
|
+
| last-name | Smith |
|
|
217
|
+
When I fill in the following: by its "name" attribute
|
|
218
|
+
| card_number | 4242 4242 4242 4242 |
|
|
219
|
+
| exp_date | 12/30 |
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## 9. When I select "Mercedes" from "Cars"
|
|
223
|
+
|
|
224
|
+
Select an option from a dropdown by label, id, class, or name.
|
|
225
|
+
|
|
226
|
+
**Keyword**: `When`
|
|
227
|
+
|
|
228
|
+
**Pattern**
|
|
229
|
+
|
|
230
|
+
```js
|
|
231
|
+
/^(I |we )*select "([^"]*)?" from "([^"]*)?"$/
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Examples**
|
|
235
|
+
|
|
236
|
+
```gherkin
|
|
237
|
+
When I select "Mercedes" from "Cars"
|
|
238
|
+
When I select "saab" from "#cars"
|
|
239
|
+
When I select "Mercedes" from "cars"
|
|
240
|
+
And we select "English" from "Language"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## 10. When I additionally select "Red" from "Colors"
|
|
244
|
+
|
|
245
|
+
Add an option to a <select multiple> without clearing the existing selection.
|
|
246
|
+
Resolves the select by label, then by [name]/#id fallback.
|
|
247
|
+
|
|
248
|
+
**Keyword**: `When`
|
|
249
|
+
|
|
250
|
+
**Pattern**
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
/^(I |we )*additionally select "([^"]*)" from "([^"]*)"$/
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Examples**
|
|
257
|
+
|
|
258
|
+
```gherkin
|
|
259
|
+
When I additionally select "Red" from "Colors"
|
|
260
|
+
When I additionally select "Blue" from "Colors"
|
|
261
|
+
When we additionally select "Green" from "Colors"
|
|
262
|
+
And additionally select "Yellow" from "Colors"
|
|
263
|
+
When I additionally select "Admin" from "Roles"
|
|
264
|
+
When we additionally select "Editor" from "Roles"
|
|
265
|
+
When I additionally select "Viewer" from "Roles"
|
|
266
|
+
And I additionally select "EN" from "Languages"
|
|
267
|
+
When I additionally select "FR" from "Languages"
|
|
268
|
+
When we additionally select "ES" from "Languages"
|
|
269
|
+
|
|
270
|
+
Advanced:
|
|
271
|
+
Build a full multi-selection in sequence:
|
|
272
|
+
When I select "Red" from "Colors"
|
|
273
|
+
And I additionally select "Blue" from "Colors"
|
|
274
|
+
And I additionally select "Green" from "Colors"
|
|
275
|
+
Works against a [name] select:
|
|
276
|
+
When I additionally select "tag-a" from "tags"
|
|
277
|
+
And I additionally select "tag-b" from "tags"
|
|
278
|
+
Confirm the select stays multi-valued after adds:
|
|
279
|
+
When I select "One" from "Items"
|
|
280
|
+
And I additionally select "Two" from "Items"
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## 11. When I check "Remember me"
|
|
284
|
+
|
|
285
|
+
Checks the specified checkbox by label, id, class, or name.
|
|
286
|
+
|
|
287
|
+
**Keyword**: `When`
|
|
288
|
+
|
|
289
|
+
**Pattern**
|
|
290
|
+
|
|
291
|
+
```js
|
|
292
|
+
/^(I |we )*check "([^"]*)?"$/
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Examples**
|
|
296
|
+
|
|
297
|
+
```gherkin
|
|
298
|
+
When I check "Remember me"
|
|
299
|
+
When we check "Put site into maintenance mode"
|
|
300
|
+
And I check "#newsletter"
|
|
301
|
+
And we check ".terms-and-conditions"
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## 12. When I uncheck "Remember me"
|
|
305
|
+
|
|
306
|
+
Unchecks the specified checkbox by label, id, class, or name.
|
|
307
|
+
|
|
308
|
+
**Keyword**: `When`
|
|
309
|
+
|
|
310
|
+
**Pattern**
|
|
311
|
+
|
|
312
|
+
```js
|
|
313
|
+
/^(I |we )*uncheck "([^"]*)?"$/
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Examples**
|
|
317
|
+
|
|
318
|
+
```gherkin
|
|
319
|
+
When I uncheck "Remember me"
|
|
320
|
+
When we uncheck "Put site into maintenance mode"
|
|
321
|
+
And I uncheck "#newsletter"
|
|
322
|
+
And we uncheck ".terms-and-conditions"
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## 13. When I select radio button "Male"
|
|
326
|
+
|
|
327
|
+
Selects a radio button by label, value, id, or class.
|
|
328
|
+
|
|
329
|
+
**Keyword**: `When`
|
|
330
|
+
|
|
331
|
+
**Pattern**
|
|
332
|
+
|
|
333
|
+
```js
|
|
334
|
+
/^(I |we )*select radio button "([^"]*)?"$/
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
**Examples**
|
|
338
|
+
|
|
339
|
+
```gherkin
|
|
340
|
+
When I select radio button "Male"
|
|
341
|
+
When I select radio button "female"
|
|
342
|
+
When I select radio button "#gender-male"
|
|
343
|
+
When we select radio button "option1"
|
|
344
|
+
```
|