@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,211 @@
|
|
|
1
|
+
# Screenshots steps
|
|
2
|
+
|
|
3
|
+
6 steps, defined in `tests/step-definitions/screenshot.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 I save screenshot` |
|
|
10
|
+
| 2 | `Then I save fullscreen screenshot` |
|
|
11
|
+
| 3 | `Then I save 1440 x 900 screenshot` |
|
|
12
|
+
| 4 | `Then I save fullscreen 1440 x 900 screenshot` |
|
|
13
|
+
| 5 | `Then I save screenshot with name "homepage.png"` |
|
|
14
|
+
| 6 | `Then I save fullscreen screenshot with name "homepage-full.png"` |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. Then I save screenshot
|
|
19
|
+
|
|
20
|
+
Save a screenshot at the current viewport size.
|
|
21
|
+
|
|
22
|
+
**Keyword**: `When`
|
|
23
|
+
|
|
24
|
+
**Pattern**
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
/^(I |we )*save screenshot$/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Examples**
|
|
31
|
+
|
|
32
|
+
```gherkin
|
|
33
|
+
Then I save screenshot
|
|
34
|
+
When I save screenshot
|
|
35
|
+
Then save screenshot
|
|
36
|
+
Given I am on "/about-us"
|
|
37
|
+
Then I save screenshot
|
|
38
|
+
When I go to homepage
|
|
39
|
+
Then I save screenshot
|
|
40
|
+
Given I am on "/news"
|
|
41
|
+
When I scroll to "#latest"
|
|
42
|
+
Then I save screenshot
|
|
43
|
+
Given I am on "/contact"
|
|
44
|
+
When I fill in "email" with "info@vardot.com"
|
|
45
|
+
Then I save screenshot
|
|
46
|
+
Given I am on "/search?q=UN"
|
|
47
|
+
Then I save screenshot
|
|
48
|
+
Then I reload page
|
|
49
|
+
Then I save screenshot
|
|
50
|
+
Given I am on "/partners/un.org"
|
|
51
|
+
Then I save screenshot
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 2. Then I save fullscreen screenshot
|
|
55
|
+
|
|
56
|
+
Save a full-page screenshot (entire scrollable area).
|
|
57
|
+
|
|
58
|
+
**Keyword**: `When`
|
|
59
|
+
|
|
60
|
+
**Pattern**
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
/^(I |we )*save fullscreen screenshot$/
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Examples**
|
|
67
|
+
|
|
68
|
+
```gherkin
|
|
69
|
+
Then I save fullscreen screenshot
|
|
70
|
+
When I save fullscreen screenshot
|
|
71
|
+
Then save fullscreen screenshot
|
|
72
|
+
Given I am on "/news"
|
|
73
|
+
Then I save fullscreen screenshot
|
|
74
|
+
Given I am on "/about-us"
|
|
75
|
+
Then I save fullscreen screenshot
|
|
76
|
+
Given I am on homepage
|
|
77
|
+
Then I save fullscreen screenshot
|
|
78
|
+
Given I am on "/partners"
|
|
79
|
+
When I wait 2 seconds
|
|
80
|
+
Then I save fullscreen screenshot
|
|
81
|
+
Given I am on "/varbase-e2e"
|
|
82
|
+
Then I save fullscreen screenshot
|
|
83
|
+
Given I am on "/un.org/reports"
|
|
84
|
+
Then I save fullscreen screenshot
|
|
85
|
+
Given I am on "/long-article"
|
|
86
|
+
Then I save fullscreen screenshot
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 3. Then I save 1440 x 900 screenshot
|
|
90
|
+
|
|
91
|
+
Resize the viewport to <width> x <height> then save a screenshot.
|
|
92
|
+
|
|
93
|
+
**Keyword**: `When`
|
|
94
|
+
|
|
95
|
+
**Pattern**
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
/^(I |we )*save (\d+) x (\d+) screenshot$/
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Examples**
|
|
102
|
+
|
|
103
|
+
```gherkin
|
|
104
|
+
Then I save 1440 x 900 screenshot
|
|
105
|
+
Then I save 1200 x 800 screenshot
|
|
106
|
+
Then I save 375 x 667 screenshot
|
|
107
|
+
Then I save 768 x 1024 screenshot
|
|
108
|
+
Then I save 1920 x 1080 screenshot
|
|
109
|
+
Given I am on "/about-us"
|
|
110
|
+
Then I save 1440 x 900 screenshot
|
|
111
|
+
Given I am on homepage
|
|
112
|
+
Then I save 375 x 812 screenshot
|
|
113
|
+
Given I am on "/news"
|
|
114
|
+
Then I save 1024 x 768 screenshot
|
|
115
|
+
Given I am on "/about"
|
|
116
|
+
Then I save 1366 x 768 screenshot
|
|
117
|
+
Given I am on "/un.org"
|
|
118
|
+
Then I save 414 x 896 screenshot
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 4. Then I save fullscreen 1440 x 900 screenshot
|
|
122
|
+
|
|
123
|
+
Resize the viewport to <width> x <height> then save a full-page screenshot.
|
|
124
|
+
|
|
125
|
+
**Keyword**: `When`
|
|
126
|
+
|
|
127
|
+
**Pattern**
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
/^(I |we )*save fullscreen (\d+) x (\d+) screenshot$/
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Examples**
|
|
134
|
+
|
|
135
|
+
```gherkin
|
|
136
|
+
Then I save fullscreen 1440 x 900 screenshot
|
|
137
|
+
Then I save fullscreen 1200 x 800 screenshot
|
|
138
|
+
Then I save fullscreen 375 x 667 screenshot
|
|
139
|
+
Then I save fullscreen 768 x 1024 screenshot
|
|
140
|
+
Then I save fullscreen 1920 x 1080 screenshot
|
|
141
|
+
Given I am on "/about-us"
|
|
142
|
+
Then I save fullscreen 1440 x 900 screenshot
|
|
143
|
+
Given I am on homepage
|
|
144
|
+
Then I save fullscreen 375 x 812 screenshot
|
|
145
|
+
Given I am on "/about"
|
|
146
|
+
Then I save fullscreen 1366 x 768 screenshot
|
|
147
|
+
Given I am on "/un.org"
|
|
148
|
+
Then I save fullscreen 414 x 896 screenshot
|
|
149
|
+
Given I am on "/long-article"
|
|
150
|
+
Then I save fullscreen 1440 x 900 screenshot
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 5. Then I save screenshot with name "homepage.png"
|
|
154
|
+
|
|
155
|
+
Save a screenshot using an explicit filename (tokens supported).
|
|
156
|
+
|
|
157
|
+
**Keyword**: `When`
|
|
158
|
+
|
|
159
|
+
**Pattern**
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
/^(I |we )*save screenshot with name "([^"]*)"$/
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Examples**
|
|
166
|
+
|
|
167
|
+
```gherkin
|
|
168
|
+
Then I save screenshot with name "homepage.png"
|
|
169
|
+
Then I save screenshot with name "varbase-e2e-home"
|
|
170
|
+
Then I save screenshot with name "un-landing-{datetime}.png"
|
|
171
|
+
Then I save screenshot with name "about-us.png"
|
|
172
|
+
Then I save screenshot with name "{feature_file}_{step_line}"
|
|
173
|
+
Then I save screenshot with name "{url_path}.png"
|
|
174
|
+
Given I am on "/news"
|
|
175
|
+
Then I save screenshot with name "news-latest.png"
|
|
176
|
+
Given I am on "/about"
|
|
177
|
+
Then I save screenshot with name "varbase-e2e-index.png"
|
|
178
|
+
Given I am on "/un.org"
|
|
179
|
+
Then I save screenshot with name "un-home.png"
|
|
180
|
+
Then I save screenshot with name "contact-form-before-submit.png"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 6. Then I save fullscreen screenshot with name "homepage-full.png"
|
|
184
|
+
|
|
185
|
+
Save a full-page screenshot using an explicit filename (tokens supported).
|
|
186
|
+
|
|
187
|
+
**Keyword**: `When`
|
|
188
|
+
|
|
189
|
+
**Pattern**
|
|
190
|
+
|
|
191
|
+
```js
|
|
192
|
+
/^(I |we )*save fullscreen screenshot with name "([^"]*)"$/
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Examples**
|
|
196
|
+
|
|
197
|
+
```gherkin
|
|
198
|
+
Then I save fullscreen screenshot with name "homepage-full.png"
|
|
199
|
+
Then I save fullscreen screenshot with name "varbase-e2e-home-full"
|
|
200
|
+
Then I save fullscreen screenshot with name "news-{datetime}.png"
|
|
201
|
+
Then I save fullscreen screenshot with name "about-us-full.png"
|
|
202
|
+
Then I save fullscreen screenshot with name "{feature_file}_full.png"
|
|
203
|
+
Then I save fullscreen screenshot with name "{url_path}-full.png"
|
|
204
|
+
Given I am on "/news"
|
|
205
|
+
Then I save fullscreen screenshot with name "news-full.png"
|
|
206
|
+
Given I am on "/about"
|
|
207
|
+
Then I save fullscreen screenshot with name "varbase-e2e-full.png"
|
|
208
|
+
Given I am on "/un.org"
|
|
209
|
+
Then I save fullscreen screenshot with name "un-home-full.png"
|
|
210
|
+
Then I save fullscreen screenshot with name "long-article-full.png"
|
|
211
|
+
```
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Scrolling steps
|
|
2
|
+
|
|
3
|
+
12 steps, defined in `tests/step-definitions/scroll.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 | `And I scroll down` |
|
|
10
|
+
| 2 | `And I scroll up` |
|
|
11
|
+
| 3 | `When I scroll to top` |
|
|
12
|
+
| 4 | `When I scroll to the bottom` |
|
|
13
|
+
| 5 | `When I scroll to top of "#off-canvas"` |
|
|
14
|
+
| 6 | `When I scroll to bottom of "#off-canvas"` |
|
|
15
|
+
| 7 | `And I scroll right` |
|
|
16
|
+
| 8 | `And I scroll left` |
|
|
17
|
+
| 9 | `When I scroll to start` |
|
|
18
|
+
| 10 | `When I scroll to the end` |
|
|
19
|
+
| 11 | `When I scroll to start of "#off-canvas"` |
|
|
20
|
+
| 12 | `When I scroll to end of "#off-canvas"` |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. And I scroll down
|
|
25
|
+
|
|
26
|
+
Scrolls the page down by a custom number of pixels (default 350).
|
|
27
|
+
|
|
28
|
+
**Keyword**: `When`
|
|
29
|
+
|
|
30
|
+
**Pattern**
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
/^(I scroll|we scroll|scrolling)? down(?: (\d+))?$/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Examples**
|
|
37
|
+
|
|
38
|
+
```gherkin
|
|
39
|
+
And I scroll down
|
|
40
|
+
When I scroll down 800
|
|
41
|
+
And we scroll down 500
|
|
42
|
+
When scrolling down 1200
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 2. And I scroll up
|
|
46
|
+
|
|
47
|
+
Scrolls the page up by a custom number of pixels (default 350).
|
|
48
|
+
|
|
49
|
+
**Keyword**: `When`
|
|
50
|
+
|
|
51
|
+
**Pattern**
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
/^(I scroll|we scroll|scrolling)? up(?: (\d+))?$/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Examples**
|
|
58
|
+
|
|
59
|
+
```gherkin
|
|
60
|
+
And I scroll up
|
|
61
|
+
When I scroll up 1000
|
|
62
|
+
And we scroll up 300
|
|
63
|
+
When scrolling up 750
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 3. When I scroll to top
|
|
67
|
+
|
|
68
|
+
Scrolls to the very top of the current page.
|
|
69
|
+
|
|
70
|
+
**Keyword**: `When`
|
|
71
|
+
|
|
72
|
+
**Pattern**
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
/^(I scroll|we scroll|scrolling)? to( the)* top( of the page)*$/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Examples**
|
|
79
|
+
|
|
80
|
+
```gherkin
|
|
81
|
+
When I scroll to top
|
|
82
|
+
And we scroll to the top
|
|
83
|
+
When scrolling to the top of the page
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 4. When I scroll to the bottom
|
|
87
|
+
|
|
88
|
+
Scrolls to the bottom of the current page.
|
|
89
|
+
|
|
90
|
+
**Keyword**: `When`
|
|
91
|
+
|
|
92
|
+
**Pattern**
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
/^(I scroll|we scroll|scrolling)? to( the)* bottom( of the page)*$/
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Examples**
|
|
99
|
+
|
|
100
|
+
```gherkin
|
|
101
|
+
When I scroll to the bottom
|
|
102
|
+
And we scroll to bottom
|
|
103
|
+
When scrolling to the bottom of the page
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 5. When I scroll to top of "#off-canvas"
|
|
107
|
+
|
|
108
|
+
Scrolls to the top of a specific element identified by a CSS selector.
|
|
109
|
+
|
|
110
|
+
**Keyword**: `When`
|
|
111
|
+
|
|
112
|
+
**Pattern**
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
/^(I scroll|we scroll|scrolling)? to top of "([^"]*)"$/
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Examples**
|
|
119
|
+
|
|
120
|
+
```gherkin
|
|
121
|
+
When I scroll to top of "#off-canvas"
|
|
122
|
+
And we scroll to top of "#sidebar"
|
|
123
|
+
When scrolling to top of "#main-container"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 6. When I scroll to bottom of "#off-canvas"
|
|
127
|
+
|
|
128
|
+
Scrolls to the bottom of a specific element identified by a CSS selector.
|
|
129
|
+
|
|
130
|
+
**Keyword**: `When`
|
|
131
|
+
|
|
132
|
+
**Pattern**
|
|
133
|
+
|
|
134
|
+
```js
|
|
135
|
+
/^(I scroll|we scroll|scrolling)? to bottom of "([^"]*)"$/
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Examples**
|
|
139
|
+
|
|
140
|
+
```gherkin
|
|
141
|
+
When I scroll to bottom of "#off-canvas"
|
|
142
|
+
And we scroll to bottom of "#sidebar"
|
|
143
|
+
When scrolling to bottom of "#main-container"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## 7. And I scroll right
|
|
147
|
+
|
|
148
|
+
Scrolls the page right by a custom number of pixels (default 350).
|
|
149
|
+
|
|
150
|
+
**Keyword**: `When`
|
|
151
|
+
|
|
152
|
+
**Pattern**
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
/^(I scroll|we scroll|scrolling)? right(?: (\d+))?$/
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Examples**
|
|
159
|
+
|
|
160
|
+
```gherkin
|
|
161
|
+
And I scroll right
|
|
162
|
+
When I scroll right 1000
|
|
163
|
+
And we scroll right 300
|
|
164
|
+
When scrolling right 750
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## 8. And I scroll left
|
|
168
|
+
|
|
169
|
+
Scrolls the page left by a custom number of pixels (default 350).
|
|
170
|
+
|
|
171
|
+
**Keyword**: `When`
|
|
172
|
+
|
|
173
|
+
**Pattern**
|
|
174
|
+
|
|
175
|
+
```js
|
|
176
|
+
/^(I scroll|we scroll|scrolling)? left(?: (\d+))?$/
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Examples**
|
|
180
|
+
|
|
181
|
+
```gherkin
|
|
182
|
+
And I scroll left
|
|
183
|
+
When I scroll left 800
|
|
184
|
+
And we scroll left 500
|
|
185
|
+
When scrolling left 1200
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 9. When I scroll to start
|
|
189
|
+
|
|
190
|
+
Scrolls to the start (horizontal origin) of the page.
|
|
191
|
+
|
|
192
|
+
**Keyword**: `When`
|
|
193
|
+
|
|
194
|
+
**Pattern**
|
|
195
|
+
|
|
196
|
+
```js
|
|
197
|
+
/^(I scroll|we scroll|scrolling)? to( the)* start( of the page)*$/
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Examples**
|
|
201
|
+
|
|
202
|
+
```gherkin
|
|
203
|
+
When I scroll to start
|
|
204
|
+
And we scroll to the start
|
|
205
|
+
When scrolling to the start of the page
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## 10. When I scroll to the end
|
|
209
|
+
|
|
210
|
+
Scrolls to the end (horizontal maximum) of the page.
|
|
211
|
+
|
|
212
|
+
**Keyword**: `When`
|
|
213
|
+
|
|
214
|
+
**Pattern**
|
|
215
|
+
|
|
216
|
+
```js
|
|
217
|
+
/^(I scroll|we scroll|scrolling)? to( the)* end( of the page)*$/
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Examples**
|
|
221
|
+
|
|
222
|
+
```gherkin
|
|
223
|
+
When I scroll to the end
|
|
224
|
+
And we scroll to end
|
|
225
|
+
When scrolling to the end of the page
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 11. When I scroll to start of "#off-canvas"
|
|
229
|
+
|
|
230
|
+
Scrolls to the start of a specific element identified by a CSS selector.
|
|
231
|
+
|
|
232
|
+
**Keyword**: `When`
|
|
233
|
+
|
|
234
|
+
**Pattern**
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
/^(I scroll|we scroll|scrolling)? to start of "([^"]*)"$/
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Examples**
|
|
241
|
+
|
|
242
|
+
```gherkin
|
|
243
|
+
When I scroll to start of "#off-canvas"
|
|
244
|
+
And we scroll to start of "#sidebar"
|
|
245
|
+
When scrolling to start of "#main-container"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 12. When I scroll to end of "#off-canvas"
|
|
249
|
+
|
|
250
|
+
Scrolls to the end of a specific element identified by a CSS selector.
|
|
251
|
+
|
|
252
|
+
**Keyword**: `When`
|
|
253
|
+
|
|
254
|
+
**Pattern**
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
/^(I scroll|we scroll|scrolling)? to end of "([^"]*)"$/
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Examples**
|
|
261
|
+
|
|
262
|
+
```gherkin
|
|
263
|
+
When I scroll to end of "#off-canvas"
|
|
264
|
+
And we scroll to end of "#sidebar"
|
|
265
|
+
When scrolling to end of "#main-container"
|
|
266
|
+
```
|