Overview
HubSpot CMS 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/hubspot-cms-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/hubspot-cms-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then the page should be a HubSpot page
- When I accept the HubSpot cookie banner
- When I decline the HubSpot cookie banner
- Then the HubSpot cookie banner should be visible
- When I fill in the HubSpot form field "email" with "jane@example.com"
- When I submit the HubSpot form
- Then the HubSpot form should show a success message
- When I click the HubSpot CTA "See Pricing"
- Then the HubSpot CTA "See Pricing" should link to "/pricing.html"
- Then the HubSpot menu should have a link labeled "Pricing"
- Then the HubSpot blog should list at least 1 post
- When I open the HubSpot blog post titled "Why BDD testing matters for marketing sites"
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/hubspot-cms-steps.