Overview
Webflow Steps adds step definitions to Webship-js 2.0.x for the markup the platform itself renders, regardless of theme or distribution, so scenarios read as plain sentences instead of CSS selectors. It is a plugin for Webship-js: it ships one file of step definitions you drop into an existing test project, and it composes with the built-in steps rather than duplicating them.
Install
npm install --save-dev @webship-js/webflow-steps
Then add its step file to cucumber.js beside the Webship-js steps:
require: [
'node_modules/webship-js/tests/step-definitions/**/*.js',
'node_modules/@webship-js/webflow-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then I should see 3 items in the "features" collection list
- Then I should see at least 1 item in the "features" collection list
- Then the "features" collection list should not be empty
- Then the "archive" collection list should show the empty message
- Then the "features" collection list should contain "Fast"
- When I open the cart
- Then the cart should be open
- Then the cart should be empty
- Then the cart should contain 1 item
- Then the cart should contain "Course"
- Then the cart total should contain "19"
- When I continue to checkout
- When I add the product to the cart
- Then the product should be out of stock
- Then I should see the add to cart error
- Then I should see the checkout form
- Then the checkout form should have the "customer information" section
- When I select the "Monthly" tab
- Then the "Monthly" tab should be selected
- Then the "Monthly" tab content should be visible
- When I go to the next slide
- Then the slider should show slide 1 of 3
- Then the slider should have 3 slides
- When I open the "Products" dropdown
- Then the "Products" dropdown should be open
- Then the "Products" dropdown should list "Pricing"
- When I open the lightbox
- When I close the lightbox
- Then the lightbox should be open
- Given the form endpoint accepts submissions
- Given the form endpoint rejects submissions
- Given the Turnstile challenge passes
- When I submit the form
- Then I should see the form success message
- Then I should see the form error message
- Then the form success message should contain "Thank you"
- Then the form should be protected by a challenge
- Then the form submit button should be disabled
- Then the background video should be playing
- Then the background video should have a pause control
- When I pause the background video
- Then I should see the navigation menu
- When I open the mobile menu
- Then the mobile menu should be open
- Then the "Home" navigation link should be the current page
- Then the navigation should list "Home"
- Then this should be a published page
- Then this should be the site "6a282ca3f318327eefc29a02"
- Then I should see the hosting badge
Every assertion step reads both polarities from one definition: should see and should not see are the same step. Source and issues: github.com/webship/webflow-steps.