Overview
Taiga 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/taiga-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/taiga-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 "your username/email or password are incorrect"
- Then I should be sent to the login form
- When I open the backlog of the project "Webship site"
- Then the backlog should show the user story "The usage line spells greeting as greting"
- Then the sprint "Sprint 1" should show the user story "The greeting script says Helo instead of Hello"
- When I add the user story "Webship test new" to the backlog
- Then I should not be able to add a user story
- When I open the taskboard of the sprint "Sprint 1" of the project "Webship site"
- Then the taskboard should show the user story "The greeting script says Helo instead of Hello"
- Then the taskboard should show the task "Fix the spelling in greeting.sh" in the column "New"
- When I open the kanban board of the project "Webship site"
- Then the column "In progress" should show the user story "The greeting script says Helo instead of Hello"
- When I search the project "Webship site" for "greting"
- Then the search should show the user story "The usage line spells greeting as greting"
- Then I should be refused the project "Webship site"
- Given there is a user story "Webship test work" in the project "Webship site"
- Given there is a user story "Webship test ready" with the status "Ready" in the project "Webship site"
- Given there is a user story "Webship test planned" in the sprint "Sprint 1" of the project "Webship site"
- Given there is no user story "Webship test new" in the project "Webship site"
- When I open the user story "The greeting script says Helo instead of Hello"
- When I change the status of the user story to "Ready"
- Then the user story should have the status "Ready"
- When I add the comment "Checked on the test site" to the user story
- Then the user story should show the comment "Seen on the test site: the greeting prints Helo."
- Then the user story should show the comment "Checked on the test site" by "Member Test"
- When I add the tag "bug" to the user story
- Then the user story should have the tag "bug"
- When I assign the user story to "Member Test"
- Then the user story should be assigned to "Member Test"
- Then the user story should be created by "Owner Test"
- Then the user story should have the task "Fix the spelling in greeting.sh"
- Then I should not be able to change the user story
- Then I should not be able to comment on the user story
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/taiga-steps.