Overview
Jira 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/jira-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/jira-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": {
"admin": {
"username": "admin",
"password": "Admin123456789!",
"name": "Site Administrator"
},
"alex": {
"username": "alex",
"password": "Alex123456789!",
"name": "Alex Tester"
},
"sam": {
"username": "sam",
"password": "Sam123456789!",
"name": "Sam Reporter"
}
}
}
}
Steps
- Given I am signed in as "alex"
- When I sign in with the "alex" account
- When I sign in as "alex" with the password "not-the-right-password"
- Given I am not signed in
- Given I am on the sign-in page
- When I sign out
- Then I should be signed in
- Then I should be signed in as "alex"
- Then I should see the sign-in form
- Then I should see the sign-in error "Incorrect username or password."
- Then I should be asked to sign in
- When I create the dashboard "Suite dashboard"
- When I open the dashboard "Suite dashboard"
- Then the dashboard title should be "System Dashboard"
- Then I should see the "Assigned to Me" gadget
- Then the "Assigned to Me" gadget should contain "Fix the login redirect"
- Then I should see the dashboard "Suite dashboard" in my dashboards
- When I delete the dashboard "Suite dashboard"
- Given the dashboard "Suite dashboard" is removed
- Given I am on the "summary" settings of the "SCRUM" project
- Then I should see the settings of the "Scrum Sample" project
- Then I should be refused the project settings
- Then I should see the account "alex" in the user list
- Then I should be in the administration area
- Given I am on the board of the "KAN" project
- Given I am on the backlog of the "SCRUM" project
- Then the board should have the "In Progress" column
- Then the board columns should be "Backlog, Selected for Development, In Progress, Done"
- Then I should see the card "KAN-1" on the board
- Then the card "KAN-1" should be in the "Backlog" column
- When I move the card "KAN-1" to the "Selected for Development" column
- Then the board should have no active sprint
- Then the board should show the sprint "Suite Sprint"
- When I create the sprint "Suite Sprint"
- Then I should see the sprint "Suite Sprint" in the backlog
- Then the sprint "Suite Sprint" should be active
- When I add the issue "SCRUM-3" to the sprint "Suite Sprint"
- Then the issue "SCRUM-3" should be in the sprint "Suite Sprint"
- Then the issue "SCRUM-3" should be in the backlog
- When I start the sprint "Suite Sprint"
- When I complete the active sprint
- When I delete the sprint "Suite Sprint"
- Given the sprint "Suite Sprint" is removed from the "SCRUM" project
- When I open the create issue dialog
- When I create a "Task" issue in the "Scrum Sample" project with the summary "Check the footer links"
- When I open the issue I created
- When I open the issue "SCRUM-1"
- Then the issue "Check the footer links" should exist
- Then I should see that the issue cannot be viewed
- Then the issue status should be "To Do"
- Then the issue description should contain "Seeded by the site build script"
- When I open the edit issue dialog
- When I change the issue summary to "Check every footer link"
- When I move the issue to "In Progress"
- Then the issue should offer the "In Progress" transition
- When I comment "Checked on the staging site." on the issue
- Then I should see the comment "Checked on the staging site." on the issue
- Then the comment "Checked on the staging site." should be by "Alex Tester"
- When I delete the comment "Checked on the staging site." from the issue
- When I assign the issue to "Sam Reporter"
- When I assign the issue to me
- Then the issue should offer the "Delete" operation
- When I delete the issue
- Given the issue "Check the footer links" is removed
- When I search for issues with the query "project = KAN ORDER BY key ASC"
- Given I am on the issue search for "project = KAN ORDER BY key ASC"
- When I search for issues containing "release notes"
- When I switch the issue search to the advanced mode
- Then the issue search should be in the advanced mode
- When I switch the search results to the list view
- Then the search should find 3 issues
- Then the search should find at least 1 issue
- Then the search should find no issues
- Then I should see the issue "KAN-1" in the search results
- Then I should see the search error "Field 'projectt' does not exist or you do not have permission to view it."
- When I open the issue "KAN-2" from the search results
- When I save the search as the filter "Open footer work"
- Then the search should be the filter "Sample open issues"
- When I open the filter "Sample open issues"
- Then I should see the filter "Open footer work" in my filters
- When I delete the filter "Open footer work"
- Given the filter "Open footer work" is removed
- When I open the "Projects" menu of the top navigation
- When I choose "View All Projects" from the "Projects" menu of the top navigation
- Then I should see "Manage filters" in the "Issues" menu of the top navigation
- Then I should see the "Administration" menu in the top navigation
- When I search the site for "release notes"
- Given I am on the "projects" screen
- Given I am on the "SCRUM" project
- When I open "Backlog" in the project sidebar
- Then I should see "Backlog" in the project sidebar
- Then the project sidebar should be of "Scrum Sample"
- Then I should see the success message "has been successfully created"
- When I close the messages on top of the page
- Then I should see the field error "You must specify a summary of the issue."
- Then the "Create Issue" dialog should be open
- When I submit the dialog
- When I submit the dialog expecting errors
- When I cancel the dialog
- When I pick "Scrum Sample" in the "Project" field
- When I fill in the "Summary" field of the dialog with "Check the footer links"
- Then I should see the dead link page
- Then the application version should start with "11."
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/jira-steps.