Overview
MantisBT 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/mantisbt-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/mantisbt-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": {
"manager": {
"username": "manager",
"password": "dD.123123ddd",
"name": "Manager Test"
},
"developer": {
"username": "developer",
"password": "dD.123123ddd",
"name": "Developer Test"
},
"updater": {
"username": "updater",
"password": "dD.123123ddd",
"name": "Updater Test"
},
"reporter": {
"username": "reporter",
"password": "dD.123123ddd",
"name": "Reporter Test"
},
"viewer": {
"username": "viewer",
"password": "dD.123123ddd",
"name": "Viewer Test"
}
}
}
}
Steps
- Given I am a logged in user with the "developer" user
- When I log in with the "developer" user
- When I log in as "developer" with the password "not-the-right-password"
- Given I am not logged in
- When I log out
- Then I should be logged in as "Developer Test"
- Then I should not be logged in
- Then the login should be refused with "Your account may be disabled or blocked"
- When I open the project "Webship site"
- Then I should be refused the page "/manage_overview_page.php"
- Given there is an issue "Webship test login" in the project "Webship site"
- Given there is no issue "Webship test login" in the project "Webship site"
- When I report the issue "Webship test report"
- When I open the issue "The login page does not keep the username"
- 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 change the status of the issue to "acknowledged"
- When I resolve the issue as "fixed"
- When I close the issue
- Then the issue should have the status "resolved"
- When I assign the issue to "developer"
- Then the issue should be assigned to "developer"
- When I attach the tag "login" to the issue
- Then the issue should have the tag "login"
- When I attach the file "tests/fixtures/upload.txt" to the issue
- Then the issue should list the file "upload.txt"
- When I relate the issue to "Attachments larger than 2 MB fail" as "related to"
- Then the issue should be related to "Attachments larger than 2 MB fail"
- When I monitor the issue
- Then the issue should be monitored by "developer"
- Then the issue should be reported by "reporter"
- Then I should not be able to change the status of the issue
- Then I should not be able to report an issue
- When I open the issue list of the project "Webship site"
- When I search the issue list for "username"
- Then the issue list should show "The login page does not keep the username"
- Then My View should list "The login page does not keep the username" in "Assigned to Me"
- Then the change log of the version "1.0" should list "Attachments larger than 2 MB fail"
- Then the summary should count at least 1 issue "resolved"
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/mantisbt-steps.
Logo
The logo is MantisBT's own mark, images/mantis_logo.png of the MantisBT 2.29.0 release, unmodified; its cards show the release's icon, images/mantis_logo_notext.png. The name and the mark are MantisBT's: they name the platform the pack tests.