Overview
UIkit 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/uikit-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/uikit-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Then the page should use the components script
- When I open the "Newsletter" dialog
- When I close the "Newsletter" dialog
- When I press Escape in the "Newsletter" dialog
- When I click outside the "Newsletter" dialog
- Then the "Newsletter" dialog should be shown
- Then the "Newsletter" dialog should show "Get the news of the month in your mailbox"
- When I press "Subscribe" in the "Newsletter" dialog
- When I choose "Oldest first" from the "Sort by" drop-down menu
- Then "Profile" should be active in the "Account" drop-down menu
- When I hover over the "Save the draft" button
- Then no tooltip should be shown
- When I wait for the transitions to finish
- When I expand the "Returns" panel
- Then the "Shipping" 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 "Security" tab
- Then the "Profile" tab should be active
- Then I should see the alert "A new version of the guide is out."
- When I dismiss the alert "Your profile was updated."
- Then the alert "Your profile was updated." should be dismissible
- Then I should see a success notification "The settings were saved."
- Then the "The settings were saved." notification should hide by itself
- Then I should see a loading spinner
- When I wait for the loading spinner to disappear
- Then the "Upload" progress bar should be at 0%
- Then the "Upload" progress bar should reach 100%
- When I go to the next slide of the "Gallery" slideshow
- When I go to slide 3 of the "Gallery" slideshow
- Then the "Gallery" slideshow should show slide 1 of 3
- Then the "Gallery" slideshow should show "The harbour at dawn"
- Then the "Highlights" slideshow should move to the next slide by itself
- When I open the lightbox from the "The market on Saturday" picture
- When I go to the next picture of the lightbox
- Then the lightbox should show picture 2 of 4
- Then the lightbox should show "The market on Saturday"
- When I close the lightbox
- Then the lightbox should be shown
- Then the "Email" field should be shown as invalid
- Then the "Email" field should show the message "Type an address like name@example.com."
- Then 3 fields should be shown as invalid
- Then "Overview" should be active in the menu
- 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 > Products > Notebooks"
- Then the "Messages" button should show the badge "5"
- Then the "Section menu" should stick to the top of the window
- When I filter the "Colours" list by "Red"
- Then the "Colours" filtered list should show "Notebook"
- Then the "Colours" filtered list should show 2 items
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/uikit-steps.