Overview
Angular 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/angular-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/angular-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Given the page is hydrated
- Then the page should be hydrated
- Then the page should have been rendered in the browser alone
- When I wait for the app to be idle
- When I navigate with the "Posts" link
- When I go back one view
- Then the router should have changed the view
- Then the view's title should be "Posts"
- Then the "Posts" link should be the active one
- Then the app's address should be "/posts"
- When I wait for the app's requests to finish
- When I send the form by its "Send" button
- Then the form should have been accepted
- Then the form should have been refused with "Your message needs at least 10 characters."
- Then the form should have been answered in place
- Then the app should show its 404 page
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/angular-steps.
Logo
The Angular logo is the Angular team's, from github.com/angular/angular, under CC BY 4.0, as Angular's press kit provides it. It is not covered by this package's MIT licence.