webship-js 2.0.10 → 2.0.12
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/.circleci/config.yml +10 -1
- package/.drone.yml +7 -7
- package/.github/ISSUE_TEMPLATE/issue.md +37 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +24 -0
- package/.github/workflows/github-actions.yml +101 -4
- package/.gitlab-ci.yml +9 -4
- package/.harness/webship-js-pipeline.yml +5 -6
- package/.semaphore/semaphore.yml +6 -9
- package/.teamcity/settings.kts +7 -6
- package/.travis.yml +6 -1
- package/AGENTS.md +1 -1
- package/CLAUDE.md +69 -24
- package/Jenkinsfile +5 -3
- package/README.md +13 -1
- package/azure-pipelines.yml +17 -8
- package/bamboo-specs/bamboo.yml +9 -15
- package/bin/generate-reports.js +51 -7
- package/bin/init-webship.js +127 -23
- package/bitbucket-pipelines.yml +5 -1
- package/buildspec.yml +6 -7
- package/cloudbuild.yaml +28 -12
- package/codefresh.yml +6 -6
- package/cucumber.js +46 -11
- package/docs/00-quick-start.md +38 -7
- package/docs/02-bbr-smart-waits.md +21 -10
- package/docs/03-selector-registry.md +24 -0
- package/docs/04-step-reference.md +53 -27
- package/docs/05-web-first-assertions.md +6 -0
- package/docs/07-auth-state.md +1 -1
- package/docs/08-clock-mocking.md +21 -2
- package/docs/09-api-testing.md +40 -2
- package/docs/10-accessibility.md +2 -0
- package/docs/11-debugging.md +24 -1
- package/docs/12-ai-agent-guide.md +8 -1
- package/docs/13-faq.md +75 -1
- package/docs/14-recipes-cookbook.md +2 -0
- package/docs/15-tag-conventions.md +5 -1
- package/docs/16-ci-cd.md +161 -124
- package/docs/README.md +5 -5
- package/docs/advanced-screenshots.md +3 -1
- package/docs/api-step-definitions.md +16 -2
- package/docs/global-settings.md +70 -18
- package/docs/install-webship-js/ddev-webship-js.md +3 -0
- package/docs/install-webship-js.md +16 -2
- package/docs/step-definitions/then-i-should-see.md +14 -1
- package/docs/step-definitions/then-item-checkbox.md +2 -0
- package/docs/step-definitions/when-i-fill.md +4 -0
- package/docs/step-definitions/when-i-select-option-select-list.md +2 -0
- package/examples/a11y-legacy-widget.html +34 -0
- package/examples/auth-state.html +42 -0
- package/examples/choice-controls.html +29 -0
- package/examples/clock.html +33 -0
- package/examples/datetime-fields.html +52 -0
- package/examples/downloads/webship-archive.zip +0 -0
- package/examples/downloads/webship-notes.txt +4 -0
- package/examples/downloads/webship-report.csv +4 -0
- package/examples/downloads.html +16 -0
- package/examples/element-selector-hint.html +16 -0
- package/examples/element-viewport.html +42 -0
- package/examples/field-states.html +27 -0
- package/examples/field-types.html +98 -0
- package/examples/fill-in-empty.html +26 -0
- package/examples/fill-unreachable.html +27 -0
- package/examples/iframe-inner.html +20 -0
- package/examples/iframe-nested.html +16 -0
- package/examples/iframe-newsletter.html +29 -0
- package/examples/iframe-order.html +26 -0
- package/examples/iframe-outer.html +15 -0
- package/examples/iframe.html +21 -0
- package/examples/javascript-errors.html +35 -0
- package/examples/links.html +1 -0
- package/examples/metatags.html +18 -0
- package/examples/mouse-and-pointer.html +83 -0
- package/examples/multi-value-fields.html +54 -0
- package/examples/native-dialogs.html +8 -0
- package/examples/network.html +83 -0
- package/examples/registered-names.html +15 -0
- package/examples/scroll-horizontal.html +50 -0
- package/examples/select-by-label.html +33 -0
- package/examples/selectors-position.html +29 -0
- package/examples/settle-budget.html +21 -0
- package/examples/sorted-tables.html +38 -0
- package/examples/storage.html +57 -0
- package/examples/text-matching.html +48 -0
- package/examples/text-order.html +25 -0
- package/examples/touch.html +22 -0
- package/examples/viewport-size.html +24 -0
- package/examples/viewport-top.html +36 -0
- package/examples/wait-conditions.html +69 -0
- package/examples/web-first.html +99 -0
- package/package.json +24 -2
- package/playwright.config.ts +3 -1
- package/tests/assets/catalog.xml +19 -0
- package/tests/assets/feed-namespaced.xml +13 -0
- package/tests/assets/sitemap.xml +14 -0
- package/tests/assets/webship-site-expected.yaml +21 -0
- package/tests/assets/webship-site.schema.json +46 -0
- package/tests/assets/webship-site.yaml +21 -0
- package/tests/check-api-launch-url.js +106 -0
- package/tests/check-assets.js +103 -0
- package/tests/check-attachments.js +105 -0
- package/tests/check-breakpoints.js +117 -0
- package/tests/check-clock.js +143 -0
- package/tests/check-config.js +90 -0
- package/tests/check-context.js +215 -0
- package/tests/check-dry-run.js +104 -0
- package/tests/check-examples.js +241 -0
- package/tests/check-exit-report.js +141 -0
- package/tests/check-javascript-errors.js +105 -0
- package/tests/check-must-fail.js +85 -0
- package/tests/check-paths.js +82 -0
- package/tests/check-report.js +119 -0
- package/tests/check-scaffold.js +246 -0
- package/tests/check-screenshots.js +117 -0
- package/tests/check-settle-verbs.js +137 -0
- package/tests/check-time-limit.js +104 -0
- package/tests/check-video.js +156 -0
- package/tests/check-world.js +167 -0
- package/tests/features/a11y.feature +18 -0
- package/tests/features/api-base-url.feature +25 -0
- package/tests/features/api-form-data.feature +18 -0
- package/tests/features/api-json-paths.feature +24 -0
- package/tests/features/api-response-contains.feature +21 -0
- package/tests/features/api-response-header-presence.feature +17 -0
- package/tests/features/api-response-header.feature +17 -0
- package/tests/features/api-saved-placeholders.feature +37 -0
- package/tests/features/api-step-definitions-individual.feature +1 -1
- package/tests/features/api-tables.feature +40 -0
- package/tests/features/auth-state.feature +32 -0
- package/tests/features/breakpoints.feature +25 -0
- package/tests/features/choice-controls.feature +35 -0
- package/tests/features/clock.feature +27 -0
- package/tests/features/complete-api-testing-examples.feature +1 -1
- package/tests/features/cookie.feature +9 -0
- package/tests/features/datetime-field-lookup.feature +29 -0
- package/tests/features/dialog.feature +27 -0
- package/tests/features/element-selector-hint.feature +14 -0
- package/tests/features/element.feature +47 -0
- package/tests/features/field-state.feature +21 -0
- package/tests/features/field.feature +104 -0
- package/tests/features/file-download.feature +64 -0
- package/tests/features/fill-in-empty-value.feature +41 -0
- package/tests/features/fill-reachable.feature +13 -0
- package/tests/features/iframe-nested.feature +43 -0
- package/tests/features/iframe.feature +83 -0
- package/tests/features/javascript-tolerated-errors.feature +20 -0
- package/tests/features/javascript.feature +47 -0
- package/tests/features/link.feature +11 -0
- package/tests/features/metatag.feature +38 -0
- package/tests/features/modal-open.feature +13 -0
- package/tests/features/mouse-and-pointer.feature +86 -0
- package/tests/features/multi-value-field-lookup.feature +30 -0
- package/tests/features/network-mocking.feature +80 -0
- package/tests/features/registered-names.feature +14 -0
- package/tests/features/responsive.feature +27 -0
- package/tests/features/scroll-horizontal.feature +55 -0
- package/tests/features/select-by-label.feature +31 -0
- package/tests/features/selector-files.feature +14 -0
- package/tests/features/selectors-position.feature +41 -0
- package/tests/features/selectors-table-header.feature +35 -0
- package/tests/features/settle-budget.feature +11 -0
- package/tests/features/sorted-tables.feature +19 -0
- package/tests/features/storage-quoted-values.feature +26 -0
- package/tests/features/storage.feature +98 -0
- package/tests/features/test--then--i-see-locator.feature +13 -0
- package/tests/features/test--then--i-should--see-text-in-element.feature +9 -1
- package/tests/features/test--then--the-field-should-contain-value.feature +8 -0
- package/tests/features/text-matching.feature +38 -0
- package/tests/features/text-order.feature +14 -0
- package/tests/features/touch.feature +21 -0
- package/tests/features/video.feature +1 -0
- package/tests/features/viewport-top.feature +13 -0
- package/tests/features/wait.feature +89 -0
- package/tests/features/web-first.feature +100 -0
- package/tests/features/xml-namespaces.feature +34 -0
- package/tests/features/xml.feature +96 -0
- package/tests/features/yaml.feature +75 -0
- package/tests/must-fail/api-json-paths.feature +21 -0
- package/tests/must-fail/api-response-contains.feature +23 -0
- package/tests/must-fail/api-response-header-presence.feature +17 -0
- package/tests/must-fail/api-response-header.feature +21 -0
- package/tests/must-fail/api-without-base-url.feature +11 -0
- package/tests/must-fail/assertions.feature +96 -0
- package/tests/must-fail/breakpoints.feature +15 -0
- package/tests/must-fail/choice-controls.feature +25 -0
- package/tests/must-fail/clock.feature +11 -0
- package/tests/must-fail/datetime-field.feature +10 -0
- package/tests/must-fail/element-selector-hint.feature +17 -0
- package/tests/must-fail/field-state.feature +20 -0
- package/tests/must-fail/fill-field.feature +30 -0
- package/tests/must-fail/iframe-text.feature +17 -0
- package/tests/must-fail/modal-open.feature +26 -0
- package/tests/must-fail/multi-value-field.feature +18 -0
- package/tests/must-fail/registered-names.feature +25 -0
- package/tests/must-fail/select-list.feature +15 -0
- package/tests/must-fail/selector-files.feature +10 -0
- package/tests/must-fail/sorted-tables.feature +20 -0
- package/tests/must-fail/storage-before-a-page.feature +13 -0
- package/tests/must-fail/text-matching.feature +16 -0
- package/tests/must-fail/text-order.feature +15 -0
- package/tests/must-fail/viewport-top.feature +20 -0
- package/tests/must-fail/waits.feature +51 -0
- package/tests/must-fail/yaml-numbers.feature +48 -0
- package/tests/reports/README.md +2 -2
- package/tests/step-definitions/a11y.steps.js +36 -23
- package/tests/step-definitions/action.steps.js +22 -8
- package/tests/step-definitions/api.steps.js +349 -67
- package/tests/step-definitions/assertion.steps.js +327 -63
- package/tests/step-definitions/auth.steps.js +15 -18
- package/tests/step-definitions/clock.steps.js +22 -0
- package/tests/step-definitions/debug.steps.js +8 -0
- package/tests/step-definitions/dialog.steps.js +9 -2
- package/tests/step-definitions/element.steps.js +135 -18
- package/tests/step-definitions/field.steps.js +523 -80
- package/tests/step-definitions/file-download.steps.js +74 -10
- package/tests/step-definitions/form.steps.js +76 -29
- package/tests/step-definitions/iframe.steps.js +89 -29
- package/tests/step-definitions/input.steps.js +26 -7
- package/tests/step-definitions/javascript.steps.js +64 -22
- package/tests/step-definitions/modal.steps.js +79 -13
- package/tests/step-definitions/navigation.steps.js +14 -0
- package/tests/step-definitions/network.steps.js +15 -5
- package/tests/step-definitions/response.steps.js +6 -4
- package/tests/step-definitions/responsive.steps.js +26 -33
- package/tests/step-definitions/screenshot.steps.js +26 -9
- package/tests/step-definitions/scroll.steps.js +20 -0
- package/tests/step-definitions/selectors.steps.js +104 -51
- package/tests/step-definitions/storage.steps.js +41 -16
- package/tests/step-definitions/table.steps.js +81 -6
- package/tests/step-definitions/video.steps.js +52 -55
- package/tests/step-definitions/wait.steps.js +209 -54
- package/tests/step-definitions/web-first.steps.js +69 -35
- package/tests/step-definitions/webship.js +807 -128
- package/tests/step-definitions/xml.steps.js +124 -28
- package/tests/step-definitions/yaml.steps.js +90 -46
- package/.scratch/commit.txt +0 -14
- package/.scratch/docs.py +0 -42
- package/.scratch/echo-server.js +0 -8
- package/.scratch/echo.js +0 -35
- package/.scratch/echo.pid +0 -1
- package/.scratch/features/cookies.feature +0 -22
- package/.scratch/http.pid +0 -1
- package/.scratch/https.pid +0 -1
- package/.scratch/issue.md +0 -49
- package/.scratch/one.js +0 -2
- package/.scratch/one.json +0 -280
- package/.scratch/patch.py +0 -163
- package/.scratch/pr.md +0 -30
|
@@ -47,6 +47,24 @@ Feature: YAML response assertions
|
|
|
47
47
|
And the YAML value at "/meta" should be empty
|
|
48
48
|
And the YAML value at "/name" should not be empty
|
|
49
49
|
|
|
50
|
+
Scenario: Content that is not YAML
|
|
51
|
+
Given the YAML response content is the following:
|
|
52
|
+
"""
|
|
53
|
+
items: [one, two
|
|
54
|
+
"""
|
|
55
|
+
Then the response should not be in YAML format
|
|
56
|
+
Given the YAML response content is the following:
|
|
57
|
+
"""
|
|
58
|
+
key: : :
|
|
59
|
+
"""
|
|
60
|
+
Then the response should not be in YAML format
|
|
61
|
+
Given the YAML response content is the following:
|
|
62
|
+
"""
|
|
63
|
+
items: [one, two]
|
|
64
|
+
"""
|
|
65
|
+
Then the response should be in YAML format
|
|
66
|
+
And the YAML element "/items" should have 2 elements
|
|
67
|
+
|
|
50
68
|
Scenario: Numeric comparisons
|
|
51
69
|
Given the YAML response content is the following:
|
|
52
70
|
"""
|
|
@@ -86,6 +104,20 @@ Feature: YAML response assertions
|
|
|
86
104
|
Then the YAML keys at "/metadata" should be exactly "name, namespace, labels"
|
|
87
105
|
And the YAML at "/metadata" should have keys "name, namespace"
|
|
88
106
|
|
|
107
|
+
Scenario: A namespace below the top level is in use, so it is not "not in use"
|
|
108
|
+
Given the YAML response content is the following:
|
|
109
|
+
"""
|
|
110
|
+
apiVersion: apps/v1
|
|
111
|
+
kind: Deployment
|
|
112
|
+
metadata:
|
|
113
|
+
name: web
|
|
114
|
+
namespace: webship-production
|
|
115
|
+
"""
|
|
116
|
+
Then the YAML should use the namespace "apps/v1"
|
|
117
|
+
And the YAML should use the namespace "webship-production"
|
|
118
|
+
And the YAML should not use the namespace "webship-staging"
|
|
119
|
+
And the YAML should not use the namespace "batch/v1"
|
|
120
|
+
|
|
89
121
|
Scenario: Multi-document streams
|
|
90
122
|
Given the YAML response content is the following:
|
|
91
123
|
"""
|
|
@@ -100,3 +132,46 @@ Feature: YAML response assertions
|
|
|
100
132
|
Given the active YAML document is 2
|
|
101
133
|
Then the YAML element "/kind" should be equal to "Service"
|
|
102
134
|
|
|
135
|
+
|
|
136
|
+
Scenario: YAML loaded from a file under tests/assets
|
|
137
|
+
Given the YAML response content from the file "webship-site.yaml"
|
|
138
|
+
Then the response should be in YAML format
|
|
139
|
+
And the YAML response should have 1 document
|
|
140
|
+
And the YAML element "/name" should be equal to "webship-site"
|
|
141
|
+
And the YAML element "/settings/languages/1" should be equal to "fr"
|
|
142
|
+
And the YAML element "/pages" should have 2 elements
|
|
143
|
+
And the YAML array at "/pages" should contain an item where "/title" is "About us"
|
|
144
|
+
|
|
145
|
+
Scenario: Elements that do not exist, are not equal and do not contain
|
|
146
|
+
Given the YAML response content from the file "webship-site.yaml"
|
|
147
|
+
Then the YAML element "/settings/theme" should not exist
|
|
148
|
+
And the YAML element "/pages/2" should not exist
|
|
149
|
+
And the YAML element "/name" should not be equal to "another-site"
|
|
150
|
+
And the YAML element "/version" should not be equal to "3"
|
|
151
|
+
And the YAML element "/owner/contact" should not contain "webmaster"
|
|
152
|
+
And the YAML element "/settings/languages" should not contain "de"
|
|
153
|
+
|
|
154
|
+
Scenario: Keys of an element that do not exist, are not equal, contain and do not contain
|
|
155
|
+
Given the YAML response content from the file "webship-site.yaml"
|
|
156
|
+
Then the YAML attribute "phone" on element "/owner" should not exist
|
|
157
|
+
And the YAML attribute "theme" on element "/settings" should not exist
|
|
158
|
+
And the YAML attribute "team" on element "/owner" should not be equal to "marketing"
|
|
159
|
+
And the YAML attribute "version" on element "/" should not be equal to "1"
|
|
160
|
+
And the YAML attribute "contact" on element "/owner" should contain "@example.com"
|
|
161
|
+
And the YAML attribute "title" on element "/pages/1" should contain "About"
|
|
162
|
+
And the YAML attribute "contact" on element "/owner" should not contain "webmaster"
|
|
163
|
+
And the YAML attribute "homepage" on element "/settings" should not contain "http"
|
|
164
|
+
|
|
165
|
+
Scenario: The YAML matches a JSON Schema
|
|
166
|
+
Given the YAML response content from the file "webship-site.yaml"
|
|
167
|
+
Then the YAML should match JSON Schema "webship-site.schema.json"
|
|
168
|
+
|
|
169
|
+
Scenario: The YAML equals an expected file once the changing keys are left out
|
|
170
|
+
Given the YAML response content from the file "webship-site.yaml"
|
|
171
|
+
Then the YAML should equal the file "webship-site-expected.yaml" ignoring keys "/status"
|
|
172
|
+
And the YAML should equal the file "webship-site-expected.yaml" ignoring keys "/status/updated, /status/revision"
|
|
173
|
+
|
|
174
|
+
Scenario: The namespace the YAML declares
|
|
175
|
+
Given the YAML response content from the file "webship-site.yaml"
|
|
176
|
+
Then the YAML should use the namespace "production"
|
|
177
|
+
And the YAML should not use the namespace "staging"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: API JSON property checks that must fail, and what they say
|
|
3
|
+
Every scenario names a property of /example-api.json wrongly or asserts a
|
|
4
|
+
wrong value. tests/check-must-fail.js checks the message, the request and
|
|
5
|
+
the hint.
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the API base URL is "/"
|
|
9
|
+
When I send a GET request to "/example-api.json"
|
|
10
|
+
|
|
11
|
+
Scenario: A JSON Pointer to a property that is there, asserted absent
|
|
12
|
+
Fails with: The JSON response has "/data/0/type", but it should not.
|
|
13
|
+
Then the JSON response should not have property "/data/0/type"
|
|
14
|
+
|
|
15
|
+
Scenario: A path whose last part is missing
|
|
16
|
+
Fails with: The JSON response has no "data.0.discount": "data.0" has no "discount".
|
|
17
|
+
Then the JSON response should have "data.0.discount" equal to 10
|
|
18
|
+
|
|
19
|
+
Scenario: A wrong value
|
|
20
|
+
Fails with: The JSON response has "data.0.type" equal to "articles", not "people".
|
|
21
|
+
Then the JSON response should have "data.0.type" equal to "people"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: API response text checks that must fail, and what they say
|
|
3
|
+
Every scenario asserts something about /example-api.json that is not true.
|
|
4
|
+
tests/check-must-fail.js runs them and checks that each one fails at its
|
|
5
|
+
last step with the message its description announces, the request it was
|
|
6
|
+
sent with and a hint.
|
|
7
|
+
|
|
8
|
+
Background:
|
|
9
|
+
Given the API base URL is "/"
|
|
10
|
+
When I send a GET request to "/example-api.json"
|
|
11
|
+
|
|
12
|
+
Scenario: A text that is in the response in another letter case
|
|
13
|
+
Fails with: The API response contains "json:api paints my bikeshed", but it should not.
|
|
14
|
+
Then the API response should not contain "json:api paints my bikeshed"
|
|
15
|
+
|
|
16
|
+
Scenario: A placeholder whose value is in the response
|
|
17
|
+
Fails with: The API response contains "John", but it should not.
|
|
18
|
+
Given I set placeholder "{{author}}" to "John"
|
|
19
|
+
Then the API response should not contain "{{author}}"
|
|
20
|
+
|
|
21
|
+
Scenario: A text that is not in the response
|
|
22
|
+
Fails with: The API response does not contain "Completely different words".
|
|
23
|
+
Then the API response should contain "Completely different words"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: API response header presence checks that must fail, and what they say
|
|
3
|
+
Every scenario asserts a header of /example-api.json is there, or is not,
|
|
4
|
+
when the opposite is true. tests/check-must-fail.js checks the message, the
|
|
5
|
+
request and the hint.
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the API base URL is "/"
|
|
9
|
+
When I send a GET request to "/example-api.json"
|
|
10
|
+
|
|
11
|
+
Scenario: A header the response does not have
|
|
12
|
+
Fails with: The API response has no "X-Powered-By" header.
|
|
13
|
+
Then the API response should contain the header "X-Powered-By"
|
|
14
|
+
|
|
15
|
+
Scenario: A header the response has
|
|
16
|
+
Fails with: The API response has the header "ETag", but it should not.
|
|
17
|
+
Then the API response should not contain the header "ETag"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: API response header checks that must fail, and what they say
|
|
3
|
+
Every scenario asserts something about the headers of /example-api.json
|
|
4
|
+
that is not true. tests/check-must-fail.js checks the message, the request
|
|
5
|
+
and the hint.
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the API base URL is "/"
|
|
9
|
+
When I send a GET request to "/example-api.json"
|
|
10
|
+
|
|
11
|
+
Scenario: "should be" given a part of the value
|
|
12
|
+
Fails with: The response header "Content-Type" is "application/json; charset=UTF-8", not "json".
|
|
13
|
+
Then the response header "Content-Type" should be "json"
|
|
14
|
+
|
|
15
|
+
Scenario: "should contain" given a text the value does not hold
|
|
16
|
+
Fails with: The response header "Content-Type" does not contain "text/html".
|
|
17
|
+
Then the response header "Content-Type" should contain "text/html"
|
|
18
|
+
|
|
19
|
+
Scenario: A header the response does not have
|
|
20
|
+
Fails with: The API response has no "X-Not-Sent" header.
|
|
21
|
+
Then the header "X-Not-Sent" should be "anything"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: An API request without a base URL must fail, and say why
|
|
3
|
+
The API base URL belongs to the scenario that sets it. A scenario that sets
|
|
4
|
+
none fails at its first request with a path, even when another scenario of
|
|
5
|
+
the run set one before it (the scenarios of api-response-contains.feature
|
|
6
|
+
run first and set "/"). tests/check-must-fail.js checks the message, the
|
|
7
|
+
request and the hint.
|
|
8
|
+
|
|
9
|
+
Scenario: A request to a path in a scenario that set no base URL
|
|
10
|
+
Fails with: No API base URL is set, so "/example-api.json" has no address.
|
|
11
|
+
When I send a GET request to "/example-api.json"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Assertions that must fail, and what they say
|
|
3
|
+
Every scenario asserts something that is not true on the example pages.
|
|
4
|
+
tests/check-must-fail.js runs them and checks that each one fails at its
|
|
5
|
+
last step with the message its description announces, the address of the
|
|
6
|
+
page and a hint.
|
|
7
|
+
|
|
8
|
+
Scenario: A text that is not on the page
|
|
9
|
+
Fails with: The text "Completely different words" was not found on the page after 5 seconds.
|
|
10
|
+
Given I am on "/about-us.html"
|
|
11
|
+
Then I should see "Completely different words"
|
|
12
|
+
|
|
13
|
+
Scenario: A text that is on the page
|
|
14
|
+
Fails with: The text "Paragraph example" is on the page, but it should not be.
|
|
15
|
+
Given I am on "/about-us.html"
|
|
16
|
+
Then I should not see "Paragraph example"
|
|
17
|
+
|
|
18
|
+
Scenario: No text matches a pattern
|
|
19
|
+
Fails with: No text of the page matches "\d{4}-\d{2}-\d{2}".
|
|
20
|
+
Given I am on "/about-us.html"
|
|
21
|
+
Then I should see text matching "\d{4}-\d{2}-\d{2}"
|
|
22
|
+
|
|
23
|
+
Scenario: An element that is not on the page
|
|
24
|
+
Fails with: No element with the text or the label "No such label" was found after 3 seconds.
|
|
25
|
+
Given I am on "/about-us.html"
|
|
26
|
+
Then I should see a "No such label" element
|
|
27
|
+
|
|
28
|
+
Scenario: An element that is not on the page, by attribute
|
|
29
|
+
Fails with: No element with "no-such-element-here" was found after 3 seconds.
|
|
30
|
+
Given I am on "/about-us.html"
|
|
31
|
+
Then I should see a "no-such-element-here" element by attr
|
|
32
|
+
|
|
33
|
+
Scenario: An element that is on the page, by attribute
|
|
34
|
+
Fails with: An element with "paragraphid" is on the page, but it should not be.
|
|
35
|
+
Given I am on "/about-us.html"
|
|
36
|
+
Then I should not see a "paragraphid" element by attr
|
|
37
|
+
|
|
38
|
+
Scenario: A wrong text in an element
|
|
39
|
+
Fails with: The element "h1" does not contain "Completely different words".
|
|
40
|
+
Given I am on "/about-us.html"
|
|
41
|
+
Then I should see "Completely different words" in the "h1" element
|
|
42
|
+
|
|
43
|
+
Scenario: A text in an element that is not on the page
|
|
44
|
+
Fails with: The element "#no-such-element-here" was not found on the page after 5 seconds.
|
|
45
|
+
Given I am on "/about-us.html"
|
|
46
|
+
Then I should see "About Us" in the "#no-such-element-here" element
|
|
47
|
+
|
|
48
|
+
Scenario: A wrong text in an element, by attribute
|
|
49
|
+
Fails with: The element with "paragraphid" does not contain "Completely different words".
|
|
50
|
+
Given I am on "/about-us.html"
|
|
51
|
+
Then I should see "Completely different words" in the "paragraphid" element by attr
|
|
52
|
+
|
|
53
|
+
Scenario: A text of an element that does not match a pattern
|
|
54
|
+
Fails with: The text of the element "h1" does not match "^Contact".
|
|
55
|
+
Given I am on "/about-us.html"
|
|
56
|
+
Then I should see text matching "^Contact" in the "h1" element
|
|
57
|
+
|
|
58
|
+
Scenario: A wrong text in a table row
|
|
59
|
+
Fails with: The "Alice" row does not contain "Pending".
|
|
60
|
+
Given I am on "/table.html"
|
|
61
|
+
Then I should see "Pending" in the "Alice" row
|
|
62
|
+
|
|
63
|
+
Scenario: A table row that is not there
|
|
64
|
+
Fails with: No table row contains "Zoe"
|
|
65
|
+
Given I am on "/table.html"
|
|
66
|
+
Then I should see "Active" in the "Zoe" row
|
|
67
|
+
|
|
68
|
+
Scenario: A wrong number of elements
|
|
69
|
+
Fails with: Expected 7 "#users tbody tr" element(s), got 3.
|
|
70
|
+
Given I am on "/table.html"
|
|
71
|
+
Then I should see 7 "#users tbody tr" elements
|
|
72
|
+
|
|
73
|
+
Scenario: A wrong CSS value
|
|
74
|
+
Fails with: The element "paragraphid" does not have the CSS "display: none".
|
|
75
|
+
Given I am on "/about-us.html"
|
|
76
|
+
Then the "paragraphid" element should contain "display: none"
|
|
77
|
+
|
|
78
|
+
Scenario: A link that leads somewhere else
|
|
79
|
+
Fails with: The address of the link "Contact" does not contain "/pricing".
|
|
80
|
+
Given I am on "/links.html"
|
|
81
|
+
Then the "Contact" link should contain "/pricing"
|
|
82
|
+
|
|
83
|
+
Scenario: A link that is not on the page
|
|
84
|
+
Fails with: No visible link with the text "Pricing" was found after 5 seconds.
|
|
85
|
+
Given I am on "/links.html"
|
|
86
|
+
Then the "Pricing" link should contain "/pricing"
|
|
87
|
+
|
|
88
|
+
Scenario: A wrong response status code
|
|
89
|
+
Fails with: Expected the response status code 404, got 200.
|
|
90
|
+
Given I am on "/about-us.html"
|
|
91
|
+
Then the response status code should be 404
|
|
92
|
+
|
|
93
|
+
Scenario: A response that does not contain a text
|
|
94
|
+
Fails with: The response does not contain "Completely different words".
|
|
95
|
+
Given I am on "/about-us.html"
|
|
96
|
+
Then the response should contain "Completely different words"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Breakpoints that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one fails
|
|
4
|
+
at its last step with the message its description announces, the address
|
|
5
|
+
of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: A breakpoint nobody named
|
|
8
|
+
Fails with: There is no breakpoint named "watch".
|
|
9
|
+
Given I am on "/viewport-size.html"
|
|
10
|
+
When I set the viewport to the "watch" breakpoint
|
|
11
|
+
|
|
12
|
+
Scenario: A breakpoint nobody named, by the viewing-the-site step
|
|
13
|
+
Fails with: There is no breakpoint named "phablet".
|
|
14
|
+
Given I am on "/viewport-size.html"
|
|
15
|
+
When I am viewing the site on a "phablet" screen
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Checkbox, radio button and field steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint, within a few seconds.
|
|
6
|
+
|
|
7
|
+
Scenario: A checkbox that is not on the page
|
|
8
|
+
Fails with: No checkbox with the label, the name, the id or the selector "Subscribe" was found after 5 seconds.
|
|
9
|
+
Given I am on "/choice-controls.html"
|
|
10
|
+
Then the "Subscribe" checkbox should be checked
|
|
11
|
+
|
|
12
|
+
Scenario: A checkbox that is not checked
|
|
13
|
+
Fails with: The checkbox "Accept the terms" is not checked.
|
|
14
|
+
Given I am on "/choice-controls.html"
|
|
15
|
+
Then the checkbox "Accept the terms" should be checked
|
|
16
|
+
|
|
17
|
+
Scenario: A radio button that is selected
|
|
18
|
+
Fails with: The radio button "Premium" is selected, but it should not be.
|
|
19
|
+
Given I am on "/choice-controls.html"
|
|
20
|
+
Then the radio button "Premium" should not be selected
|
|
21
|
+
|
|
22
|
+
Scenario: A field that is not on the page
|
|
23
|
+
Fails with: No field with the label, the name, the id or the selector "Country" was found after 5 seconds.
|
|
24
|
+
Given I am on "/choice-controls.html"
|
|
25
|
+
When I fill in the field "Country" with "Jordan"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Clock steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one fails
|
|
4
|
+
at its last step with the message its description announces, the address
|
|
5
|
+
of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: Waiting for the timers of the page under a fake clock
|
|
8
|
+
Fails with: A fake clock is installed, so the timers of the page run only when the clock moves.
|
|
9
|
+
Given I am on "/clock.html"
|
|
10
|
+
And the system time is "2026-05-08T10:00:00Z"
|
|
11
|
+
When I wait until pending timers settle
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Datetime steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: A datetime field that has no time input
|
|
8
|
+
Fails with: The datetime field "Opening" has no time input.
|
|
9
|
+
Given I am on "/datetime-fields.html"
|
|
10
|
+
When I fill in the time part of the datetime field "Opening" with "09:00"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: An element named by a selector where the step reads a text
|
|
3
|
+
`I should see a "…" element` names the element by its exact visible text or
|
|
4
|
+
by its label. tests/check-must-fail.js runs these scenarios and checks that
|
|
5
|
+
each one fails at its last step with the message its description announces
|
|
6
|
+
(here: the hint that the argument looks like a selector), the address of the
|
|
7
|
+
page and a hint.
|
|
8
|
+
|
|
9
|
+
Scenario: A class selector where the step reads a text
|
|
10
|
+
Fails with: ".news-item" looks like a CSS selector, but this step reads it as the exact text of an element or of a label. For a selector, use: ".news-item" should be visible
|
|
11
|
+
Given I am on "/element-selector-hint.html"
|
|
12
|
+
Then I should see a ".news-item" element
|
|
13
|
+
|
|
14
|
+
Scenario: A tag name where the step reads a text
|
|
15
|
+
Fails with: "header" looks like a CSS selector, but this step reads it as the exact text of an element or of a label. For a selector, use: "header" should be visible
|
|
16
|
+
Given I am on "/element-selector-hint.html"
|
|
17
|
+
Then I should see a "header" element
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Field state checks that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: An editable field is not read-only
|
|
8
|
+
Fails with: The field "Username" is not read-only.
|
|
9
|
+
Given I am on "/field-states.html"
|
|
10
|
+
Then the field "Username" should have "read-only" state
|
|
11
|
+
|
|
12
|
+
Scenario: A disabled field is not editable
|
|
13
|
+
Fails with: The field "Account ID" is not editable.
|
|
14
|
+
Given I am on "/field-states.html"
|
|
15
|
+
Then the field "Account ID" should have "editable" state
|
|
16
|
+
|
|
17
|
+
Scenario: A state the step does not know
|
|
18
|
+
Fails with: "valid" is not a state this step can check.
|
|
19
|
+
Given I am on "/field-states.html"
|
|
20
|
+
Then the field "Username" should have "valid" state
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Fill steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint, within a few seconds.
|
|
6
|
+
|
|
7
|
+
Scenario: A field that is hidden
|
|
8
|
+
Fails with: The field "Hidden note" is on the page but hidden, so it cannot be filled.
|
|
9
|
+
Given I am on "/fill-unreachable.html"
|
|
10
|
+
When I fill in "Hidden note" with "Some words"
|
|
11
|
+
|
|
12
|
+
Scenario: A field that is disabled
|
|
13
|
+
Fails with: The field "Locked code" is disabled, so it cannot be filled.
|
|
14
|
+
Given I am on "/fill-unreachable.html"
|
|
15
|
+
When I fill in "Locked code" with "X2"
|
|
16
|
+
|
|
17
|
+
Scenario: A field that is read-only
|
|
18
|
+
Fails with: The field "Reference" is read-only, so it cannot be filled.
|
|
19
|
+
Given I am on "/fill-unreachable.html"
|
|
20
|
+
When I fill in "R-2" for "Reference"
|
|
21
|
+
|
|
22
|
+
Scenario: A hidden field named by attribute
|
|
23
|
+
Fails with: The field "#note" is on the page but hidden, so it cannot be filled.
|
|
24
|
+
Given I am on "/fill-unreachable.html"
|
|
25
|
+
When I fill in "#note" with "Some words" by attr
|
|
26
|
+
|
|
27
|
+
Scenario: A field named by attribute that is not on the page
|
|
28
|
+
Fails with: No field with "no-such-field" was found after 5 seconds.
|
|
29
|
+
Given I am on "/fill-unreachable.html"
|
|
30
|
+
When I fill in "no-such-field" with "Some words" by attr
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Iframe steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: A text that is not inside the iframe
|
|
8
|
+
Fails with: The text "Payment received" was not found inside the iframe after 5 seconds.
|
|
9
|
+
Given I am on "/iframe.html"
|
|
10
|
+
When I switch to iframe "#order-frame"
|
|
11
|
+
Then I should see "Payment received" inside the iframe
|
|
12
|
+
|
|
13
|
+
Scenario: A text that is inside the iframe
|
|
14
|
+
Fails with: The text "Order form inside the iframe" is inside the iframe, but it should not be.
|
|
15
|
+
Given I am on "/iframe.html"
|
|
16
|
+
When I switch to iframe "#order-frame"
|
|
17
|
+
Then I should not see "Order form inside the iframe" inside the iframe
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Modal steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint, within a few seconds.
|
|
6
|
+
|
|
7
|
+
Scenario: A click in the modal when no modal is open
|
|
8
|
+
Fails with: No modal is open: none was visible after 5 seconds.
|
|
9
|
+
Given I am on "/modal.html"
|
|
10
|
+
When I click "OK" in the modal
|
|
11
|
+
|
|
12
|
+
Scenario: A click on an element in the modal when no modal is open
|
|
13
|
+
Fails with: No modal is open: none was visible after 5 seconds.
|
|
14
|
+
Given I am on "/modal.html"
|
|
15
|
+
When I click on "#close-btn" in the modal
|
|
16
|
+
|
|
17
|
+
Scenario: Closing the modal when no modal is open
|
|
18
|
+
Fails with: No modal is open: none was visible after 5 seconds.
|
|
19
|
+
Given I am on "/modal.html"
|
|
20
|
+
When I close the modal
|
|
21
|
+
|
|
22
|
+
Scenario: A button the open modal does not have
|
|
23
|
+
Fails with: The open modal has no button or link "Launch".
|
|
24
|
+
Given I am on "/modal.html"
|
|
25
|
+
When I click on the element "#open"
|
|
26
|
+
And I click "Launch" in the modal
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Multi-value steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint, within a few seconds.
|
|
6
|
+
|
|
7
|
+
Scenario: A multi-value field that is not on the page
|
|
8
|
+
Fails with: No multi-value field "Hobbies" was found after 5 seconds.
|
|
9
|
+
Given I am on "/multi-value-fields.html"
|
|
10
|
+
When I fill in the multi-value field "Hobbies" with the following values:
|
|
11
|
+
| chess |
|
|
12
|
+
|
|
13
|
+
Scenario: More values than the field has inputs
|
|
14
|
+
Fails with: The multi-value field "Websites" has 1 input for 2 values.
|
|
15
|
+
Given I am on "/multi-value-fields.html"
|
|
16
|
+
When I fill in the multi-value field "Websites" with the following values:
|
|
17
|
+
| https://example.com |
|
|
18
|
+
| https://example.org |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: A name of the selector registry given to a step that does not read it
|
|
3
|
+
A step that takes a text, a label or a CSS selector in quotes does not read
|
|
4
|
+
the selector registry. tests/check-must-fail.js runs these scenarios and
|
|
5
|
+
checks that each one fails at its last step with the message its
|
|
6
|
+
description announces (here: the hint that names the registry), the address
|
|
7
|
+
of the page and a hint.
|
|
8
|
+
|
|
9
|
+
Scenario: A registered name given to a web-first step
|
|
10
|
+
Fails with: "premium-banner" is a name of the selector registry (.promo-banner), but this step does not read the registry. Use: I see visible premium-banner, or: ".promo-banner" should be visible
|
|
11
|
+
Given I am on "/registered-names.html"
|
|
12
|
+
When I add "premium-banner" selector for ".promo-banner" css selector
|
|
13
|
+
Then "premium-banner" should be visible
|
|
14
|
+
|
|
15
|
+
Scenario: A registered name given to an element step
|
|
16
|
+
Fails with: "premium-banner" is a name of the selector registry (.promo-banner), but this step does not read the registry. Use: the element ".promo-banner" should be at the top of the viewport
|
|
17
|
+
Given I am on "/registered-names.html"
|
|
18
|
+
When I add "premium-banner" selector for ".promo-banner" css selector
|
|
19
|
+
Then the element "premium-banner" should be at the top of the viewport
|
|
20
|
+
|
|
21
|
+
Scenario: A registered name given to the fill step
|
|
22
|
+
Fails with: "search box" is a name of the selector registry (.search-box input), but this step does not read the registry. Use: I fill in the field ".search-box input" with "laptops"
|
|
23
|
+
Given I am on "/registered-names.html"
|
|
24
|
+
When I add "search box" selector for ".search-box input" css selector
|
|
25
|
+
And I fill in "search box" with "laptops"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Select steps that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint, within a few seconds.
|
|
6
|
+
|
|
7
|
+
Scenario: A select list that is not on the page
|
|
8
|
+
Fails with: No select list with the label, the name or the id "Bikes" was found after 5 seconds.
|
|
9
|
+
Given I am on "/select-by-label.html"
|
|
10
|
+
When I select "Saab" from "Bikes"
|
|
11
|
+
|
|
12
|
+
Scenario: An option that is not in the select list
|
|
13
|
+
Fails with: The select list "Cars" has no option "Tesla".
|
|
14
|
+
Given I am on "/select-by-label.html"
|
|
15
|
+
When I select "Tesla" from "Cars"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Selector files that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one fails
|
|
4
|
+
at its last step with the message its description announces, the address of
|
|
5
|
+
the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: A selector file that is not there
|
|
8
|
+
Fails with: The selector file "no-such-selectors.json" was not found.
|
|
9
|
+
Given I am on homepage
|
|
10
|
+
When I add selectors from "no-such-selectors.json" file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Sorted-table assertions that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: A price column out of order
|
|
8
|
+
Fails with: The table "#unsorted" is not sorted by "Price" in ascending order: row 1 ("$49.99") comes before row 2 ("$9.99").
|
|
9
|
+
Given I am on "/sorted-tables.html"
|
|
10
|
+
Then the table "#unsorted" should be sorted by "Price" in "ascending" order
|
|
11
|
+
|
|
12
|
+
Scenario: A column that is not in the table
|
|
13
|
+
Fails with: The table "#prices" has no "Colour" column.
|
|
14
|
+
Given I am on "/sorted-tables.html"
|
|
15
|
+
Then the table "#prices" should be sorted by "Colour" in "ascending" order
|
|
16
|
+
|
|
17
|
+
Scenario: A table that is not on the page
|
|
18
|
+
Fails with: No table matches "#no-such-table".
|
|
19
|
+
Given I am on "/sorted-tables.html"
|
|
20
|
+
Then the table "#no-such-table" should be sorted by "Price" in "ascending" order
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Storage steps before the first page, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one fails
|
|
4
|
+
at its last step with the message its description announces, the address of
|
|
5
|
+
the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: Local storage set before a page of the site is open
|
|
8
|
+
Fails with: Could not set the local storage "theme": the page has no site yet.
|
|
9
|
+
Given the local storage "theme" is set to "dark"
|
|
10
|
+
|
|
11
|
+
Scenario: Session storage cleared before a page of the site is open
|
|
12
|
+
Fails with: Could not clear the session storage: the page has no site yet.
|
|
13
|
+
Given session storage is cleared
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Page-text assertions that must fail, whatever the letter case
|
|
3
|
+
`I should not see` reads the page the way `I should see` does: letter case
|
|
4
|
+
ignored, hidden text included. tests/check-must-fail.js runs these
|
|
5
|
+
scenarios and checks that each one fails at its last step with the message
|
|
6
|
+
its description announces, the address of the page and a hint.
|
|
7
|
+
|
|
8
|
+
Scenario: A text that is on the page in another letter case
|
|
9
|
+
Fails with: The text "next page" is on the page, but it should not be.
|
|
10
|
+
Given I am on "/text-matching.html"
|
|
11
|
+
Then I should not see "next page"
|
|
12
|
+
|
|
13
|
+
Scenario: A hidden text that is on the page
|
|
14
|
+
Fails with: The text "members save 10 percent" is on the page, but it should not be.
|
|
15
|
+
Given I am on "/text-matching.html"
|
|
16
|
+
Then I should not see "members save 10 percent"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Text-order assertions that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: The first places on the whole page are in the other order
|
|
8
|
+
Fails with: The text "Products" does not appear after the text "Home" on the page.
|
|
9
|
+
Given I am on "/text-order.html"
|
|
10
|
+
Then the text "Products" should appear after the text "Home"
|
|
11
|
+
|
|
12
|
+
Scenario: A text that is not on the page
|
|
13
|
+
Fails with: The text "Desktops" is not on the page.
|
|
14
|
+
Given I am on "/text-order.html"
|
|
15
|
+
Then the text "Desktops" should appear after the text "Home"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@must-fail
|
|
2
|
+
Feature: Top-of-the-viewport assertions that must fail, and what they say
|
|
3
|
+
tests/check-must-fail.js runs these scenarios and checks that each one
|
|
4
|
+
fails at its last step with the message its description announces, the
|
|
5
|
+
address of the page and a hint.
|
|
6
|
+
|
|
7
|
+
Scenario: An element far below the top
|
|
8
|
+
Fails with: The element "#section-5" is not at the top of the viewport after 5 seconds.
|
|
9
|
+
Given I am on "/viewport-top.html"
|
|
10
|
+
Then the element "#section-5" should be at the top of the viewport
|
|
11
|
+
|
|
12
|
+
Scenario: An element that is hidden
|
|
13
|
+
Fails with: The element "#hidden-section" is on the page but not visible after 5 seconds.
|
|
14
|
+
Given I am on "/viewport-top.html"
|
|
15
|
+
Then the element "#hidden-section" should be at the top of the viewport
|
|
16
|
+
|
|
17
|
+
Scenario: An element that is not on the page
|
|
18
|
+
Fails with: No element matches "#no-such-section" after 5 seconds.
|
|
19
|
+
Given I am on "/viewport-top.html"
|
|
20
|
+
Then the element "#no-such-section" should be at the top of the viewport
|