@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,293 @@
|
|
|
1
|
+
# Cookies steps
|
|
2
|
+
|
|
3
|
+
12 steps, defined in `tests/step-definitions/cookie.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 | `Then a cookie with the name "session_id" should exist` |
|
|
10
|
+
| 2 | `Then a cookie with the name "lang" and the value "en" should exist` |
|
|
11
|
+
| 3 | `Then a cookie with the name "session_id" and a value containing "abc" should exist` |
|
|
12
|
+
| 4 | `Then a cookie with a name containing "session" should exist` |
|
|
13
|
+
| 5 | `Then a cookie with a name containing "session" and the value "active" should exist` |
|
|
14
|
+
| 6 | `Then a cookie with a name containing "session" and a value containing "active" should exist` |
|
|
15
|
+
| 7 | `Then a cookie with the name "session_id" should not exist` |
|
|
16
|
+
| 8 | `Then a cookie with the name "lang" and the value "fr" should not exist` |
|
|
17
|
+
| 9 | `Then a cookie with the name "preferences" and a value containing "lightmode" should not exist` |
|
|
18
|
+
| 10 | `Then a cookie with a name containing "old_" should not exist` |
|
|
19
|
+
| 11 | `Then a cookie with a name containing "session" and the value "expired" should not exist` |
|
|
20
|
+
| 12 | `Then a cookie with a name containing "session" and a value containing "old" should not exist` |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Then a cookie with the name "session_id" should exist
|
|
25
|
+
|
|
26
|
+
Assert that a cookie with the exact name exists in the browser context.
|
|
27
|
+
|
|
28
|
+
**Keyword**: `Then`
|
|
29
|
+
|
|
30
|
+
**Pattern**
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
'a cookie with the name {string} should exist'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Examples**
|
|
37
|
+
|
|
38
|
+
```gherkin
|
|
39
|
+
Then a cookie with the name "session_id" should exist
|
|
40
|
+
Then a cookie with the name "auth_token" should exist
|
|
41
|
+
And a cookie with the name "lang" should exist
|
|
42
|
+
Then a cookie with the name "consent" should exist
|
|
43
|
+
When I press "Sign in"
|
|
44
|
+
Then a cookie with the name "session" should exist
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 2. Then a cookie with the name "lang" and the value "en" should exist
|
|
48
|
+
|
|
49
|
+
Assert that a cookie with the exact name AND exact value exists.
|
|
50
|
+
|
|
51
|
+
**Keyword**: `Then`
|
|
52
|
+
|
|
53
|
+
**Pattern**
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
'a cookie with the name {string} and the value {string} should exist'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Examples**
|
|
60
|
+
|
|
61
|
+
```gherkin
|
|
62
|
+
Then a cookie with the name "lang" and the value "en" should exist
|
|
63
|
+
Then a cookie with the name "consent" and the value "accepted" should exist
|
|
64
|
+
And a cookie with the name "ab_bucket" and the value "variant-b" should exist
|
|
65
|
+
Then a cookie with the name "theme" and the value "dark" should exist
|
|
66
|
+
When I check "Remember me"
|
|
67
|
+
And I press "Sign in"
|
|
68
|
+
Then a cookie with the name "remember" and the value "1" should exist
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 3. Then a cookie with the name "session_id" and a value containing "abc" should exist
|
|
72
|
+
|
|
73
|
+
Assert a cookie with the exact name has a value containing a substring.
|
|
74
|
+
|
|
75
|
+
**Keyword**: `Then`
|
|
76
|
+
|
|
77
|
+
**Pattern**
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
'a cookie with the name {string} and a value containing {string} should exist'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Examples**
|
|
84
|
+
|
|
85
|
+
```gherkin
|
|
86
|
+
Then a cookie with the name "session_id" and a value containing "abc" should exist
|
|
87
|
+
Then a cookie with the name "auth" and a value containing "Bearer" should exist
|
|
88
|
+
And a cookie with the name "preferences" and a value containing "darkmode" should exist
|
|
89
|
+
Then a cookie with the name "tracking" and a value containing "v2-" should exist
|
|
90
|
+
Then a cookie with the name "csrf" and a value containing "token=" should exist
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 4. Then a cookie with a name containing "session" should exist
|
|
94
|
+
|
|
95
|
+
Assert a cookie whose name contains a substring exists.
|
|
96
|
+
|
|
97
|
+
**Keyword**: `Then`
|
|
98
|
+
|
|
99
|
+
**Pattern**
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
'a cookie with a name containing {string} should exist'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Examples**
|
|
106
|
+
|
|
107
|
+
```gherkin
|
|
108
|
+
Then a cookie with a name containing "session" should exist
|
|
109
|
+
Then a cookie with a name containing "_csrf" should exist
|
|
110
|
+
And a cookie with a name containing "tracking" should exist
|
|
111
|
+
Then a cookie with a name containing "auth" should exist
|
|
112
|
+
Then a cookie with a name containing "lang_" should exist
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## 5. Then a cookie with a name containing "session" and the value "active" should exist
|
|
116
|
+
|
|
117
|
+
Assert a cookie whose name contains a substring has the exact value.
|
|
118
|
+
|
|
119
|
+
**Keyword**: `Then`
|
|
120
|
+
|
|
121
|
+
**Pattern**
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
'a cookie with a name containing {string} and the value {string} should exist'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Examples**
|
|
128
|
+
|
|
129
|
+
```gherkin
|
|
130
|
+
Then a cookie with a name containing "session" and the value "active" should exist
|
|
131
|
+
Then a cookie with a name containing "auth" and the value "1" should exist
|
|
132
|
+
And a cookie with a name containing "lang_" and the value "en" should exist
|
|
133
|
+
Then a cookie with a name containing "feature_" and the value "on" should exist
|
|
134
|
+
Then a cookie with a name containing "_pref" and the value "dark" should exist
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 6. Then a cookie with a name containing "session" and a value containing "active" should exist
|
|
138
|
+
|
|
139
|
+
Assert a cookie whose name contains substring A has a value containing substring B.
|
|
140
|
+
|
|
141
|
+
**Keyword**: `Then`
|
|
142
|
+
|
|
143
|
+
**Pattern**
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
'a cookie with a name containing {string} and a value containing {string} should exist'
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Examples**
|
|
150
|
+
|
|
151
|
+
```gherkin
|
|
152
|
+
Then a cookie with a name containing "session" and a value containing "active" should exist
|
|
153
|
+
Then a cookie with a name containing "auth" and a value containing "Bearer" should exist
|
|
154
|
+
And a cookie with a name containing "tracking" and a value containing "v2-" should exist
|
|
155
|
+
Then a cookie with a name containing "csrf" and a value containing "token=" should exist
|
|
156
|
+
Then a cookie with a name containing "_pref" and a value containing "dark" should exist
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## 7. Then a cookie with the name "session_id" should not exist
|
|
160
|
+
|
|
161
|
+
Assert a cookie with the exact name does NOT exist.
|
|
162
|
+
|
|
163
|
+
**Keyword**: `Then`
|
|
164
|
+
|
|
165
|
+
**Pattern**
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
'a cookie with the name {string} should not exist'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Examples**
|
|
172
|
+
|
|
173
|
+
```gherkin
|
|
174
|
+
Then a cookie with the name "session_id" should not exist
|
|
175
|
+
Then a cookie with the name "auth_token" should not exist
|
|
176
|
+
And a cookie with the name "tracking" should not exist
|
|
177
|
+
When I press "Logout"
|
|
178
|
+
Then a cookie with the name "session" should not exist
|
|
179
|
+
Given all cookies are cleared
|
|
180
|
+
Then a cookie with the name "lang" should not exist
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 8. Then a cookie with the name "lang" and the value "fr" should not exist
|
|
184
|
+
|
|
185
|
+
Assert a cookie with the exact name+value does NOT exist.
|
|
186
|
+
|
|
187
|
+
**Keyword**: `Then`
|
|
188
|
+
|
|
189
|
+
**Pattern**
|
|
190
|
+
|
|
191
|
+
```js
|
|
192
|
+
'a cookie with the name {string} and the value {string} should not exist'
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Examples**
|
|
196
|
+
|
|
197
|
+
```gherkin
|
|
198
|
+
Then a cookie with the name "lang" and the value "fr" should not exist
|
|
199
|
+
Then a cookie with the name "consent" and the value "rejected" should not exist
|
|
200
|
+
And a cookie with the name "theme" and the value "dark" should not exist
|
|
201
|
+
Then a cookie with the name "ab_bucket" and the value "variant-c" should not exist
|
|
202
|
+
Then a cookie with the name "remember" and the value "0" should not exist
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## 9. Then a cookie with the name "preferences" and a value containing "lightmode" should not exist
|
|
206
|
+
|
|
207
|
+
Assert a cookie with the exact name does not contain a substring in its value.
|
|
208
|
+
|
|
209
|
+
**Keyword**: `Then`
|
|
210
|
+
|
|
211
|
+
**Pattern**
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
'a cookie with the name {string} and a value containing {string} should not exist'
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Examples**
|
|
218
|
+
|
|
219
|
+
```gherkin
|
|
220
|
+
Then a cookie with the name "preferences" and a value containing "lightmode" should not exist
|
|
221
|
+
Then a cookie with the name "tracking" and a value containing "v1-" should not exist
|
|
222
|
+
And a cookie with the name "auth" and a value containing "Basic" should not exist
|
|
223
|
+
Then a cookie with the name "session" and a value containing "expired" should not exist
|
|
224
|
+
Then a cookie with the name "csrf" and a value containing "invalid" should not exist
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## 10. Then a cookie with a name containing "old_" should not exist
|
|
228
|
+
|
|
229
|
+
Assert no cookie name contains a substring.
|
|
230
|
+
|
|
231
|
+
**Keyword**: `Then`
|
|
232
|
+
|
|
233
|
+
**Pattern**
|
|
234
|
+
|
|
235
|
+
```js
|
|
236
|
+
'a cookie with a name containing {string} should not exist'
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Examples**
|
|
240
|
+
|
|
241
|
+
```gherkin
|
|
242
|
+
Then a cookie with a name containing "old_" should not exist
|
|
243
|
+
Then a cookie with a name containing "_legacy" should not exist
|
|
244
|
+
And a cookie with a name containing "deprecated" should not exist
|
|
245
|
+
Given all cookies are cleared
|
|
246
|
+
Then a cookie with a name containing "session" should not exist
|
|
247
|
+
When I press "Logout"
|
|
248
|
+
Then a cookie with a name containing "auth" should not exist
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## 11. Then a cookie with a name containing "session" and the value "expired" should not exist
|
|
252
|
+
|
|
253
|
+
Assert no cookie name+value pair (with partial name) matches.
|
|
254
|
+
|
|
255
|
+
**Keyword**: `Then`
|
|
256
|
+
|
|
257
|
+
**Pattern**
|
|
258
|
+
|
|
259
|
+
```js
|
|
260
|
+
'a cookie with a name containing {string} and the value {string} should not exist'
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Examples**
|
|
264
|
+
|
|
265
|
+
```gherkin
|
|
266
|
+
Then a cookie with a name containing "session" and the value "expired" should not exist
|
|
267
|
+
Then a cookie with a name containing "auth" and the value "anonymous" should not exist
|
|
268
|
+
And a cookie with a name containing "feature_" and the value "off" should not exist
|
|
269
|
+
Then a cookie with a name containing "lang_" and the value "xx" should not exist
|
|
270
|
+
Then a cookie with a name containing "_pref" and the value "default" should not exist
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## 12. Then a cookie with a name containing "session" and a value containing "old" should not exist
|
|
274
|
+
|
|
275
|
+
Assert no cookie partial-name + partial-value pair matches.
|
|
276
|
+
|
|
277
|
+
**Keyword**: `Then`
|
|
278
|
+
|
|
279
|
+
**Pattern**
|
|
280
|
+
|
|
281
|
+
```js
|
|
282
|
+
'a cookie with a name containing {string} and a value containing {string} should not exist'
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Examples**
|
|
286
|
+
|
|
287
|
+
```gherkin
|
|
288
|
+
Then a cookie with a name containing "session" and a value containing "old" should not exist
|
|
289
|
+
Then a cookie with a name containing "auth" and a value containing "Basic" should not exist
|
|
290
|
+
And a cookie with a name containing "tracking" and a value containing "v0-" should not exist
|
|
291
|
+
Then a cookie with a name containing "_pref" and a value containing "lightmode" should not exist
|
|
292
|
+
Then a cookie with a name containing "csrf" and a value containing "invalid" should not exist
|
|
293
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Debug steps
|
|
2
|
+
|
|
3
|
+
2 steps, defined in `tests/step-definitions/debug.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 | `Then print current URL` |
|
|
10
|
+
| 2 | `Then print last response` |
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Then print current URL
|
|
15
|
+
|
|
16
|
+
Print the current page URL to console (debug).
|
|
17
|
+
|
|
18
|
+
**Keyword**: `Then`
|
|
19
|
+
|
|
20
|
+
**Pattern**
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
/^print current URL$/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Examples**
|
|
27
|
+
|
|
28
|
+
```gherkin
|
|
29
|
+
Then print current URL
|
|
30
|
+
When print current URL
|
|
31
|
+
And print current URL
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 2. Then print last response
|
|
35
|
+
|
|
36
|
+
Print the full page HTML (last response) to console (debug).
|
|
37
|
+
|
|
38
|
+
**Keyword**: `Then`
|
|
39
|
+
|
|
40
|
+
**Pattern**
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
/^print last response$/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Examples**
|
|
47
|
+
|
|
48
|
+
```gherkin
|
|
49
|
+
Then print last response
|
|
50
|
+
When print last response
|
|
51
|
+
And print last response
|
|
52
|
+
```
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Browser dialogs steps
|
|
2
|
+
|
|
3
|
+
8 steps, defined in `tests/step-definitions/dialog.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 | `Given I will accept the next dialog` |
|
|
10
|
+
| 2 | `Given I will dismiss the next dialog` |
|
|
11
|
+
| 3 | `Given I will accept the next dialog with "alice@example.com"` |
|
|
12
|
+
| 4 | `Then the last dialog message should be "Are you sure?"` |
|
|
13
|
+
| 5 | `Then the last dialog message should contain "Are you sure"` |
|
|
14
|
+
| 6 | `Then the last dialog type should be "confirm"` |
|
|
15
|
+
| 7 | `Given I accept all confirmation dialogs` |
|
|
16
|
+
| 8 | `Given I do not accept any confirmation dialogs` |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. Given I will accept the next dialog
|
|
21
|
+
|
|
22
|
+
Auto-accept the next native browser dialog (alert / confirm / prompt).
|
|
23
|
+
|
|
24
|
+
**Keyword**: `Given`
|
|
25
|
+
|
|
26
|
+
**Pattern**
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
/^(I |we )*will accept the next dialog$/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Examples**
|
|
33
|
+
|
|
34
|
+
```gherkin
|
|
35
|
+
Given I will accept the next dialog
|
|
36
|
+
When I click "Delete"
|
|
37
|
+
Given we will accept the next dialog
|
|
38
|
+
When I press "Confirm"
|
|
39
|
+
Given I will accept the next dialog
|
|
40
|
+
When I click "Save changes"
|
|
41
|
+
Then I should see "Saved"
|
|
42
|
+
Given I will accept the next dialog
|
|
43
|
+
When I follow "Leave page"
|
|
44
|
+
Given I will accept the next dialog
|
|
45
|
+
When I press "Reset password"
|
|
46
|
+
Then the last dialog type should be "confirm"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 2. Given I will dismiss the next dialog
|
|
50
|
+
|
|
51
|
+
Auto-dismiss the next native browser dialog.
|
|
52
|
+
|
|
53
|
+
**Keyword**: `Given`
|
|
54
|
+
|
|
55
|
+
**Pattern**
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
/^(I |we )*will dismiss the next dialog$/
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Examples**
|
|
62
|
+
|
|
63
|
+
```gherkin
|
|
64
|
+
Given I will dismiss the next dialog
|
|
65
|
+
When I click "Leave page"
|
|
66
|
+
Given we will dismiss the next dialog
|
|
67
|
+
When I press "Cancel reset"
|
|
68
|
+
Given I will dismiss the next dialog
|
|
69
|
+
When I follow "Other site"
|
|
70
|
+
Then I should be on the homepage
|
|
71
|
+
Given I will dismiss the next dialog
|
|
72
|
+
When I press "Delete"
|
|
73
|
+
Then "<.row>" should still be visible
|
|
74
|
+
Given I will dismiss the next dialog
|
|
75
|
+
When I close the tab
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 3. Given I will accept the next dialog with "alice@example.com"
|
|
79
|
+
|
|
80
|
+
Auto-accept the next prompt with the supplied text input.
|
|
81
|
+
|
|
82
|
+
**Keyword**: `Given`
|
|
83
|
+
|
|
84
|
+
**Pattern**
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
/^(I |we )*will accept the next dialog with "([^"]*)"$/
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Examples**
|
|
91
|
+
|
|
92
|
+
```gherkin
|
|
93
|
+
Given I will accept the next dialog with "alice@example.com"
|
|
94
|
+
When I press "Reset password"
|
|
95
|
+
Given I will accept the next dialog with "Yes"
|
|
96
|
+
When I click "Continue"
|
|
97
|
+
Given we will accept the next dialog with "Bug report"
|
|
98
|
+
When I press "Open feedback prompt"
|
|
99
|
+
Given I will accept the next dialog with "12345"
|
|
100
|
+
When I follow "Set order ID"
|
|
101
|
+
Given I will accept the next dialog with "https://example.com"
|
|
102
|
+
When I press "Add link"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 4. Then the last dialog message should be "Are you sure?"
|
|
106
|
+
|
|
107
|
+
Assert the most recently captured dialog message equals an expected value.
|
|
108
|
+
|
|
109
|
+
**Keyword**: `Then`
|
|
110
|
+
|
|
111
|
+
**Pattern**
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
/^the last dialog message should be "([^"]*)"$/
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Examples**
|
|
118
|
+
|
|
119
|
+
```gherkin
|
|
120
|
+
Then the last dialog message should be "Are you sure?"
|
|
121
|
+
Then the last dialog message should be "Delete this item?"
|
|
122
|
+
And the last dialog message should be "Leave site?"
|
|
123
|
+
Then the last dialog message should be "Save changes?"
|
|
124
|
+
When I press "Reset"
|
|
125
|
+
Then the last dialog message should be "Reset all settings?"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 5. Then the last dialog message should contain "Are you sure"
|
|
129
|
+
|
|
130
|
+
Assert the most recently captured dialog message contains an expected substring.
|
|
131
|
+
|
|
132
|
+
**Keyword**: `Then`
|
|
133
|
+
|
|
134
|
+
**Pattern**
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
/^the last dialog message should contain "([^"]*)"$/
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Examples**
|
|
141
|
+
|
|
142
|
+
```gherkin
|
|
143
|
+
Then the last dialog message should contain "Are you sure"
|
|
144
|
+
Then the last dialog message should contain "delete"
|
|
145
|
+
And the last dialog message should contain "leave"
|
|
146
|
+
Then the last dialog message should contain "save"
|
|
147
|
+
When I click "Cancel order"
|
|
148
|
+
Then the last dialog message should contain "cancel"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## 6. Then the last dialog type should be "confirm"
|
|
152
|
+
|
|
153
|
+
Assert the most recently captured dialog type matches one of `alert`,
|
|
154
|
+
`confirm`, `prompt`, or `beforeunload`.
|
|
155
|
+
|
|
156
|
+
**Keyword**: `Then`
|
|
157
|
+
|
|
158
|
+
**Pattern**
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
/^the last dialog type should be "([^"]*)"$/
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Examples**
|
|
165
|
+
|
|
166
|
+
```gherkin
|
|
167
|
+
Then the last dialog type should be "confirm"
|
|
168
|
+
Then the last dialog type should be "alert"
|
|
169
|
+
And the last dialog type should be "prompt"
|
|
170
|
+
Then the last dialog type should be "beforeunload"
|
|
171
|
+
When I press "Reset password"
|
|
172
|
+
Then the last dialog type should be "prompt"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 7. Given I accept all confirmation dialogs
|
|
176
|
+
|
|
177
|
+
Auto-accept EVERY native browser dialog raised in this scenario.
|
|
178
|
+
|
|
179
|
+
Persistent variant of "I will accept the next dialog" — handler stays
|
|
180
|
+
attached for the rest of the scenario.
|
|
181
|
+
|
|
182
|
+
**Keyword**: `Given`
|
|
183
|
+
|
|
184
|
+
**Pattern**
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
/^(I |we )*accept all confirmation dialogs$/
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Examples**
|
|
191
|
+
|
|
192
|
+
```gherkin
|
|
193
|
+
Given I accept all confirmation dialogs
|
|
194
|
+
Given we accept all confirmation dialogs
|
|
195
|
+
When I click "Delete all"
|
|
196
|
+
And I accept all confirmation dialogs
|
|
197
|
+
Given I accept all confirmation dialogs
|
|
198
|
+
When I press "Reset settings"
|
|
199
|
+
Given I accept all confirmation dialogs
|
|
200
|
+
When I follow "Discard changes"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## 8. Given I do not accept any confirmation dialogs
|
|
204
|
+
|
|
205
|
+
Auto-dismiss EVERY native browser dialog raised in this scenario.
|
|
206
|
+
|
|
207
|
+
**Keyword**: `Given`
|
|
208
|
+
|
|
209
|
+
**Pattern**
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
/^(I |we )*do not accept any confirmation dialogs$/
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Examples**
|
|
216
|
+
|
|
217
|
+
```gherkin
|
|
218
|
+
Given I do not accept any confirmation dialogs
|
|
219
|
+
Given we do not accept any confirmation dialogs
|
|
220
|
+
When I click "Delete"
|
|
221
|
+
And I do not accept any confirmation dialogs
|
|
222
|
+
Given I do not accept any confirmation dialogs
|
|
223
|
+
When I press "Cancel reset"
|
|
224
|
+
Given I do not accept any confirmation dialogs
|
|
225
|
+
When I follow "Leave page"
|
|
226
|
+
```
|