webship-js 2.0.2 → 2.0.3
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 +109 -0
- package/CLAUDE.md +317 -0
- package/bin/generate-reports.js +181 -9
- package/cucumber.js +10 -4
- 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 +728 -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/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/diffy-step-definitions/then-compare-diffy-env1-env2.md +30 -0
- package/docs/diffy-step-definitions/then-create-diffy-comparison-name-value.md +21 -0
- package/docs/diffy-step-definitions/then-create-diffy-comparison.md +25 -0
- package/docs/diffy-step-definitions/then-create-diffy-screenshot-environment-name.md +35 -0
- package/docs/diffy-step-definitions/then-i-take-screenshot.md +21 -0
- package/docs/diffy-step-definitions/then-i-take-screenshots-all-breakpoints.md +27 -0
- package/docs/diffy-step-definitions/then-send-screenshots-diffy-name-value.md +27 -0
- package/docs/diffy-step-definitions/then-upload-folder-url-diffy-snapshotname.md +28 -0
- package/docs/diffy-step-definitions/then-wait-diffy-comparison-complete.md +21 -0
- package/docs/diffy-step-definitions/when-i-resize-window-number.md +29 -0
- package/docs/diffy-step-definitions.md +21 -0
- package/docs/global-settings.md +244 -0
- package/docs/index.md +104 -0
- package/docs/install-webship-js/ddev-webship-js.md +52 -0
- package/docs/install-webship-js.md +35 -0
- package/docs/overview.md +41 -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 +50 -0
- package/examples/a11y.html +31 -0
- package/examples/cookies.html +10 -0
- package/examples/date.html +12 -0
- package/examples/element.html +11 -0
- package/examples/field.html +24 -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/package.json +10 -3
- package/playwright.config.ts +3 -2
- package/tests/features/a11y.feature +39 -0
- package/tests/features/cookie.feature +13 -0
- package/tests/features/date.feature +11 -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 +1 -1
- 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/wait.feature +7 -0
- package/tests/features/yaml.feature +102 -0
- package/tests/reports/README.md +55 -0
- package/tests/selectors/_canonical-keys.json +113 -0
- package/tests/selectors/back-end-selectors.json +7 -1
- 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/step-definitions/a11y.steps.js +798 -0
- package/tests/step-definitions/action.steps.js +167 -0
- package/tests/step-definitions/{webship-api.js → api.steps.js} +24 -7
- package/tests/step-definitions/assertion.steps.js +352 -0
- package/tests/step-definitions/auth.steps.js +124 -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 +31 -0
- package/tests/step-definitions/dialog.steps.js +193 -0
- package/tests/step-definitions/element.steps.js +314 -0
- package/tests/step-definitions/field.steps.js +653 -0
- package/tests/step-definitions/file-download.steps.js +193 -0
- package/tests/step-definitions/form.steps.js +333 -0
- package/tests/step-definitions/iframe.steps.js +178 -0
- package/tests/step-definitions/input.steps.js +163 -0
- package/tests/step-definitions/javascript.steps.js +71 -0
- package/tests/step-definitions/keyboard.steps.js +78 -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 +219 -0
- package/tests/step-definitions/navigation.steps.js +218 -0
- package/tests/step-definitions/network.steps.js +238 -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 +123 -0
- package/tests/step-definitions/rest.steps.js +111 -0
- package/tests/step-definitions/{webship-screenshot.js → screenshot.steps.js} +1 -5
- package/tests/step-definitions/scroll.steps.js +189 -0
- package/tests/step-definitions/{webship-selectors.js → selectors.steps.js} +46 -11
- package/tests/step-definitions/storage.steps.js +194 -0
- package/tests/step-definitions/table.steps.js +181 -0
- package/tests/step-definitions/wait.steps.js +400 -0
- package/tests/step-definitions/web-first.steps.js +296 -0
- package/tests/step-definitions/webship.js +552 -1507
- package/tests/step-definitions/xml.steps.js +409 -0
- package/tests/step-definitions/yaml.steps.js +911 -0
- package/tests/step-definitions-diffy/webship-diffy.js +0 -13
- package/tsconfig.json +19 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Feature: Accessibility (a11y) smoke checks
|
|
2
|
+
|
|
3
|
+
Scenario: Page-level landmarks and language
|
|
4
|
+
Given I am on "/a11y.html"
|
|
5
|
+
Then the page should declare a language
|
|
6
|
+
And the page language should be "en"
|
|
7
|
+
And the page should have a main landmark
|
|
8
|
+
And the page should have a navigation landmark
|
|
9
|
+
And the page should have exactly one h1
|
|
10
|
+
|
|
11
|
+
Scenario: Image alt text and form labels
|
|
12
|
+
Given I am on "/a11y.html"
|
|
13
|
+
Then every image should have an alt attribute
|
|
14
|
+
And every form field should have an accessible label
|
|
15
|
+
|
|
16
|
+
Scenario: Focused element assertions
|
|
17
|
+
Given I am on "/a11y.html"
|
|
18
|
+
When I focus on the element "#email"
|
|
19
|
+
Then the focused element should match "#email"
|
|
20
|
+
And the focused element should be labeled "Email"
|
|
21
|
+
|
|
22
|
+
Scenario: WCAG hygiene checks (custom probes)
|
|
23
|
+
Given I am on "/a11y.html"
|
|
24
|
+
Then the page should have a title
|
|
25
|
+
And user zoom should be allowed
|
|
26
|
+
And the heading hierarchy should be valid
|
|
27
|
+
And every button should have an accessible name
|
|
28
|
+
And every link should have an accessible name
|
|
29
|
+
And no element should have a positive tabindex
|
|
30
|
+
And every ARIA reference should resolve
|
|
31
|
+
And every ARIA role should be valid
|
|
32
|
+
And required fields should be consistently marked
|
|
33
|
+
|
|
34
|
+
Scenario: axe-core full WCAG audit
|
|
35
|
+
Given I am on "/a11y.html"
|
|
36
|
+
Then the page should have no critical accessibility violations
|
|
37
|
+
And the page should not violate the accessibility rule "image-alt"
|
|
38
|
+
And the page should not violate the accessibility rule "label"
|
|
39
|
+
And the page should pass the accessibility rules "image-alt, label, button-name"
|
|
@@ -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,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
|
|
@@ -50,5 +50,5 @@ Feature: Modal Dialog - Advanced Scenarios
|
|
|
50
50
|
And I click "Submit" button in the modal
|
|
51
51
|
And I wait 1 second
|
|
52
52
|
Then I should see "Message sent successfully" in the modal
|
|
53
|
-
And I wait
|
|
53
|
+
And I wait for the modal to disappear
|
|
54
54
|
Then I should not see the modal
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Feature: Modal step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Open and inspect modal
|
|
4
|
+
Given I am on "/modal.html"
|
|
5
|
+
Then I should not see the modal
|
|
6
|
+
When I click on the element "#open"
|
|
7
|
+
And I wait for the modal to appear
|
|
8
|
+
Then I should see the modal
|
|
9
|
+
And the modal should contain "Welcome modal text"
|
|
10
|
+
And the modal should not contain "Goodbye"
|
|
11
|
+
When I click on "#close-btn" in the modal
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Feature: Path step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Path and query parameter assertions
|
|
4
|
+
Given I am on "/path.html?lang=en&debug=1"
|
|
5
|
+
Then the path should be "/path.html"
|
|
6
|
+
And the path should not be "/wrong"
|
|
7
|
+
And current url should have the "lang" parameter
|
|
8
|
+
And current url should have the "lang" parameter with the "en" value
|
|
9
|
+
And current url should not have the "missing" parameter
|
|
10
|
+
And current url should not have the "lang" parameter with the "fr" value
|
|
11
|
+
|
|
12
|
+
Scenario: History navigation
|
|
13
|
+
Given I am on "/path.html"
|
|
14
|
+
When I go to "/element.html"
|
|
15
|
+
And I go back
|
|
16
|
+
Then the path should be "/path.html"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Feature: Response step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Inspect response headers from main navigation
|
|
4
|
+
Given I am on the homepage
|
|
5
|
+
Then the response should contain the header "content-type"
|
|
6
|
+
And the response header "content-type" should contain the value "html"
|
|
7
|
+
And the response should not contain the header "x-fake-header"
|
|
8
|
+
And the response header "content-type" should not contain the value "application/json"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: Responsive step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Set viewport via breakpoints
|
|
4
|
+
Given I am on the homepage
|
|
5
|
+
When I set the viewport to the "mobile" breakpoint
|
|
6
|
+
And I set the viewport to the "tablet" breakpoint
|
|
7
|
+
And I set the viewport to the "desktop" breakpoint
|
|
8
|
+
And I set the viewport width to 800
|
|
9
|
+
And I set the viewport height to 600
|
|
10
|
+
And I set the viewport to 1024 by 768
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Feature: Table step definitions
|
|
2
|
+
|
|
3
|
+
Scenario: Inspect table content
|
|
4
|
+
Given I am on "/table.html"
|
|
5
|
+
Then the table "#users" should have 3 rows
|
|
6
|
+
And the table "#users" should have 3 columns
|
|
7
|
+
And the table "#users" should not be empty
|
|
8
|
+
And the table "#empty" should be empty
|
|
9
|
+
And the table "#users" should contain the following columns:
|
|
10
|
+
| Name |
|
|
11
|
+
| Role |
|
|
12
|
+
| Status |
|
|
13
|
+
And the table "#users" should be sorted by "Name" in "ascending" order
|
|
14
|
+
And the table "#users" should contain the following rows:
|
|
15
|
+
| Alice | Admin |
|
|
16
|
+
And the "Bob" row should contain the following:
|
|
17
|
+
| User |
|
|
18
|
+
| Active |
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Feature: YAML response assertions
|
|
2
|
+
|
|
3
|
+
Scenario: Existence, equality, contains, count
|
|
4
|
+
Given the YAML response content is the following:
|
|
5
|
+
"""
|
|
6
|
+
apiVersion: apps/v1
|
|
7
|
+
kind: Deployment
|
|
8
|
+
metadata:
|
|
9
|
+
name: web
|
|
10
|
+
labels:
|
|
11
|
+
app: web
|
|
12
|
+
team: platform
|
|
13
|
+
spec:
|
|
14
|
+
replicas: 3
|
|
15
|
+
containers:
|
|
16
|
+
- name: nginx
|
|
17
|
+
image: nginx:1.25
|
|
18
|
+
- name: api
|
|
19
|
+
image: myapp:1.0
|
|
20
|
+
"""
|
|
21
|
+
Then the response should be in YAML format
|
|
22
|
+
And the YAML should have no duplicate keys
|
|
23
|
+
And the YAML element "/kind" should exist
|
|
24
|
+
And the YAML element "/spec/replicas" should be equal to "3"
|
|
25
|
+
And the YAML element "/metadata/name" should contain "we"
|
|
26
|
+
And the YAML element "/spec/containers" should have 2 elements
|
|
27
|
+
And the YAML attribute "kind" on element "/" should exist
|
|
28
|
+
And the YAML attribute "kind" on element "/" should be equal to "Deployment"
|
|
29
|
+
|
|
30
|
+
Scenario: Type and emptiness assertions
|
|
31
|
+
Given the YAML response content is the following:
|
|
32
|
+
"""
|
|
33
|
+
replicas: 3
|
|
34
|
+
name: web
|
|
35
|
+
paused: false
|
|
36
|
+
tags: []
|
|
37
|
+
meta: {}
|
|
38
|
+
notes: null
|
|
39
|
+
"""
|
|
40
|
+
Then the YAML value at "/replicas" should be of type "integer"
|
|
41
|
+
And the YAML value at "/name" should be of type "string"
|
|
42
|
+
And the YAML value at "/paused" should be of type "boolean"
|
|
43
|
+
And the YAML value at "/tags" should be of type "array"
|
|
44
|
+
And the YAML value at "/meta" should be of type "object"
|
|
45
|
+
And the YAML value at "/notes" should be of type "null"
|
|
46
|
+
And the YAML value at "/tags" should be empty
|
|
47
|
+
And the YAML value at "/meta" should be empty
|
|
48
|
+
And the YAML value at "/name" should not be empty
|
|
49
|
+
|
|
50
|
+
Scenario: Numeric comparisons
|
|
51
|
+
Given the YAML response content is the following:
|
|
52
|
+
"""
|
|
53
|
+
spec:
|
|
54
|
+
replicas: 5
|
|
55
|
+
timeout: 30
|
|
56
|
+
"""
|
|
57
|
+
Then the YAML value at "/spec/replicas" should be greater than 0
|
|
58
|
+
And the YAML value at "/spec/replicas" should be greater than or equal to 5
|
|
59
|
+
And the YAML value at "/spec/replicas" should be less than 10
|
|
60
|
+
And the YAML value at "/spec/replicas" should be less than or equal to 5
|
|
61
|
+
And the YAML value at "/timeout" should be between 5 and 60
|
|
62
|
+
|
|
63
|
+
Scenario: Array operations
|
|
64
|
+
Given the YAML response content is the following:
|
|
65
|
+
"""
|
|
66
|
+
spec:
|
|
67
|
+
containers:
|
|
68
|
+
- name: nginx
|
|
69
|
+
image: nginx:1.25
|
|
70
|
+
- name: api
|
|
71
|
+
image: myapp:1.0
|
|
72
|
+
"""
|
|
73
|
+
Then the YAML array at "/spec/containers" should contain an item where "/name" is "nginx"
|
|
74
|
+
And the YAML array at "/spec/containers" should contain no item where "/image" is "alpine:latest"
|
|
75
|
+
And every item in "/spec/containers" should have key "image"
|
|
76
|
+
|
|
77
|
+
Scenario: Key-set assertions
|
|
78
|
+
Given the YAML response content is the following:
|
|
79
|
+
"""
|
|
80
|
+
metadata:
|
|
81
|
+
name: web
|
|
82
|
+
namespace: default
|
|
83
|
+
labels:
|
|
84
|
+
app: web
|
|
85
|
+
"""
|
|
86
|
+
Then the YAML keys at "/metadata" should be exactly "name, namespace, labels"
|
|
87
|
+
And the YAML at "/metadata" should have keys "name, namespace"
|
|
88
|
+
|
|
89
|
+
Scenario: Multi-document streams
|
|
90
|
+
Given the YAML response content is the following:
|
|
91
|
+
"""
|
|
92
|
+
apiVersion: v1
|
|
93
|
+
kind: ConfigMap
|
|
94
|
+
---
|
|
95
|
+
apiVersion: v1
|
|
96
|
+
kind: Service
|
|
97
|
+
"""
|
|
98
|
+
Then the YAML response should have 2 documents
|
|
99
|
+
And the YAML element "/kind" should be equal to "ConfigMap"
|
|
100
|
+
Given the active YAML document is 2
|
|
101
|
+
Then the YAML element "/kind" should be equal to "Service"
|
|
102
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# tests/reports
|
|
2
|
+
|
|
3
|
+
Generated test artefacts land here. Everything in this directory **except this
|
|
4
|
+
README** is gitignored — these files are produced fresh on every run.
|
|
5
|
+
|
|
6
|
+
## What gets written
|
|
7
|
+
|
|
8
|
+
| File | Producer | When |
|
|
9
|
+
| --- | --- | --- |
|
|
10
|
+
| `cucumber_report.json` | `cucumber-js` (default `format` in `cucumber.js`) | Every run |
|
|
11
|
+
| `cucumber_report.html` | `cucumber-html-reporter` (auto-invoked at run end) | Every run |
|
|
12
|
+
| `cucumber_report.pdf` | `bin/generate-reports.js --format pdf` | On demand |
|
|
13
|
+
|
|
14
|
+
Override paths with env vars:
|
|
15
|
+
|
|
16
|
+
| Variable | Default | Effect |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `WEBSHIP_REPORT_JSON` | `tests/reports/cucumber_report.json` | JSON output path |
|
|
19
|
+
| `WEBSHIP_REPORT_OUT` | `tests/reports/cucumber_report.html` | HTML output path |
|
|
20
|
+
| `WEBSHIP_REPORT_DISABLE` | _unset_ | `1` to skip HTML generation |
|
|
21
|
+
| `WEBSHIP_REPORT_THEME` | `bootstrap` | `bootstrap` / `hierarchy` / `foundation` / `simple` |
|
|
22
|
+
| `WEBSHIP_REPORT_TITLE` | `Test Report` | Brand title in the HTML header |
|
|
23
|
+
| `WEBSHIP_REPORT_APP_VERSION` | `2.0.0` | Metadata field |
|
|
24
|
+
| `WEBSHIP_REPORT_ENV` | `development` | Test-environment metadata |
|
|
25
|
+
| `WEBSHIP_REPORT_EXECUTED` | `Remote` | Execution location metadata |
|
|
26
|
+
|
|
27
|
+
## Regenerate manually
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# HTML only (re-uses the JSON from the last run)
|
|
31
|
+
npx generate-reports
|
|
32
|
+
|
|
33
|
+
# HTML + PDF in one shot
|
|
34
|
+
npx generate-reports --format all
|
|
35
|
+
|
|
36
|
+
# PDF only — Letter, landscape, slim margin
|
|
37
|
+
npx generate-reports --format pdf --pdf-format Letter --pdf-landscape --pdf-margin 10mm
|
|
38
|
+
|
|
39
|
+
# Branded PDF with header / footer
|
|
40
|
+
npx generate-reports --format pdf \
|
|
41
|
+
--pdf-header '<div style="font-size:10px;width:100%;text-align:center;">Q3 Regression</div>' \
|
|
42
|
+
--pdf-footer '<div style="font-size:10px;width:100%;text-align:center;"><span class="pageNumber"></span>/<span class="totalPages"></span></div>'
|
|
43
|
+
|
|
44
|
+
# Full help
|
|
45
|
+
npx generate-reports --help
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Why these files are ignored
|
|
49
|
+
|
|
50
|
+
* They change on every run — committing them creates noise and merge conflicts.
|
|
51
|
+
* They are large (HTML ~3 MB, PDF ~5 MB on the full suite).
|
|
52
|
+
* They contain timestamps and per-machine metadata that vary by author.
|
|
53
|
+
|
|
54
|
+
If you need to share a report, attach the file to a PR / issue or upload to
|
|
55
|
+
your CI artefact store rather than committing it.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_description": "Canonical selector key index. CMS/framework JSON files should expose these names so steps work consistently across projects. Framework-specific extras may also be present.",
|
|
3
|
+
"categories": {
|
|
4
|
+
"layout": [
|
|
5
|
+
"main nav",
|
|
6
|
+
"main nav item",
|
|
7
|
+
"sidebar",
|
|
8
|
+
"header bar",
|
|
9
|
+
"main content",
|
|
10
|
+
"page title",
|
|
11
|
+
"page header",
|
|
12
|
+
"footer",
|
|
13
|
+
"breadcrumb",
|
|
14
|
+
"user menu",
|
|
15
|
+
"container"
|
|
16
|
+
],
|
|
17
|
+
"modal": [
|
|
18
|
+
"modal",
|
|
19
|
+
"modal overlay",
|
|
20
|
+
"modal content",
|
|
21
|
+
"modal header",
|
|
22
|
+
"modal title",
|
|
23
|
+
"modal body",
|
|
24
|
+
"modal footer",
|
|
25
|
+
"modal close"
|
|
26
|
+
],
|
|
27
|
+
"buttons": [
|
|
28
|
+
"primary button",
|
|
29
|
+
"secondary button",
|
|
30
|
+
"danger button",
|
|
31
|
+
"save button",
|
|
32
|
+
"cancel button",
|
|
33
|
+
"delete button",
|
|
34
|
+
"publish button",
|
|
35
|
+
"icon button",
|
|
36
|
+
"link button",
|
|
37
|
+
"ghost button"
|
|
38
|
+
],
|
|
39
|
+
"notices": [
|
|
40
|
+
"notice success",
|
|
41
|
+
"notice error",
|
|
42
|
+
"notice warning",
|
|
43
|
+
"notice info",
|
|
44
|
+
"toast"
|
|
45
|
+
],
|
|
46
|
+
"forms": [
|
|
47
|
+
"form",
|
|
48
|
+
"form item",
|
|
49
|
+
"form label",
|
|
50
|
+
"form input",
|
|
51
|
+
"form select",
|
|
52
|
+
"form textarea",
|
|
53
|
+
"form actions",
|
|
54
|
+
"form error",
|
|
55
|
+
"checkbox",
|
|
56
|
+
"checkbox checked",
|
|
57
|
+
"radio",
|
|
58
|
+
"radio checked",
|
|
59
|
+
"switch"
|
|
60
|
+
],
|
|
61
|
+
"tables": [
|
|
62
|
+
"data table",
|
|
63
|
+
"table header",
|
|
64
|
+
"table row",
|
|
65
|
+
"table first row",
|
|
66
|
+
"table row cell"
|
|
67
|
+
],
|
|
68
|
+
"lists": [
|
|
69
|
+
"data list",
|
|
70
|
+
"list item",
|
|
71
|
+
"first list item"
|
|
72
|
+
],
|
|
73
|
+
"tabs": [
|
|
74
|
+
"tabs",
|
|
75
|
+
"tab item",
|
|
76
|
+
"active tab",
|
|
77
|
+
"tab content"
|
|
78
|
+
],
|
|
79
|
+
"navigation": [
|
|
80
|
+
"menu",
|
|
81
|
+
"active menu item",
|
|
82
|
+
"dropdown",
|
|
83
|
+
"dropdown menu",
|
|
84
|
+
"dropdown item",
|
|
85
|
+
"pagination"
|
|
86
|
+
],
|
|
87
|
+
"feedback": [
|
|
88
|
+
"tooltip",
|
|
89
|
+
"popover",
|
|
90
|
+
"spinner",
|
|
91
|
+
"skeleton",
|
|
92
|
+
"progress",
|
|
93
|
+
"badge",
|
|
94
|
+
"tag"
|
|
95
|
+
],
|
|
96
|
+
"search": [
|
|
97
|
+
"search input"
|
|
98
|
+
],
|
|
99
|
+
"card": [
|
|
100
|
+
"card",
|
|
101
|
+
"card content",
|
|
102
|
+
"card header",
|
|
103
|
+
"card footer"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"naming_rules": {
|
|
107
|
+
"case": "kebab words separated by single space (e.g. \"primary button\", \"data table\")",
|
|
108
|
+
"modifiers": "place modifier first (e.g. \"active tab\", \"danger button\", \"first list item\")",
|
|
109
|
+
"no_synonyms": "use canonical name; do not add \"alert\"/\"notification\"/\"callout\" — always \"notice\"",
|
|
110
|
+
"tables_vs_lists": "\"data table\" for HTML tables; \"data list\" for ul/ol/list-of-cards collections",
|
|
111
|
+
"navigation": "site-wide nav = \"main nav\"; admin app sidebar = \"sidebar\"; collapsible inline menu = \"menu\""
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"css": {
|
|
3
|
+
"modal": "[role=\"dialog\"], dialog",
|
|
3
4
|
"admin heading": "h1",
|
|
4
5
|
"admin subline": "h3",
|
|
5
6
|
"admin list": "ul",
|
|
6
|
-
"admin body": "body"
|
|
7
|
+
"admin body": "body",
|
|
8
|
+
"save button": "button[type=\"submit\"], input[type=\"submit\"]",
|
|
9
|
+
"notice success": ".alert-success, .notice-success",
|
|
10
|
+
"notice error": ".alert-danger, .notice-error",
|
|
11
|
+
"data table": "table",
|
|
12
|
+
"search input": "input[type=\"search\"], input[name=\"search\"]"
|
|
7
13
|
},
|
|
8
14
|
"xpath": {
|
|
9
15
|
"admin first heading": "//h1[1]",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"css": {
|
|
3
|
+
"modal": "[role=\"dialog\"], [data-test-id=\"cf-ui-modal\"]",
|
|
4
|
+
"main nav": "[data-test-id=\"main-nav\"], nav[aria-label*=\"main\" i]",
|
|
5
|
+
"page header": "[data-test-id=\"workbench-header\"]",
|
|
6
|
+
"page title": "[data-test-id=\"workbench-header\"] h1",
|
|
7
|
+
"sidebar": "[data-test-id=\"workbench-sidebar\"]",
|
|
8
|
+
"main content": "[data-test-id=\"workbench-main\"]",
|
|
9
|
+
"save button": "[data-test-id=\"workbench-header-actions\"] button:has-text('Save')",
|
|
10
|
+
"publish button": "[data-test-id=\"change-state-published\"], button:has-text('Publish')",
|
|
11
|
+
"archive button": "[data-test-id=\"change-state-archived\"]",
|
|
12
|
+
"primary button": "button.btn-primary, button[data-variant=\"primary\"]",
|
|
13
|
+
"secondary button": "button[data-variant=\"secondary\"]",
|
|
14
|
+
"danger button": "button[data-variant=\"negative\"]",
|
|
15
|
+
"notice success": "[data-test-id=\"cf-ui-notification\"][class*=\"success\"]",
|
|
16
|
+
"notice error": "[data-test-id=\"cf-ui-notification\"][class*=\"error\"]",
|
|
17
|
+
"notice warning": "[data-test-id=\"cf-ui-notification\"][class*=\"warning\"]",
|
|
18
|
+
"data table": "[data-test-id=\"entry-list\"]",
|
|
19
|
+
"table row": "[data-test-id=\"entry-row\"]",
|
|
20
|
+
"form input": "[data-test-id*=\"cf-ui-text-input\"], input.cf-form-input",
|
|
21
|
+
"form label": "[data-test-id*=\"cf-ui-form-label\"], label.cf-form-label",
|
|
22
|
+
"select trigger": "[data-test-id=\"cf-ui-select\"]",
|
|
23
|
+
"tabs": "[data-test-id=\"workbench-tabs\"], [role=\"tablist\"]",
|
|
24
|
+
"tab item": "[role=\"tab\"]",
|
|
25
|
+
"active tab": "[role=\"tab\"][aria-selected=\"true\"]",
|
|
26
|
+
"search input": "[data-test-id=\"search-input\"]",
|
|
27
|
+
"user menu": "[data-test-id=\"account-menu-trigger\"]",
|
|
28
|
+
"breadcrumb": "[data-test-id=\"breadcrumbs\"]"
|
|
29
|
+
},
|
|
30
|
+
"xpath": {
|
|
31
|
+
"page main heading": "//header[@data-test-id='workbench-header']//h1",
|
|
32
|
+
"save button": "//button[contains(.,'Save')]",
|
|
33
|
+
"first entry row": "//*[@data-test-id='entry-row'][1]"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"css": {
|
|
3
|
+
"modal": ".modal.shown, [role=\"dialog\"], .hud",
|
|
4
|
+
"sidebar": "#global-sidebar, .global-sidebar",
|
|
5
|
+
"main nav": "#nav, nav#nav",
|
|
6
|
+
"main nav item": "#nav li a",
|
|
7
|
+
"page title": "#header h1, .header h1, h1.title",
|
|
8
|
+
"page header": "#page-title, #header",
|
|
9
|
+
"save button": "button.submit, .btn.submit, #save-btn",
|
|
10
|
+
"save and continue": "#action-menu .action-btn",
|
|
11
|
+
"primary button": "button.btn.submit, .btn.primary",
|
|
12
|
+
"secondary button": ".btn.secondary",
|
|
13
|
+
"delete button": ".btn.delete",
|
|
14
|
+
"notice success": ".notification.notice, .notice",
|
|
15
|
+
"notice error": ".notification.error, .errors",
|
|
16
|
+
"notice warning": ".notification.warning",
|
|
17
|
+
"data table": "table.data, table.fullwidth",
|
|
18
|
+
"table row": "tbody tr",
|
|
19
|
+
"table first row": "tbody tr:first-child",
|
|
20
|
+
"table checkbox": "td.checkbox-cell input",
|
|
21
|
+
"tabs": "#tabs, .tabs",
|
|
22
|
+
"active tab": "#tabs li.sel, .tabs li.sel",
|
|
23
|
+
"form item": ".field, .flex-fields .field",
|
|
24
|
+
"form input": ".field input.text, .field .nicetext",
|
|
25
|
+
"form label": ".field .heading label, .field label",
|
|
26
|
+
"lightswitch": ".lightswitch",
|
|
27
|
+
"search input": ".search input, #search-container input",
|
|
28
|
+
"filter button": ".btn.menubtn",
|
|
29
|
+
"site picker": "#site-crumb, .site-crumb-button",
|
|
30
|
+
"user menu": "#user-info, .user.menubtn",
|
|
31
|
+
"breadcrumb": ".crumbs, #crumbs"
|
|
32
|
+
},
|
|
33
|
+
"xpath": {
|
|
34
|
+
"page main heading": "//div[@id='header']//h1 | //h1[@class='title']",
|
|
35
|
+
"save button": "//button[contains(@class,'submit')]",
|
|
36
|
+
"first table row": "//table[contains(@class,'data')]//tbody/tr[1]",
|
|
37
|
+
"notification": "//div[contains(@class,'notification')]"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"css": {
|
|
3
|
+
"modal": ".ui-dialog, [role=\"dialog\"], .dialog-off-canvas-main-canvas",
|
|
4
|
+
"main nav": ".gin--navigation, #gin-sidebar, .gin-sidebar",
|
|
5
|
+
"main nav item": ".gin--navigation a, .gin-sidebar a",
|
|
6
|
+
"page title": "h1.page-title, .region-page-title h1",
|
|
7
|
+
"sticky header": ".region-sticky, .region.region-sticky",
|
|
8
|
+
"save button": "#edit-submit, .button--primary, .gin-sticky-form-actions .button--primary",
|
|
9
|
+
"delete button": ".button--danger, a.button[href*='delete']",
|
|
10
|
+
"primary button": ".button--primary",
|
|
11
|
+
"notice success": ".messages--status",
|
|
12
|
+
"notice error": ".messages--error",
|
|
13
|
+
"notice warning": ".messages--warning",
|
|
14
|
+
"breadcrumb": ".gin-breadcrumb, .breadcrumb, nav.breadcrumb",
|
|
15
|
+
"breadcrumb list": ".gin-breadcrumb__list, .breadcrumb__list",
|
|
16
|
+
"breadcrumb back": ".gin-back-to-admin",
|
|
17
|
+
"secondary toolbar": ".gin-secondary-toolbar",
|
|
18
|
+
"header bar": ".gin--navigation-top-bar, .top-bar--gin",
|
|
19
|
+
"local tasks": ".tabs--primary",
|
|
20
|
+
"local task item": ".tabs--primary li",
|
|
21
|
+
"local actions": ".local-actions, .action-links",
|
|
22
|
+
"content area": "main.page-content, .layout-container main",
|
|
23
|
+
"form": ".layout-container form, main form",
|
|
24
|
+
"form item": ".form-item",
|
|
25
|
+
"form input": ".form-element, input.form-text",
|
|
26
|
+
"form select": ".form-element--type-select, select",
|
|
27
|
+
"form textarea": "textarea",
|
|
28
|
+
"form actions": ".form-actions, .gin-sticky-form-actions",
|
|
29
|
+
"more actions": ".gin-more-actions",
|
|
30
|
+
"more actions menu": ".gin-more-actions__menu",
|
|
31
|
+
"sidebar toggle": ".gin-sidebar-toggle",
|
|
32
|
+
"sidebar": ".gin-sidebar",
|
|
33
|
+
"layout container": ".layout-container",
|
|
34
|
+
"data table": "table.views-table, table.responsive-enabled, .gin--table-sticky",
|
|
35
|
+
"table header": "thead tr",
|
|
36
|
+
"table row": "tbody tr",
|
|
37
|
+
"table first row": "tbody tr:first-child",
|
|
38
|
+
"pager": ".pager",
|
|
39
|
+
"pager next": ".pager__item--next a",
|
|
40
|
+
"dropbutton": ".dropbutton-wrapper",
|
|
41
|
+
"layer wrapper": ".gin-layer-wrapper",
|
|
42
|
+
"edit form": ".gin--edit-form",
|
|
43
|
+
"confirm form": ".gin-confirm-form",
|
|
44
|
+
"dark mode toggle": ".gin--dark-mode-toggle",
|
|
45
|
+
"user menu": ".toolbar-tab--toolbar-item-user, .toolbar-icon-user",
|
|
46
|
+
"search input": "input.form-search, input[placeholder*='Search']"
|
|
47
|
+
},
|
|
48
|
+
"xpath": {
|
|
49
|
+
"page main heading": "//h1[contains(@class,'page-title')]",
|
|
50
|
+
"gin nav first item": "//nav[contains(@class,'gin--navigation')]//a[1]",
|
|
51
|
+
"first table row": "//table//tbody/tr[1]",
|
|
52
|
+
"messages block": "//div[contains(@class,'messages')]",
|
|
53
|
+
"save button": "//input[@value='Save'] | //button[normalize-space()='Save']",
|
|
54
|
+
"breadcrumb link": "//nav[contains(@class,'gin-breadcrumb')]//a[1]"
|
|
55
|
+
}
|
|
56
|
+
}
|