Overview
Redmine 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/redmine-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/redmine-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": {
"owner": {
"username": "owner",
"password": "dD.123123ddd",
"name": "Owner Test"
},
"member": {
"username": "member",
"password": "dD.123123ddd",
"name": "Member Test"
},
"reader": {
"username": "reader",
"password": "dD.123123ddd",
"name": "Reader Test"
},
"stranger": {
"username": "stranger",
"password": "dD.123123ddd",
"name": "Stranger Test"
}
}
}
}
Steps
- Given I am a logged in user with the "member" user
- When I log in with the "member" user
- When I log in as "member" with the password "not-the-right-password"
- Given I am not logged in
- When I log out
- Then I should be logged in as "Member Test"
- Then I should not be logged in
- Then the login should be refused with "Invalid user or password"
- When I open the project "webship-site"
- Then I should be refused the project "webship-site"
- Given there is an issue "Webship test task" in the project "webship-site"
- Given there is no issue "Webship test new" in the project "webship-site"
- When I open the issues of the project "webship-site"
- Then the issue list should show "Webship test task"
- When I open the issue "Webship test task"
- When I create an issue "Webship test new" in the project "webship-site"
- When I set the status of the issue to "In Progress"
- Then the status of the issue should be "In Progress"
- When I add the note "Checked on the test site" to the issue
- Then the issue should show the note "Checked on the test site"
- When I log "0.5" hours on the issue
- Then the time spent on the issue should be "0:30 h"
- When I assign the issue to "Member Test"
- Then the issue should be assigned to "Member Test"
- Then I should not be able to change the status of the issue
- Then I should not be able to assign the issue
- When I open the version "Sprint 1" of the project "webship-site"
- Then the version should list the issue "The greeting script says Helo instead of Hello"
- Then the version should be "open"
- When I open the roadmap of the project "webship-site"
- Then the roadmap should list the version "Sprint 1"
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/redmine-steps.