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 site navigation should contain "Shop"
- Then "Home" should be the current navigation item
- When I open the mobile navigation menu
- Then the mobile navigation toggle should be visible
- Then the desktop navigation should be visible
- Then the hero title should be "Handmade goods, honestly sourced."
- Then the hero call-to-action button should link to "/shop.html"
- Then the site footer should be visible
- Then the footer should show a copyright notice
- Then the footer navigation should contain "Shop"
- When I fill in the Squarespace form field "Name" with "Jane Doe"
- When I submit the Squarespace form
- Then the Squarespace form should show the submitted confirmation
- Then the shop should list 3 products
- When I add the product "Ceramic Mug" to the cart
- Then the cart should contain 1 item
- Then the blog should list 2 posts
- Then the blog post "Why we use linen instead of canvas" should be visible
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.