Overview
Material UI 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/material-ui-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/material-ui-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Test users
The steps that log in use accounts that already exist on the site, by the handle a feature names (Given I am a logged in user with the "admin" user). The site build creates them; a feature never creates or deletes an account. They are listed in cucumber.js under worldParameters. These are the test accounts of the pack's own test site: put the accounts of your site in your project, and keep real passwords in environment variables.
{
"worldParameters": {
"users": {
"admin": {
"username": "demo",
"password": "demo"
}
}
}
}
Steps
- When I open the "Use Google's location service?" dialog with the "Open alert dialog" button
- When I close the "Use Google's location service?" dialog
- When I press Escape in the "Reset password" dialog
- When I click outside the "Use Google's location service?" dialog
- Then the "Reset password" dialog should be shown
- Then no dialog should be shown
- Then the "Reset password" dialog should show "Enter your account's email address"
- When I press "Agree" in the "Use Google's location service?" dialog
- When I choose "My account" from the "Dashboard" drop-down menu
- Then "Dark" should be active in the "Color mode" drop-down menu
- When I hover over the "Delete" button
- When I wait for the transitions to finish
- Then the "Email" field should be shown as invalid
- Then the "Email" field should show the message "Please enter a valid email address."
- Then 2 fields should be shown as invalid
- When I choose "Twenty" in the "Age" select list
- Then the "Age" select list should show "Twenty"
- Then the "Age" select list should offer "Thirty"
- When I type "God" in the "Movie" search list and choose "The Godfather"
- Then the "Movie" search list should offer "The Godfather: Part II"
- Then the "Movie" search list should show "The Godfather"
- When I expand the "Accordion 1" panel
- Then the "Accordion 1" panel should be expanded
- When I switch to the "Item Two" tab
- Then the "Item Two" tab should be active
- When I expand the "Blog" item of the "pages" tree
- Then the "Blog" item of the "pages" tree should be expanded
- Then the "pages" tree should show "Announcements"
- Then the "Payment details" step should be the current one
- Then the "Shipping address" step should be done
- Then I should see a notification "Note archived"
- Then the "Employee deleted successfully." notification should hide by itself
- Then I should see an alert "This Alert displays the default close icon."
- When I dismiss the alert "This Alert displays the default close icon."
- Then the alert "This Alert displays the default close icon." should be dismissible
- Then I should see a loading spinner
- When I wait for the loading spinner to disappear
- Then the progress bar should be at 10%
- Then the progress bar should reach 50%
- Then the "Open notifications" button should show the badge "4"
- Then the current page of the pagination should be "2"
- Then the "Go to previous page" link of the pagination should be disabled
- Then the breadcrumb should read "MUI > Core > Breadcrumbs"
- Then the "Employees" table should show 3 rows
- Then the "Employees" table should have a row "Edward Perry"
- Then the row "Edward Perry" of the "Employees" table should show "Finance"
- When I press "Delete" in the row "Edward Perry" of the "Employees" table
- When I sort the "Employees" table by "Name"
- Then the "Employees" table should be sorted by "Name" ascending
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/material-ui-steps.
Logo
The logo is MUI's own mark, docs/public/static/logo.svg of github.com/mui/material-ui v9.6.0, unmodified. MUI and its logo are MUI's: the logo names the framework the pack tests. It is not covered by this package's licence.