@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,185 @@
|
|
|
1
|
+
Feature: API Step Definitions Individual
|
|
2
|
+
As a developer,
|
|
3
|
+
I want to see individual examples of each API step definition
|
|
4
|
+
So that I can understand how to use each one.
|
|
5
|
+
|
|
6
|
+
# ======================
|
|
7
|
+
# SETUP STEP DEFINITIONS
|
|
8
|
+
# ======================
|
|
9
|
+
|
|
10
|
+
Scenario: Authentication Step
|
|
11
|
+
# Basic Authentication
|
|
12
|
+
Given I am authenticating as "admin" with "password123" password
|
|
13
|
+
|
|
14
|
+
Scenario: Base URL Setup
|
|
15
|
+
# Different ways to set base URL
|
|
16
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
17
|
+
# Alternative syntax:
|
|
18
|
+
# Given I set the API base URL to "https://api.example.com/v1"
|
|
19
|
+
# Given the base URL is "http://localhost:3000/api"
|
|
20
|
+
|
|
21
|
+
Scenario: Single Header Setup
|
|
22
|
+
# Different ways to set headers
|
|
23
|
+
Given I set header "Content-Type" with value "application/json"
|
|
24
|
+
# Alternative syntax:
|
|
25
|
+
# Given I set the header "Authorization" to "Bearer token123"
|
|
26
|
+
# Given the header "Accept" is "application/json"
|
|
27
|
+
|
|
28
|
+
Scenario: Multiple Headers Setup
|
|
29
|
+
Given I set the following headers:
|
|
30
|
+
| Content-Type | application/json |
|
|
31
|
+
| Authorization | Bearer token123 |
|
|
32
|
+
| Accept | application/json |
|
|
33
|
+
|
|
34
|
+
Scenario: Request Body with JSON String
|
|
35
|
+
Given I set the request body to '{"name": "John", "email": "john@example.com"}'
|
|
36
|
+
|
|
37
|
+
Scenario: Request Body with Table
|
|
38
|
+
Given I set the request body with:
|
|
39
|
+
| name | John Doe |
|
|
40
|
+
| email | john@example.com |
|
|
41
|
+
| age | 30 |
|
|
42
|
+
|
|
43
|
+
Scenario: Placeholder Setup
|
|
44
|
+
Given I set placeholder "{{userId}}" to "123"
|
|
45
|
+
Given I set placeholder "{{baseUrl}}" to "https://api.example.com"
|
|
46
|
+
|
|
47
|
+
# ======================
|
|
48
|
+
# WHEN STEP DEFINITIONS (HTTP Requests)
|
|
49
|
+
# ======================
|
|
50
|
+
|
|
51
|
+
Scenario: Basic HTTP Requests
|
|
52
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
53
|
+
# Different HTTP methods
|
|
54
|
+
When I send a GET request to "/users"
|
|
55
|
+
When I send a POST request to "/posts"
|
|
56
|
+
When I send a PUT request to "/users/1"
|
|
57
|
+
When I send a DELETE request to "/posts/1"
|
|
58
|
+
When I send a PATCH request to "/users/1"
|
|
59
|
+
|
|
60
|
+
Scenario: Request with Values Table
|
|
61
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
62
|
+
When I send a POST request to "/users" with values:
|
|
63
|
+
| name | John Doe |
|
|
64
|
+
| email | john@example.com |
|
|
65
|
+
| age | 30 |
|
|
66
|
+
|
|
67
|
+
Scenario: Request with Body DocString
|
|
68
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
69
|
+
When I send a POST request to "/users" with body:
|
|
70
|
+
"""
|
|
71
|
+
{
|
|
72
|
+
"name": "John Doe",
|
|
73
|
+
"email": "john@example.com"
|
|
74
|
+
}
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
Scenario: Request with Form Data
|
|
78
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
79
|
+
When I send a POST request to "/login" with form data:
|
|
80
|
+
"""
|
|
81
|
+
username=admin
|
|
82
|
+
password=secret
|
|
83
|
+
remember=true
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
# ======================
|
|
87
|
+
# THEN STEP DEFINITIONS (Assertions)
|
|
88
|
+
# ======================
|
|
89
|
+
|
|
90
|
+
Scenario: Status Code Assertions
|
|
91
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
92
|
+
When I send a GET request to "/posts/1"
|
|
93
|
+
Then the API response code should be 200
|
|
94
|
+
# Alternative syntax:
|
|
95
|
+
# Then API response code should be 404
|
|
96
|
+
|
|
97
|
+
Scenario: Content Assertions
|
|
98
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
99
|
+
When I send a GET request to "/posts/1"
|
|
100
|
+
Then the API response should contain "userId"
|
|
101
|
+
Then the API response should not contain "password"
|
|
102
|
+
# Alternative syntax:
|
|
103
|
+
# Then API response should contain "John Doe"
|
|
104
|
+
# Then API response should not contain "failed"
|
|
105
|
+
|
|
106
|
+
Scenario: JSON Structure Assertions
|
|
107
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
108
|
+
When I send a GET request to "/posts/1"
|
|
109
|
+
Then the response should be valid JSON
|
|
110
|
+
Then the JSON response should have property "id"
|
|
111
|
+
Then the JSON response should not have property "password"
|
|
112
|
+
# Alternative syntax:
|
|
113
|
+
# Then the API response should be valid JSON
|
|
114
|
+
# Then the API response should contain property "user.email"
|
|
115
|
+
# Then the API response should not contain property "secret"
|
|
116
|
+
|
|
117
|
+
Scenario: JSON Property Value Assertions
|
|
118
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
119
|
+
When I send a GET request to "/posts/1"
|
|
120
|
+
Then the JSON property "userId" should be 1
|
|
121
|
+
Then the JSON property "id" equal to 1
|
|
122
|
+
# Alternative syntax:
|
|
123
|
+
# Then the JSON response should have "name" should be "John"
|
|
124
|
+
# Then the API response should have "active" equal to true
|
|
125
|
+
|
|
126
|
+
Scenario: JSON Content Assertion with DocString
|
|
127
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
128
|
+
And I set the request body to '{"title": "Test Post", "body": "Test content", "userId": 1}'
|
|
129
|
+
When I send a POST request to "/posts"
|
|
130
|
+
Then the API response should contain json:
|
|
131
|
+
"""
|
|
132
|
+
{
|
|
133
|
+
"title": "Test Post",
|
|
134
|
+
"body": "Test content",
|
|
135
|
+
"userId": 1
|
|
136
|
+
}
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
Scenario: Header Assertions
|
|
140
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
141
|
+
When I send a GET request to "/posts/1"
|
|
142
|
+
Then the response header "Content-Type" should be "application/json"
|
|
143
|
+
# Alternative syntax:
|
|
144
|
+
# Then the header "Cache-Control" should contain "no-cache"
|
|
145
|
+
|
|
146
|
+
Scenario: Debug Step
|
|
147
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
148
|
+
When I send a GET request to "/posts/1"
|
|
149
|
+
Then print API response
|
|
150
|
+
|
|
151
|
+
# ======================
|
|
152
|
+
# COMPLETE WORKFLOW EXAMPLES
|
|
153
|
+
# ======================
|
|
154
|
+
|
|
155
|
+
Scenario: Complete CRUD Operations
|
|
156
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
157
|
+
|
|
158
|
+
# CREATE
|
|
159
|
+
And I set the request body to '{"title": "New Post", "body": "Post content", "userId": 1}'
|
|
160
|
+
When I send a POST request to "/posts"
|
|
161
|
+
Then the API response code should be 201
|
|
162
|
+
And the API response should contain "New Post"
|
|
163
|
+
|
|
164
|
+
# READ
|
|
165
|
+
When I send a GET request to "/posts/1"
|
|
166
|
+
Then the API response code should be 200
|
|
167
|
+
And the JSON response should have property "title"
|
|
168
|
+
|
|
169
|
+
# UPDATE
|
|
170
|
+
And I set the request body to '{"id": 1, "title": "Updated Post", "body": "Updated content", "userId": 1}'
|
|
171
|
+
When I send a PUT request to "/posts/1"
|
|
172
|
+
Then the API response code should be 200
|
|
173
|
+
|
|
174
|
+
# DELETE
|
|
175
|
+
When I send a DELETE request to "/posts/1"
|
|
176
|
+
Then the API response code should be 200
|
|
177
|
+
|
|
178
|
+
Scenario: Using Placeholders
|
|
179
|
+
Given I set placeholder "{{userId}}" to "1"
|
|
180
|
+
And I set placeholder "{{postTitle}}" to "Dynamic Title"
|
|
181
|
+
And the API base URL is "https://jsonplaceholder.typicode.com"
|
|
182
|
+
And I set the request body to '{"title": "{{postTitle}}", "body": "Content", "userId": {{userId}}}'
|
|
183
|
+
When I send a POST request to "/posts"
|
|
184
|
+
Then the API response code should be 201
|
|
185
|
+
And the API response should contain "Dynamic Title"
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Feature: Complete API Testing Examples - All Step Definitions
|
|
2
|
+
As a developer,
|
|
3
|
+
I want to test all available API step definitions
|
|
4
|
+
So that I can verify comprehensive API testing capabilities.
|
|
5
|
+
|
|
6
|
+
Background:
|
|
7
|
+
Given the API base URL is "https://jsonplaceholder.typicode.com"
|
|
8
|
+
|
|
9
|
+
Scenario: Basic Authentication and Headers
|
|
10
|
+
Given I am authenticating as "admin" with "password123" password
|
|
11
|
+
And I set header "Content-Type" with value "application/json"
|
|
12
|
+
And I set header "Accept" with value "application/json"
|
|
13
|
+
When I send a GET request to "/posts/1"
|
|
14
|
+
Then the API response code should be 200
|
|
15
|
+
|
|
16
|
+
Scenario: Alternative Header Syntax
|
|
17
|
+
Given I set the header "Content-Type" to "application/json"
|
|
18
|
+
And the header "Accept" is "application/json"
|
|
19
|
+
When I send a GET request to "/posts/1"
|
|
20
|
+
Then the API response code should be 200
|
|
21
|
+
|
|
22
|
+
Scenario: Multiple Headers Using Table
|
|
23
|
+
Given I set the following headers:
|
|
24
|
+
| Content-Type | application/json |
|
|
25
|
+
| Accept | application/json |
|
|
26
|
+
| User-Agent | VarbaseE2E/1.0 |
|
|
27
|
+
When I send a GET request to "/posts"
|
|
28
|
+
Then the API response code should be 200
|
|
29
|
+
|
|
30
|
+
Scenario: GET Request with Response Validation
|
|
31
|
+
When I send a GET request to "/posts/1"
|
|
32
|
+
Then the API response code should be 200
|
|
33
|
+
And the API response should contain "userId"
|
|
34
|
+
And the API response should contain "title"
|
|
35
|
+
And the API response should not contain "password"
|
|
36
|
+
|
|
37
|
+
Scenario: POST Request with JSON Body (String)
|
|
38
|
+
Given I set the request body to '{"title": "Test Post", "body": "This is a test post", "userId": 1}'
|
|
39
|
+
When I send a POST request to "/posts"
|
|
40
|
+
Then the API response code should be 201
|
|
41
|
+
And the API response should contain "Test Post"
|
|
42
|
+
|
|
43
|
+
Scenario: POST Request with Table Body
|
|
44
|
+
Given I set the request body with:
|
|
45
|
+
| title | My New Post |
|
|
46
|
+
| body | This is the content |
|
|
47
|
+
| userId | 1 |
|
|
48
|
+
When I send a POST request to "/posts"
|
|
49
|
+
Then the API response code should be 201
|
|
50
|
+
|
|
51
|
+
Scenario: POST Request with Values Table
|
|
52
|
+
When I send a POST request to "/posts" with values:
|
|
53
|
+
| title | Table Post |
|
|
54
|
+
| body | Created with table |
|
|
55
|
+
| userId | 1 |
|
|
56
|
+
Then the API response code should be 201
|
|
57
|
+
And the API response should contain "Table Post"
|
|
58
|
+
|
|
59
|
+
Scenario: POST Request with DocString Body
|
|
60
|
+
When I send a POST request to "/posts" with body:
|
|
61
|
+
"""
|
|
62
|
+
{
|
|
63
|
+
"title": "DocString Post",
|
|
64
|
+
"body": "Created with docstring",
|
|
65
|
+
"userId": 1
|
|
66
|
+
}
|
|
67
|
+
"""
|
|
68
|
+
Then the API response code should be 201
|
|
69
|
+
And the API response should contain "DocString Post"
|
|
70
|
+
|
|
71
|
+
Scenario: Form Data Request
|
|
72
|
+
When I send a POST request to "/posts" with form data:
|
|
73
|
+
"""
|
|
74
|
+
title=Form Data Post
|
|
75
|
+
body=Created with form data
|
|
76
|
+
userId=1
|
|
77
|
+
"""
|
|
78
|
+
Then the API response code should be 201
|
|
79
|
+
|
|
80
|
+
Scenario: PUT Request for Update
|
|
81
|
+
Given I set the request body to '{"id": 1, "title": "Updated Post", "body": "Updated content", "userId": 1}'
|
|
82
|
+
When I send a PUT request to "/posts/1"
|
|
83
|
+
Then the API response code should be 200
|
|
84
|
+
And the API response should contain "Updated Post"
|
|
85
|
+
|
|
86
|
+
Scenario: PATCH Request
|
|
87
|
+
Given I set the request body to '{"title": "Patched Title"}'
|
|
88
|
+
When I send a PATCH request to "/posts/1"
|
|
89
|
+
Then the API response code should be 200
|
|
90
|
+
|
|
91
|
+
Scenario: DELETE Request
|
|
92
|
+
When I send a DELETE request to "/posts/1"
|
|
93
|
+
Then the API response code should be 200
|
|
94
|
+
|
|
95
|
+
Scenario: JSON Response Structure Validation
|
|
96
|
+
When I send a GET request to "/posts/1"
|
|
97
|
+
Then the API response code should be 200
|
|
98
|
+
And the response should be valid JSON
|
|
99
|
+
And the JSON response should have property "id"
|
|
100
|
+
And the JSON response should have property "title"
|
|
101
|
+
And the JSON response should have property "body"
|
|
102
|
+
And the JSON response should have property "userId"
|
|
103
|
+
And the JSON response should not have property "password"
|
|
104
|
+
|
|
105
|
+
Scenario: Specific JSON Property Values
|
|
106
|
+
When I send a GET request to "/posts/1"
|
|
107
|
+
Then the API response code should be 200
|
|
108
|
+
And the JSON property "userId" should be 1
|
|
109
|
+
And the JSON property "id" should be 1
|
|
110
|
+
|
|
111
|
+
Scenario: JSON Structure Validation with DocString
|
|
112
|
+
When I send a POST request to "/posts" with body:
|
|
113
|
+
"""
|
|
114
|
+
{
|
|
115
|
+
"title": "Test Title",
|
|
116
|
+
"body": "Test Body",
|
|
117
|
+
"userId": 1
|
|
118
|
+
}
|
|
119
|
+
"""
|
|
120
|
+
Then the API response code should be 201
|
|
121
|
+
And the API response should contain json:
|
|
122
|
+
"""
|
|
123
|
+
{
|
|
124
|
+
"title": "Test Title",
|
|
125
|
+
"body": "Test Body",
|
|
126
|
+
"userId": 1
|
|
127
|
+
}
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
Scenario: Response Header Validation
|
|
131
|
+
When I send a GET request to "/posts/1"
|
|
132
|
+
Then the API response code should be 200
|
|
133
|
+
And the response header "Content-Type" should be "application/json"
|
|
134
|
+
|
|
135
|
+
Scenario: Placeholder Usage
|
|
136
|
+
Given I set placeholder "{{postId}}" to "1"
|
|
137
|
+
And I set placeholder "{{userId}}" to "1"
|
|
138
|
+
When I send a GET request to "/posts/{{postId}}"
|
|
139
|
+
Then the API response code should be 200
|
|
140
|
+
And the JSON property "userId" should be {{userId}}
|
|
141
|
+
And the JSON property "id" should be {{postId}}
|
|
142
|
+
|
|
143
|
+
Scenario: Complex Scenario with All Features
|
|
144
|
+
Given I set placeholder "{{newTitle}}" to "Complex API Test"
|
|
145
|
+
And I set placeholder "{{newBody}}" to "Testing all features together"
|
|
146
|
+
And I set the following headers:
|
|
147
|
+
| Content-Type | application/json |
|
|
148
|
+
| Accept | application/json |
|
|
149
|
+
| User-Agent | VarbaseE2E-Testing/1.0 |
|
|
150
|
+
And I set the request body to '{"title": "{{newTitle}}", "body": "{{newBody}}", "userId": 1}'
|
|
151
|
+
When I send a POST request to "/posts"
|
|
152
|
+
Then the API response code should be 201
|
|
153
|
+
And the response should be valid JSON
|
|
154
|
+
And the API response should contain "Complex API Test"
|
|
155
|
+
And the API response should contain "Testing all features together"
|
|
156
|
+
And the JSON response should have property "id"
|
|
157
|
+
And the JSON response should have property "title"
|
|
158
|
+
And the JSON response should have property "body"
|
|
159
|
+
And the JSON response should have property "userId"
|
|
160
|
+
And print API response
|
|
161
|
+
|
|
162
|
+
Scenario: Error Handling Test
|
|
163
|
+
When I send a GET request to "/posts/999999"
|
|
164
|
+
Then the API response code should be 404
|
|
165
|
+
|
|
166
|
+
Scenario: Array Response Testing
|
|
167
|
+
When I send a GET request to "/posts"
|
|
168
|
+
Then the API response code should be 200
|
|
169
|
+
And the response should be valid JSON
|
|
170
|
+
|
|
171
|
+
Scenario: Different HTTP Methods Testing
|
|
172
|
+
# Test all supported HTTP methods
|
|
173
|
+
When I send a GET request to "/posts/1"
|
|
174
|
+
Then the API response code should be 200
|
|
175
|
+
|
|
176
|
+
Given I set the request body to '{"title": "Test", "body": "Test", "userId": 1}'
|
|
177
|
+
When I send a POST request to "/posts"
|
|
178
|
+
Then the API response code should be 201
|
|
179
|
+
|
|
180
|
+
Given I set the request body to '{"id": 1, "title": "Updated", "body": "Updated", "userId": 1}'
|
|
181
|
+
When I send a PUT request to "/posts/1"
|
|
182
|
+
Then the API response code should be 200
|
|
183
|
+
|
|
184
|
+
Given I set the request body to '{"title": "Patched"}'
|
|
185
|
+
When I send a PATCH request to "/posts/1"
|
|
186
|
+
Then the API response code should be 200
|
|
187
|
+
|
|
188
|
+
When I send a DELETE request to "/posts/1"
|
|
189
|
+
Then the API response code should be 200
|
|
190
|
+
|
|
191
|
+
Scenario: Nested JSON Property Testing
|
|
192
|
+
When I send a GET request to "/users/1"
|
|
193
|
+
Then the API response code should be 200
|
|
194
|
+
And the JSON response should have property "address.city"
|
|
195
|
+
And the JSON response should have property "company.name"
|
|
196
|
+
|
|
197
|
+
Scenario: Boolean and Number Property Testing
|
|
198
|
+
Given I set the request body with:
|
|
199
|
+
| title | Test Post |
|
|
200
|
+
| body | Test content |
|
|
201
|
+
| userId | 1 |
|
|
202
|
+
| published | true |
|
|
203
|
+
| views | 100 |
|
|
204
|
+
When I send a POST request to "/posts"
|
|
205
|
+
Then the API response code should be 201
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Feature: Cookie step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Cookie existence and value matching
|
|
4
|
+
Given I am on "/cookies.html"
|
|
5
|
+
Then a cookie with the name "session_id" should exist
|
|
6
|
+
And a cookie with the name "session_id" and the value "abc123" should exist
|
|
7
|
+
And a cookie with the name "preferences" and a value containing "darkmode" should exist
|
|
8
|
+
And a cookie with a name containing "session" should exist
|
|
9
|
+
And a cookie with a name containing "pref" and a value containing "darkmode" should exist
|
|
10
|
+
And a cookie with the name "missing" should not exist
|
|
11
|
+
And a cookie with the name "language" and the value "fr" should not exist
|
|
12
|
+
And a cookie with the name "preferences" and a value containing "lightmode" should not exist
|
|
13
|
+
And a cookie with a name containing "old" should not exist
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Feature: Relative date token resolution
|
|
2
|
+
|
|
3
|
+
Tokens of the form [relative:OFFSET] and [relative:OFFSET#FORMAT]
|
|
4
|
+
are resolved before the step runs. OFFSET supports "+N unit", "-N unit",
|
|
5
|
+
"now", and "next/last <weekday>". Without FORMAT the value is a Unix
|
|
6
|
+
timestamp; with FORMAT it is rendered using YYYY/MM/DD/HH/mm/ss tokens.
|
|
7
|
+
|
|
8
|
+
Scenario: Resolve relative date tokens in step text
|
|
9
|
+
Given I am on "/date.html"
|
|
10
|
+
Then I should see "[relative:now#YYYY]"
|
|
11
|
+
And I should see "[relative:now#MM]"
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Feature: Dynamic Content Handling Examples
|
|
2
|
+
As a tester
|
|
3
|
+
I want to test dynamically loaded content
|
|
4
|
+
So that I can verify the application works with JavaScript-rendered elements
|
|
5
|
+
|
|
6
|
+
Background:
|
|
7
|
+
Given I am on "/dynamic-examples.html"
|
|
8
|
+
|
|
9
|
+
# Example 1: Clicking a button that appears after page load
|
|
10
|
+
Scenario: Click dynamically loaded button
|
|
11
|
+
When I wait 2 seconds
|
|
12
|
+
Then I should see "Dynamic Content Loaded"
|
|
13
|
+
When I press "Submit Form" button
|
|
14
|
+
Then I should see "Form submitted successfully"
|
|
15
|
+
|
|
16
|
+
# Example 2: Filling form fields that are added by JavaScript
|
|
17
|
+
Scenario: Fill in dynamically rendered form fields
|
|
18
|
+
When I click "Show Registration Form"
|
|
19
|
+
And I wait 1 second
|
|
20
|
+
When I fill in "john.doe@example.com" for "#email" by attr
|
|
21
|
+
And I fill in "John Doe" for "#fullname" by attr
|
|
22
|
+
And I fill in "SecurePass123" for "#password" by attr
|
|
23
|
+
And I press "Register" button
|
|
24
|
+
Then I should see "Registration successful"
|
|
25
|
+
|
|
26
|
+
# Example 3: Selecting options from dynamically populated dropdown
|
|
27
|
+
Scenario: Select from dynamically loaded dropdown options
|
|
28
|
+
When I scroll down 200
|
|
29
|
+
And I wait 1 second
|
|
30
|
+
When I click "Load Countries"
|
|
31
|
+
And I wait 2 seconds
|
|
32
|
+
When I select "United States" from "country"
|
|
33
|
+
Then I should see "You selected: United States"
|
|
34
|
+
|
|
35
|
+
# Example 4: Clicking links in dynamically loaded table rows
|
|
36
|
+
Scenario: Interact with dynamically loaded table rows
|
|
37
|
+
When I scroll down 400
|
|
38
|
+
And I wait 1 second
|
|
39
|
+
When I click "Load Users Table"
|
|
40
|
+
And I wait 2 seconds
|
|
41
|
+
Then I should see "John Smith" in the "john@example.com" row
|
|
42
|
+
When I click "Edit" in the "john@example.com" row
|
|
43
|
+
Then I should see "Editing user: john@example.com"
|
|
44
|
+
|
|
45
|
+
# Example 5: Checking dynamically added checkboxes
|
|
46
|
+
Scenario: Check dynamically rendered checkboxes
|
|
47
|
+
When I scroll down 600
|
|
48
|
+
And I wait 1 second
|
|
49
|
+
When I click "Show Preferences"
|
|
50
|
+
And I wait 1 second
|
|
51
|
+
When I check "#newsletter"
|
|
52
|
+
And I check "#notifications"
|
|
53
|
+
Then the "#newsletter" checkbox should be checked
|
|
54
|
+
And the "#notifications" checkbox should be checked
|
|
55
|
+
|
|
56
|
+
# Example 6: Uploading file to dynamically rendered input
|
|
57
|
+
Scenario: Upload file to dynamic file input
|
|
58
|
+
When I scroll down 800
|
|
59
|
+
And I wait 1 second
|
|
60
|
+
When I click "Enable File Upload"
|
|
61
|
+
And I wait 1 second
|
|
62
|
+
When I attach the file "test-document.pdf" to "#file-upload"
|
|
63
|
+
Then I should see "File selected: test-document.pdf"
|
|
64
|
+
|
|
65
|
+
# Example 7: Scrolling to dynamically added elements
|
|
66
|
+
Scenario: Scroll to dynamically loaded content section
|
|
67
|
+
When I scroll down 1200
|
|
68
|
+
And I wait 1 second
|
|
69
|
+
When I click "Load More Content"
|
|
70
|
+
And I wait 2 seconds
|
|
71
|
+
When I scroll to bottom of "#content-container"
|
|
72
|
+
Then I should see "End of dynamic content"
|
|
73
|
+
|
|
74
|
+
# Example 8: Handling removed elements (should not interact)
|
|
75
|
+
Scenario: Verify removed elements are not interacted with
|
|
76
|
+
When I scroll down 1400
|
|
77
|
+
And I wait 1 second
|
|
78
|
+
When I click "Show Temporary Button"
|
|
79
|
+
And I wait 1 second
|
|
80
|
+
Then I should see a "temp-action" element by its "id" attr
|
|
81
|
+
When I click "Remove Button"
|
|
82
|
+
And I wait 1 second
|
|
83
|
+
# This should fail gracefully if the button is removed
|
|
84
|
+
# Then I should not see a "temp-action" element by its "id" attr
|
|
85
|
+
|
|
86
|
+
# Example 9: Single Page Application navigation with dynamic content
|
|
87
|
+
Scenario: Navigate in SPA with dynamically loaded pages
|
|
88
|
+
When I scroll down 1600
|
|
89
|
+
And I wait 1 second
|
|
90
|
+
When I click "Products" by its "data-page" attribute
|
|
91
|
+
And I wait 1 second
|
|
92
|
+
Then I should see "Product Catalog"
|
|
93
|
+
When I click "Add to Cart" in the "Laptop Pro 15" row
|
|
94
|
+
Then I should see "Item added to cart"
|
|
95
|
+
|
|
96
|
+
# Example 10: Batch form filling with dynamically rendered fields
|
|
97
|
+
Scenario: Fill multiple dynamic form fields using table
|
|
98
|
+
When I scroll down 1800
|
|
99
|
+
And I wait 1 second
|
|
100
|
+
When I click "Show Contact Form"
|
|
101
|
+
And I wait 2 seconds
|
|
102
|
+
When I fill in the following: by attr
|
|
103
|
+
| #contact-name | Jane Smith |
|
|
104
|
+
| #contact-email | jane@example.com |
|
|
105
|
+
| #contact-phone | +1-555-0123 |
|
|
106
|
+
| #contact-message | This is a test message |
|
|
107
|
+
And I press "Send Message" button
|
|
108
|
+
Then I should see "Message sent successfully"
|
|
109
|
+
|
|
110
|
+
# Example 11: Testing AJAX-loaded content after user action
|
|
111
|
+
Scenario: Interact with AJAX-loaded search results
|
|
112
|
+
When I scroll down 2200
|
|
113
|
+
And I wait 1 second
|
|
114
|
+
When I fill in "laptop" for "#search-input" by attr
|
|
115
|
+
And I press "Search" button
|
|
116
|
+
And I wait 2 seconds
|
|
117
|
+
Then I should see "Search Results"
|
|
118
|
+
When I click "View Details" in the "Laptop Pro 15" row
|
|
119
|
+
Then I should see "Product Details"
|
|
120
|
+
|
|
121
|
+
# Example 13: Infinite scroll content loading
|
|
122
|
+
Scenario: Load more content with infinite scroll
|
|
123
|
+
When I scroll down 2600
|
|
124
|
+
And I wait 1 second
|
|
125
|
+
When I scroll to bottom
|
|
126
|
+
And I wait 2 seconds
|
|
127
|
+
Then I should see "Loading more items"
|
|
128
|
+
And I wait 3 seconds
|
|
129
|
+
Then I should see "Item 21"
|
|
130
|
+
When I scroll to bottom
|
|
131
|
+
And I wait 2 seconds
|
|
132
|
+
Then I should see "Item 41"
|
|
133
|
+
|
|
134
|
+
# Example 14: React/Vue component interactions
|
|
135
|
+
Scenario: Interact with React component rendered buttons
|
|
136
|
+
When I scroll down 3000
|
|
137
|
+
And I wait 1 second
|
|
138
|
+
When I click "Initialize App"
|
|
139
|
+
And I wait 2 seconds
|
|
140
|
+
Then I should see "React App Loaded"
|
|
141
|
+
When I press "increment-btn" by its "id" attribute
|
|
142
|
+
And I press "increment-btn" by its "id" attribute
|
|
143
|
+
And I press "increment-btn" by its "id" attribute
|
|
144
|
+
Then I should see "Count: 3"
|
|
145
|
+
|
|
146
|
+
# Example 15: Conditional rendering based on user selection
|
|
147
|
+
Scenario: Handle conditionally rendered form fields
|
|
148
|
+
When I scroll down 3400
|
|
149
|
+
And I wait 1 second
|
|
150
|
+
When I select "Business" from "account-type"
|
|
151
|
+
And I wait 1 second
|
|
152
|
+
Then I should see a "company-name" element by attr
|
|
153
|
+
When I fill in "Acme Corporation" for "company-name" by attr
|
|
154
|
+
And I fill in "12-3456789" for "tax-id" by attr
|
|
155
|
+
And I press "Continue" button
|
|
156
|
+
Then I should see "Business account created"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Feature: Element step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Element existence and attribute matching
|
|
4
|
+
Given I am on "/element.html"
|
|
5
|
+
Then the element "h1" with the attribute "data-test" and the value "hero" should exist
|
|
6
|
+
And the element "h1" with the attribute "data-test" and the value containing "her" should exist
|
|
7
|
+
And the element "h1" with the attribute "data-test" and the value "missing" should not exist
|
|
8
|
+
And the element "h1" should be displayed
|
|
9
|
+
And the element "#hidden" should not be displayed
|
|
10
|
+
And the element ".lead[data-role='outro']" should appear after the element ".lead[data-role='intro']"
|
|
11
|
+
And the text "Second paragraph" should appear after the text "First paragraph"
|
|
12
|
+
|
|
13
|
+
Scenario: Click and hover via element steps
|
|
14
|
+
Given I am on "/element.html"
|
|
15
|
+
When I click on the element "#btn"
|
|
16
|
+
Then I should see "clicked"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Feature: Field step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Field state assertions
|
|
4
|
+
Given I am on "/field.html"
|
|
5
|
+
Then the field "username" should exist
|
|
6
|
+
And the field "username" should be empty
|
|
7
|
+
And the field "username" should be required
|
|
8
|
+
And the field "bio" should not be required
|
|
9
|
+
And the field "missing-field" should not exist
|
|
10
|
+
And the option "Admin" should exist within the select element "#role"
|
|
11
|
+
And the option "Manager" should not exist within the select element "#role"
|
|
12
|
+
And the option "Admin" should not be selected within the select element "#role"
|
|
13
|
+
|
|
14
|
+
Scenario: Field interactions
|
|
15
|
+
Given I am on "/field.html"
|
|
16
|
+
When I fill in the field "#username" with "alice"
|
|
17
|
+
And I check the checkbox "#agree"
|
|
18
|
+
And I choose the radio button "#r-red"
|
|
19
|
+
And I fill in the color field "fav" with the value "#ff0000"
|
|
20
|
+
Then the field "username" should not be empty
|
|
21
|
+
And the color field "fav" should have the value "#ff0000"
|
|
22
|
+
|
|
23
|
+
Scenario: Disable browser validation
|
|
24
|
+
Given I am on "/field.html"
|
|
25
|
+
And browser validation for the form "#f" is disabled
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: Keyboard step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Keyboard input
|
|
4
|
+
Given I am on "/keyboard.html"
|
|
5
|
+
When I focus on the element "#inp"
|
|
6
|
+
And I press the key "Enter"
|
|
7
|
+
Then I should see "Enter"
|
|
8
|
+
When I press the key "tab" on the element "#inp"
|
|
9
|
+
And I press the keys "Control+a"
|
|
10
|
+
And I press the keys "Control+a" on the element "#inp"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Feature: Link step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Link href + title assertions
|
|
4
|
+
Given I am on "/links.html"
|
|
5
|
+
Then the link "About" with the href "/about" should exist
|
|
6
|
+
And the link "Contact" with the href "/contact" within the element "#nav" should exist
|
|
7
|
+
And the link "About" with the href "/missing" should not exist
|
|
8
|
+
And the link with the title "About us" should exist
|
|
9
|
+
And the link with the title "Nonexistent" should not exist
|
|
10
|
+
And the link "Example" should be an absolute link
|
|
11
|
+
And the link "About" should not be an absolute link
|