Overview
Nextcloud 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/nextcloud-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/nextcloud-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": {
"administrator": {
"username": "administrator",
"email": "administrator@example.com",
"displayName": "Administrator",
"password": "dD.123123ddd"
},
"editor": {
"username": "editor",
"email": "editor@example.com",
"displayName": "Editor",
"password": "dD.123123ddd"
},
"user": {
"username": "user",
"email": "user@example.com",
"displayName": "User",
"password": "dD.123123ddd"
}
}
}
}
Steps
- Given I am a logged in user with the "user" user
- When I log in as "user" with the login form
- When I log in with the username "user" and the password "Wrong-password-1"
- Given I am not logged in
- Given I am on the login page
- When I go to the login page
- Then the login should be refused with "Wrong login or password."
- When I log out
- Then I should be logged in
- Then I should be logged in as "user"
- Then I should not be logged in
- Then I should be on the login page
- When I ask for a password reset link for "user"
- Then an email about "password reset" should be sent to "user"
- Then no email should be sent to "nobody@example.com"
- When I open the password reset link of the email to "user"
- When I choose the new password "Webship-New-Pass-1"
- When I open the "Files" app
- Then I should be in the "Files" app
- Then the apps menu should list "Files"
- Then the user menu should offer "Accounts"
- When I choose "Settings" in the user menu
- When I set my status to "Away"
- Then my status should be "Away"
- Then I should see the error page "Access forbidden"
- When I go to the dashboard
- Then the dashboard should greet "User"
- Then the dashboard should show the "Recommended files" widget
- When I add the "Favorite files" widget to the dashboard
- Then the "Favorite files" widget should list "meeting-notes.md"
- When I go to the files
- When I go to the folder "Project files"
- When I open the folder "Project files"
- When I open the "Favorites" files view
- When I go to the deleted files
- Then the file list should show "meeting-notes.md"
- Then the file list should be empty
- When I upload the file "meeting-notes.md"
- When I create the folder "Project files"
- When I rename "meeting-notes.md" to "minutes.md"
- When I move "meeting-notes.md" to the folder "Project files"
- When I copy "meeting-notes.md" to the folder "Project files"
- When I delete "meeting-notes.md"
- Then the deleted files should list "meeting-notes.md"
- When I restore "meeting-notes.md" from the deleted files
- When I add "meeting-notes.md" to the favorites
- Then "meeting-notes.md" should be marked as a favorite
- When I open the details of "meeting-notes.md"
- Then the details should show "meeting-notes.md"
- When I open the "Activity" tab of the details
- Then the details tab should show "You created meeting-notes.md"
- When I close the details
- Then a message "Delete file: done" should pop up
- When I share "meeting-notes.md" with "editor"
- Then "meeting-notes.md" should be shared with "editor"
- When I create a public link for "team-photo.png"
- When I protect the public link of "team-photo.png" with the password "Webship-Share-2026"
- When I set the public link of "team-photo.png" to expire in 30 days
- Then the public link of "team-photo.png" should expire in 30 days
- When I open the public link of "team-photo.png" as a visitor
- Then I should be asked for the password of the share
- When I enter the share password "Webship-Share-2026"
- Then the share password should be refused
- Then the shared file "team-photo.png" should be shown
- When I open the file "team-photo.png"
- Then the viewer should show the image "team-photo.png"
- Then the viewer should show the PDF "annual-report.pdf"
- Then the PDF should have 2 pages
- Then the PDF should show "Annual report 2026"
- Then the viewer should show the text "Meeting notes"
- When I close the viewer
- When I search for "team" in the unified search
- Then the unified search should find "team-photo.png" in "Files"
- Then the unified search should find nothing
- When I open the search result "team-photo.png"
- Given "user" has the notification "Quarterly review is due"
- When I open the notifications
- Then the notifications should show "Quarterly review is due"
- When I dismiss the notification "Quarterly review is due"
- When I dismiss all notifications
- Then I should have no notifications
- When I go to the activity stream
- When I filter the activity stream by "File changes"
- Then the newest activity should be "You created meeting-notes.md"
- Then the activity stream should show "You created meeting-notes.md"
- When I go to the personal settings
- When I open the "Security" section of the personal settings
- When I set my "Headline" to "Planning lead"
- Then my "Headline" should be "Planning lead"
- When I change my password to "Webship-Changed-2026"
- When I change my password with the wrong current password "Wrong-password-1"
- When I choose the "Dark theme" appearance
- Then the "Dark theme" appearance should be in use
- When I go to the accounts page
- Then the account list should show "editor"
- Then the account "administrator" should be in the group "admin"
- When I search the accounts for "edit"
- When I open the "Admins" account list
- When I try to create the account "editor"
- Then the new account should be refused with "User already exists"
- Given "user" has the file "meeting-notes.md"
- Given "user" has the folder "Project files"
- Given "user" has shared the file "meeting-notes.md" with "editor"
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/nextcloud-steps.