Overview
Immich 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/immich-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/immich-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": {
"email": "admin@example.com"
},
"user": {
"email": "user@example.com"
}
}
}
}
Steps
- When I sign in to the library as "user"
- When I sign in to the library as "user" with a wrong password
- Given I am signed in to the library as "user"
- Given I am signed in to the library's API as "user"
- When I open the shared link signed out
- When I get past the library's first-run wizard
- Given the library's API uses a key of "user"
- Given the library has a new account "newcomer"
- When I upload "webship-test-red.jpg" to the library
- When I upload "webship-test-red.jpg" to the library through the API
- Then the library should hold "webship-test-red.jpg"
- Then the library should not hold "webship-test-red.jpg"
- Then the timeline should show the photo taken on "May 1, 2024"
- Then the timeline should not show the photo taken on "May 1, 2024"
- When I open the photo taken on "May 1, 2024"
- Then the photo's details should say "webship-test-red.jpg"
- When I mark the photo as a favorite
- Then the photo should be a favorite
- When I move the photo to the trash
- Then the library should say "Trashed 1 asset"
- When I press "Undo" in the library's message
- When I confirm "Empty trash"
- Then the trash should hold the photo taken on "May 1, 2024"
- When I create the album "Webship test album" with the photo taken on "May 1, 2024"
- Then the album "Webship test album" should hold 1 item
- When I share the album "Webship test album" by a link
- Then the shared page should show the photo taken on "May 1, 2024"
- When I search the library for the file name "webship-test-blue"
- Then the search should find the photo taken on "August 15, 2023"
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/immich-steps.
Logo
The logo is the mark Immich ships, design/immich-logo.svg of github.com/immich-app/immich v3.4.2, unmodified. Immich and its logo are Immich's: the logo names the software the pack tests. It is not covered by this package's licence.