Overview
Headless 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/headless-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/headless-ui-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- When I open the "Options" drop-down menu
- When I close the "Deactivate account" dialog
- When I press Escape in the "Deactivate account" dialog
- When I click outside the "Deactivate account" dialog
- Then the "Deactivate account" dialog should be shown
- Then no dialog should be shown
- Then the "Deactivate account" dialog should show "This will permanently deactivate your account"
- When I press "Deactivate" in the "Deactivate account" dialog
- When I choose "Account settings" from the "Options" drop-down menu
- Then "Account settings" should be active in the "Options" drop-down menu
- When I wait for the transitions to finish
- Then the "Full name" field should be shown as invalid
- Then the "Full name" field should show the message "Enter your full name."
- Then 2 fields should be shown as invalid
- When I choose "Devon Webb" in the "Assigned to" select list
- Then the "Assigned to" select list should show "Devon Webb"
- Then the "Assigned to" select list should offer "Devon Webb"
- When I type "wa" in the "Assigned to" search list and choose "Wade Cooper"
- When I type "wa" in the "Assigned to" search list
- Then the "Assigned to" search list should offer "Wade Cooper"
- Then the "Assigned to" search list should show "Wade Cooper"
- When I turn on the "Enable notifications" switch
- Then the "Enable notifications" switch should be turned on
- When I choose "Private to Project Members" in the "Privacy setting" radio group
- Then "Private to Project Members" should be chosen in the "Privacy setting" radio group
- When I expand the "Trigger" panel
- Then the "Trigger" panel should be expanded
- When I switch to the "Billing" tab
- Then the "Billing" tab should be active
- Then the "Company" tab should be disabled
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/headless-ui-steps.
Logo
The logo is Simple Icons' Headless UI icon (icons/headlessui.svg of simple-icons 16.37.0, CC0-1.0), in the colour the set lists for the brand; its path is unmodified. Headless UI and its mark are Tailwind Labs': the logo names the library the pack tests. It is not covered by this package's licence.