Overview
Squarespace 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/squarespace-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/squarespace-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then the announcement bar should be visible
- Then the announcement bar should say "Free shipping on orders over 50"
- Then the announcement bar should link to "/news"
- When I close the announcement bar
- Then the cookie banner should be visible
- Then the cookie banner should say "We use cookies to improve your experience."
- When I accept the cookies
- When I decline the cookies
- Then the blog should list 3 posts
- Then the blog post "Get Out There!" should be visible
- When I open the blog post "Get Out There!"
- Then the blog post title should be "Get Out There!"
- Then the blog post should show the author "Author Name"
- Then the blog post should show the date "May 28"
- Then the gallery should show 3 images
- When I search the site for "news"
- Then the search results should contain "News"
- Then the search should find 2 results
- Then the search should find no results
- When I fill in the form field "Email" with "info@webship.co"
- When I choose "Press inquiry" for the form field "Inquiry"
- When I submit the form
- Then the form should show an error for the field "Email"
- Then the form should show the error "Email is required."
- Then the form should show the submitted confirmation
- When I fill in the newsletter form field "Email Address" with "subscriber@example.com"
- When I submit the newsletter form
- Then the newsletter form should show an error for the field "Email Address"
- Then the newsletter form should show the error "Email Address is required."
- Then the newsletter form should show the submitted confirmation
- Then the site navigation should contain "Shop"
- Then "News" should be the current navigation item
- Then the desktop navigation should be visible
- Then the mobile navigation toggle should be visible
- When I open the mobile menu
- When I close the mobile menu
- Then the mobile menu should be open
- Then the mobile menu should contain "News"
- When I open the "About" navigation folder
- Then the "About" navigation folder should contain "Contact"
- Then the hero title should be "Starts With You"
- Then the hero call-to-action button should link to "/take-action"
- Then the site footer should be visible
- Then the footer should show a copyright notice
- Then the footer navigation should contain "Contact"
- Then the site should use version "7.1"
- Then the site title should be "Bailard Foundation"
- Then the site language should be "en-US"
- Then the shop should list 6 products
- Then the shop should list the product "Genuine Gemini"
- When I open the product "Genuine Gemini"
- Then the product title should be "Genuine Gemini"
- Then the product price should be "$25.00"
- When I set the product quantity to 2
- When I add the product "Genuine Gemini" to the cart
- When I add the product to the cart
- When I open the cart
- Then the cart should contain 1 item
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/squarespace-steps.