Overview
Bootstrap Steps adds step definitions to Webship-js 2.0.x for the components a site's theme is built on, whatever its CMS or framework, 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/bootstrap-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/bootstrap-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then the page should use the components script
- When I open the "Modal title" dialog
- When I close the "Modal title" dialog
- When I press Escape in the "Modal title" dialog
- When I click outside the "Modal title" dialog
- Then the "Modal title" dialog should be shown
- Then the "Modal title" dialog should show "Woo-hoo, you're reading this text in a modal!"
- When I press "Save changes" in the "Modal title" dialog
- When I choose "Another action" from the "Dropdown button" drop-down menu
- Then "Active link" should be active in the "Item states" drop-down menu
- When I hover over the "Tooltip on top" button
- Then no tooltip should be shown
- When I wait for the transitions to finish
- When I expand the "Accordion Item #2" panel
- Then the "Accordion Item #1" panel should be expanded
- When I expand the navigation bar
- Then the navigation bar should be collapsed
- Then the navigation bar should show its toggle button
- When I switch to the "Profile" tab
- Then the "Home" tab should be active
- Then I should see the alert "A simple primary alert"
- When I dismiss the alert "Holy guacamole!"
- Then the alert "Holy guacamole!" should be dismissible
- Then the "Draft saved" notification should hide by itself
- Then I should see a loading spinner
- When I wait for the loading spinner to disappear
- Then the "Quarter done" progress bar should be at 25%
- Then the "Upload" progress bar should reach 100%
- When I go to the next slide of the "Featured" carousel
- When I go to slide 3 of the "Featured" carousel
- Then the "Featured" carousel should show slide 1 of 3
- Then the "Featured" carousel should show "First slide label"
- Then the "Autoplay" carousel should move to the next slide by itself
- Then the "City" field should be shown as invalid
- Then the "City" field should show the message "Please provide a valid city."
- Then 5 fields should be shown as invalid
- Then the list item "An active item" should be active
- Then the current page of the pagination should be "1"
- Then the "Previous" link of the pagination should be disabled
- Then the breadcrumb should read "Home > Library > Data"
- Then the "Inbox" button should show the badge "99+"
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/bootstrap-steps.