Overview
Svelte 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/svelte-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/svelte-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Given the app has taken over the page
- Then the app should have taken over the page
- Then the page should have no client-side code
- When I wait for the app to come to rest
- When I follow the "Sverdle" link in the app
- When I go back in the app
- When I point at the "Sverdle" link
- Then the last navigation should have stayed in the app
- Then the navigation should be announced as "Sverdle"
- Then the "Sverdle" link should mark the current page
- Then I should be at the top of the page for the keyboard
- When I submit the form with the "enter" button
- Then the app should have accepted the form
- Then the form should have been sent without loading the page
- Then the page should show the 404 error
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/svelte-steps.