@webship-js/immich-steps 0.0.0-stage → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Webship.co
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,250 @@
1
- # Temporary Holding Version
1
+ <p align="center"><img src="https://raw.githubusercontent.com/webship/immich-steps/2.0.x/assets/logo.svg" alt="Immich logo" width="96"></p>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # immich-steps
4
+
5
+ Cucumber step definitions for Immich, the self-hosted photo and video library, for
6
+ [webship-js](https://webship.co/docs/webship-js/2.0.x), a BDD browser automation harness built on Playwright and
7
+ Cucumber-js.
8
+
9
+ Immich keeps a library of photos and videos. It takes uploads, draws them in a timeline by the date each was taken,
10
+ gathers them into albums, shares them through links, keeps what is deleted in a trash with an Undo, and has an API
11
+ every client uses, signed in with a session, a token or an API key. The steps work on its pages and its API. They
12
+ wait on its uploads, its calls and its messages, never for a fixed time. No step phrase names the product: the app is
13
+ "the library".
14
+
15
+ ```gherkin
16
+ Feature: Signing in
17
+ Scenario: An account signs in through the form, and its timeline opens
18
+ When I sign in to the library as "user"
19
+ Then I should see "Click to upload your first photo"
20
+ ```
21
+
22
+ ## From nothing to a green run
23
+
24
+ With the [Webship Workspace](https://github.com/webship/workspace) and its Immich plugin
25
+ (`@webship.co/workspace-immich`), a library is a command away, with its two accounts made and this pack wired into
26
+ its testing setup:
27
+
28
+ ```bash
29
+ cd ~/workspace/dev
30
+ bash cmd-immich-project.sh photos --install --add-users
31
+ bash cmd-tools-testing.sh photos --run
32
+ ```
33
+
34
+ Without it, the demo of this repository is Immich as it ships, on Docker Compose (see [The demo](#the-demo)):
35
+
36
+ ```bash
37
+ npm install
38
+ export IMMICH_ADMIN_PASSWORD='a password of yours' IMMICH_USER_PASSWORD='another one'
39
+ npm run demo:build # Immich v3.4.2 at http://127.0.0.1:8502, machine learning off, its two accounts
40
+ npx playwright install chromium
41
+ npm test # the whole suite
42
+ npm run demo:remove
43
+ ```
44
+
45
+ ### What the suite tests
46
+
47
+ - **Signing in:** the login form, the message a wrong password gets, and the first-run wizard of a new account.
48
+ - **Photos:** an upload shown in the timeline by its date, its details in the viewer, a favorite marked and taken
49
+ off, the trash with its Undo, Restore all and Empty trash.
50
+ - **Albums, links and search:** an album made with a photo, shared by a link that opens signed out, and a search by
51
+ file name.
52
+ - **The API:** an upload signed with a token, an API key on its own, a key the library refuses.
53
+
54
+ ## Requirements
55
+
56
+ - Node.js 24 or later (26 is tested too), and webship-js 2.0.19 or later: the pack signs webship-js's API steps
57
+ with `api.setHeader`.
58
+ - An Immich library: v3.4.2 is the one the pack is proven on. Machine learning may be off: no step needs it.
59
+
60
+ ## Install
61
+
62
+ ```bash
63
+ npm install --save-dev webship-js @webship-js/immich-steps
64
+ ```
65
+
66
+ Add the pack's steps to the `require` of `cucumber.js`, after webship-js's own:
67
+
68
+ ```js
69
+ require: [
70
+ 'node_modules/webship-js/tests/step-definitions/**/*.js',
71
+ 'node_modules/@webship-js/immich-steps/tests/step-definitions/**/*.js',
72
+ 'tests/step-definitions/**/*.js',
73
+ ],
74
+ ```
75
+
76
+ ## Quick start
77
+
78
+ Sign in first, the way a person does, then use the library:
79
+
80
+ ```gherkin
81
+ Feature: The first photos
82
+ @removes-test-content
83
+ Scenario: An upload shows in the timeline by the date it was taken
84
+ When I sign in to the library as "user"
85
+ And I upload "webship-test-red.jpg" to the library
86
+ Then the timeline should show the photo taken on "May 1, 2024"
87
+ When I open the photo taken on "May 1, 2024"
88
+ Then the photo's details should say "webship-test-red.jpg"
89
+ ```
90
+
91
+ `Given I am signed in to the library as "user"` signs in through the API instead (faster), and opens the library
92
+ with the session it gets. The login form is for the scenarios about signing in.
93
+
94
+ ## Test users
95
+
96
+ The scenarios name accounts by a handle, from `worldParameters.users` in `cucumber.js`. Their passwords come from the
97
+ environment, never from the repository:
98
+
99
+ ```js
100
+ users: {
101
+ admin: { email: process.env.IMMICH_ADMIN_EMAIL || 'admin@example.com', password: process.env.IMMICH_ADMIN_PASSWORD },
102
+ user: { email: process.env.IMMICH_USER_EMAIL || 'user@example.com', password: process.env.IMMICH_USER_PASSWORD },
103
+ },
104
+ ```
105
+
106
+ `admin` is the library's first admin. It is the managing account, which makes and removes the test accounts.
107
+
108
+ An account meets Immich's first-run wizard on its first sign-in (theme, language, privacy, storage, backups, the
109
+ mobile app). The Webship Workspace's accounts have met it already. A library's own account may not have: `When I get
110
+ past the library's first-run wizard` gets it to its timeline. A scenario that needs an account of its own makes one
111
+ with `Given the library has a new account "newcomer"`.
112
+
113
+ ## Settings
114
+
115
+ `worldParameters.immich` in `cucumber.js`. Each setting has a default:
116
+
117
+ | Setting | Default | What it is |
118
+ | --- | --- | --- |
119
+ | `fixtures` | `tests/fixtures` | The project's folder of files to upload. A file not there is looked for in the pack's own: `webship-test-red.jpg` (taken on May 1, 2024), `webship-test-blue.jpg` (August 15, 2023) and `webship-test-green.jpg` (December 24, 2022). These are three photos made for the pack, with no person in them. |
120
+ | `manager` | `admin` | The account that makes and removes the test accounts. |
121
+
122
+ ### `@removes-test-content`
123
+
124
+ A scenario that makes something names it so the pack can find it. Uploads are files named `webship-test-*`.
125
+ Albums, shared links and API keys are named "Webship test …". Accounts get `webship.test.…@example.com`.
126
+
127
+ Tag such a scenario `@removes-test-content`:
128
+ - before it, what an earlier run left is removed, and the counts of each account of the users registry are taken
129
+ (its assets, albums, shared links, keys, and the manager's accounts);
130
+ - after it, what it made is removed (files for good), and the counts must be back where they were.
131
+
132
+ ## How the steps find things and wait
133
+
134
+ - **A photo is named by the date it was taken,** as the library writes it in the photo's name: "Image taken on May 1,
135
+ 2024". The steps take that date: `the photo taken on "May 1, 2024"`. It comes from the photo's EXIF.
136
+ - **The library's messages are toasts** with no role and no live region, so the steps read them by their text:
137
+ `Then the library should say "Trashed 1 asset"`. A form's error ("Incorrect email or password") is read the same
138
+ way. A message leaves after a few seconds: read it in the step after what it is about.
139
+ - **A question is a dialog with no name of its own.** It is found by its role and its text ("Are you sure…"), and
140
+ answered with its Confirm: `When I confirm "Empty trash"`.
141
+ - **Every page needs JavaScript:** without it, the library shows "To use Immich, you must enable JavaScript".
142
+ Scenarios of the pages carry `@needs-javascript`. The API's scenarios run in a browser without JavaScript too.
143
+ - **No step waits for a fixed time:** an upload waits for its answer, a photo for its image, a message for its
144
+ text, a question for its dialog.
145
+
146
+ ### Findings
147
+
148
+ Found on Immich v3.4.2 while writing the pack, and not filed:
149
+
150
+ - **The trash after Restore all:** the page says "Restored 1 asset" but keeps showing the photo until it is loaded
151
+ again. `Then the trash should be empty` opens the trash again first.
152
+ - **An album's page title:** a new album's page stays titled "Web - Immich" after its name is set, until the page is
153
+ loaded again.
154
+ - **Search without machine learning:** the default search type, "Context", reads what a photo shows, which needs
155
+ machine learning. Without it, the words are not read and every photo comes back. `When I search the library for the
156
+ file name "…"` chooses the "File name" type, which works without it.
157
+ - **The admin pages** have no `<main>` landmark (the other pages do). User Management logs two svelte-i18n warnings
158
+ ("admin.user_restore_scheduled_removal" has syntax error: Invalid time value). They are warnings, not errors.
159
+
160
+ ## Steps
161
+
162
+ ### `immich-auth.steps.js` (7)
163
+
164
+ | Step | What it does |
165
+ | --- | --- |
166
+ | `When I sign in to the library as "<account>"` | The login form, as a person fills it; waits for the library's first page after it |
167
+ | `When I sign in to the library as "<account>" with a wrong password` | The form with a password that is not the account's; passes when the library refuses it |
168
+ | `Given I am signed in to the library as "<account>"` | The API's sign-in, its session put in the browser, then the timeline |
169
+ | `When I get past the library's first-run wizard` | An account's first sign-in, through every step of the wizard to the timeline |
170
+ | `Given I am signed in to the library's API as "<account>"` | Signs webship-js's API steps with the account's token |
171
+ | `Given the library's API uses a key of "<account>"` | A "Webship test key" made for the scenario, sent as `x-api-key` |
172
+ | `Given the library has a new account "<handle>"` | A "Webship test" account the manager makes, named by its handle |
173
+
174
+ ### `immich-library.steps.js` (14)
175
+
176
+ | Step | What it does |
177
+ | --- | --- |
178
+ | `When I upload "<file>" to the library` | The page's Upload button and its file chooser; waits until the library has taken the file |
179
+ | `When I upload "<file>" to the library through the API` | A multipart upload, signed as the API steps are |
180
+ | `Then the library should hold "<file>"` / `should not hold` | The file, by its name, outside the trash, through the API |
181
+ | `Then the timeline should show the photo taken on "<date>"` / `should not show` | The page shows the photo |
182
+ | `When I open the photo taken on "<date>"` | The photo viewer |
183
+ | `Then the photo's details should say "<text>"` | The viewer's details (opened when closed) |
184
+ | `When I mark the photo as a favorite` / `unmark` | The viewer's Favorite, waited for |
185
+ | `Then the photo should be a favorite` / `should not be` | The viewer offers Unfavorite, or Favorite |
186
+ | `When I move the photo to the trash` | The viewer's Delete; waits for "Trashed 1 asset" |
187
+ | `Then the library should say "<text>"` | A message, read by its text |
188
+ | `When I press "<button>" in the library's message` | A message's button: Undo, View Album |
189
+ | `When I confirm "<button>"` | Presses it, and confirms the question it asks |
190
+ | `Then the trash should hold the photo taken on "<date>"` / `should be empty` | The trash, opened again |
191
+
192
+ ### `immich-albums.steps.js` (8)
193
+
194
+ | Step | What it does |
195
+ | --- | --- |
196
+ | `When I create the album "<name>" with the photo taken on "<date>"` | Create album, its title, Select photos, the photo, Add assets |
197
+ | `Then the album "<name>" should hold <n> item(s)` | The count on the album's page |
198
+ | `When I share the album "<name>" by a link` | Share, Create link, the link's description "Webship test link" |
199
+ | `When I open the shared link signed out` | A browser context of its own, with no session |
200
+ | `Then the shared page should show the photo taken on "<date>"` | The shared page shows the photo |
201
+ | `When I search the library for the file name "<name>"` | The File name search |
202
+ | `Then the search should find the photo taken on "<date>"` / `find nothing` | What the search found |
203
+
204
+ Every step definition carries five examples in its JSDoc; `npm run test:examples` checks that each matches its own
205
+ definition and no other, and that every step of the features matches exactly one.
206
+
207
+ ## Immich's own tests and this pack
208
+
209
+ Immich's repository has tests of its own, and the pack read them for their flows:
210
+ - its end-to-end suite (`e2e/`): the server's API, sign-in and database backups;
211
+ - its web app's tests (`web/test/medium/`), which name the page's parts by role and accessible name.
212
+
213
+ Immich is AGPL-3.0: nothing of its tests is copied here.
214
+
215
+ ## Testing this package
216
+
217
+ ```bash
218
+ npm ci
219
+ npm run test:examples # the examples and the features' steps against the definitions
220
+ npm run test:paths # a feature named on the command line runs alone
221
+ npm run demo:build && npm test && npm run test:must-fail
222
+ JAVASCRIPT=off CUCUMBER_TAGS='not @wip and not @must-fail and not @needs-javascript' npm test
223
+ ```
224
+
225
+ `tests/must-fail/` holds a scenario for each step's failure: each must fail at its last step, with the message its
226
+ description announces and a hint. CI runs the suite twice and the must-fail run on the demo, with JavaScript and
227
+ without.
228
+
229
+ ## The demo
230
+
231
+ `.github/demo/compose.yml` is Immich v3.4.2 as it ships, with machine learning off and no machine-learning container.
232
+ Its three images are pinned by digest:
233
+ - the server, `ghcr.io/immich-app/immich-server` (v3.4.2);
234
+ - its Postgres with the vector extensions, `ghcr.io/immich-app/postgres` (14, VectorChord 0.4.3, pgvecto.rs 0.2.0);
235
+ - `valkey/valkey` 9.
236
+
237
+ `.github/scripts/build-demo.sh` starts it at `http://127.0.0.1:8502`. Through Immich's API it makes the first admin
238
+ and a user, gets both past the first-run wizard, and turns the version check off. The passwords come from
239
+ `IMMICH_ADMIN_PASSWORD` and `IMMICH_USER_PASSWORD`. `remove-demo.sh` removes the containers, the volume and the
240
+ library.
241
+
242
+ ## License
243
+
244
+ MIT (see `LICENSE`).
245
+
246
+ ## Logo
247
+
248
+ The logo is the mark Immich ships, `design/immich-logo.svg` of github.com/immich-app/immich v3.4.2, unmodified.
249
+ Immich and its logo are Immich's: the logo names the software the pack tests. It is not covered by this package's
250
+ licence.
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 28.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Flower" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 792 792" style="enable-background:new 0 0 792 792;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#FA2921;}
7
+ .st1{fill:#ED79B5;}
8
+ .st2{fill:#FFB400;}
9
+ .st3{fill:#1E83F7;}
10
+ .st4{fill:#18C249;}
11
+ </style>
12
+ <g id="Flower_00000077325900055813483940000000694823054982625702_">
13
+ <path class="st0" d="M375.48,267.63c38.64,34.21,69.78,70.87,89.82,105.42c34.42-61.56,57.42-134.71,57.71-181.3
14
+ c0-0.33,0-0.63,0-0.91c0-68.94-68.77-95.77-128.01-95.77s-128.01,26.83-128.01,95.77c0,0.94,0,2.2,0,3.72
15
+ C300.01,209.24,339.15,235.47,375.48,267.63z"/>
16
+ <path class="st1" d="M164.7,455.63c24.15-26.87,61.2-55.99,103.01-80.61c44.48-26.18,88.97-44.47,128.02-52.84
17
+ c-47.91-51.76-110.37-96.24-154.6-110.91c-0.31-0.1-0.6-0.19-0.86-0.28c-65.57-21.3-112.34,35.81-130.64,92.15
18
+ c-18.3,56.34-14.04,130.04,51.53,151.34C162.05,454.77,163.25,455.16,164.7,455.63z"/>
19
+ <path class="st2" d="M681.07,302.19c-18.3-56.34-65.07-113.45-130.64-92.15c-0.9,0.29-2.1,0.68-3.54,1.15
20
+ c-3.75,35.93-16.6,81.27-35.96,125.76c-20.59,47.32-45.84,88.27-72.51,118c69.18,13.72,145.86,12.98,190.26-1.14
21
+ c0.31-0.1,0.6-0.2,0.86-0.28C695.11,432.22,699.37,358.52,681.07,302.19z"/>
22
+ <path class="st3" d="M336.54,510.71c-11.15-50.39-14.8-98.36-10.7-138.08c-64.03,29.57-125.63,75.23-153.26,112.76
23
+ c-0.19,0.26-0.37,0.51-0.53,0.73c-40.52,55.78-0.66,117.91,47.27,152.72c47.92,34.82,119.33,53.54,159.86-2.24
24
+ c0.56-0.76,1.3-1.78,2.19-3.01C363.28,602.32,347.02,558.08,336.54,510.71z"/>
25
+ <path class="st4" d="M617.57,482.52c-35.33,7.54-82.42,9.33-130.72,4.66c-51.37-4.96-98.11-16.32-134.63-32.5
26
+ c8.33,70.03,32.73,142.73,59.88,180.6c0.19,0.26,0.37,0.51,0.53,0.73c40.52,55.78,111.93,37.06,159.86,2.24
27
+ c47.92-34.82,87.79-96.95,47.27-152.72C619.2,484.77,618.46,483.75,617.57,482.52z"/>
28
+ </g>
29
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@webship-js/immich-steps",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.0",
4
+ "description": "Cucumber step definitions for Immich, the self-hosted photo and video library, for webship-js: signing in through the form or the API (a session, a token or an API key), uploads waited on until the library holds them, the timeline and the photo viewer by the date a photo was taken, favorites, the trash with its Undo, albums, shared links opened signed out, search by file name, and the library's messages and confirmations read by their text. The test content is removed after each scenario and the counts checked. No step phrase names the product.",
5
+ "main": "tests/step-definitions/immich-helpers.js",
6
+ "files": [
7
+ "tests/step-definitions/",
8
+ "tests/features/",
9
+ "tests/fixtures/",
10
+ "assets/",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "test": "cucumber-js --config cucumber.js",
16
+ "test:dry": "cucumber-js --config cucumber.js --dry-run",
17
+ "test:examples": "node tests/check-examples.js",
18
+ "test:paths": "node tests/check-paths.js",
19
+ "test:must-fail": "node tests/check-must-fail.js",
20
+ "test:chromium": "BROWSER=chromium cucumber-js --config cucumber.js",
21
+ "test:firefox": "BROWSER=firefox cucumber-js --config cucumber.js",
22
+ "test:webkit": "BROWSER=webkit cucumber-js --config cucumber.js",
23
+ "test:headed": "HEADLESS=false cucumber-js --config cucumber.js",
24
+ "generate-reports": "generate-reports",
25
+ "test:fast": "SLOW_MO=0 cucumber-js --config cucumber.js",
26
+ "demo:build": "bash .github/scripts/build-demo.sh",
27
+ "demo:remove": "bash .github/scripts/remove-demo.sh"
28
+ },
29
+ "keywords": [
30
+ "webship-js",
31
+ "cucumber",
32
+ "playwright",
33
+ "bdd",
34
+ "immich",
35
+ "photos",
36
+ "step-definitions"
37
+ ],
38
+ "author": "Webship.co",
39
+ "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/webship/immich-steps.git"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/webship/immich-steps/issues"
46
+ },
47
+ "homepage": "https://github.com/webship/immich-steps#readme",
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "engines": {
52
+ "node": ">= 24.0"
53
+ },
54
+ "peerDependencies": {
55
+ "webship-js": "^2.0.19"
56
+ },
57
+ "devDependencies": {
58
+ "tsx": "^4.23.0",
59
+ "webship-js": "^2.0.19"
60
+ },
61
+ "overrides": {
62
+ "@cucumber/cucumber": "^12"
63
+ }
64
+ }
@@ -0,0 +1,26 @@
1
+ @needs-javascript @removes-test-content
2
+ Feature: Albums, shared links and search
3
+ An album made with a photo and shared by a link that opens for someone who is not signed in; the library's search
4
+ by file name, which finds that file and nothing else.
5
+
6
+ Background:
7
+ Given I am signed in to the library as "user"
8
+
9
+ Scenario: An album with a photo, shared by a link that opens signed out
10
+ When I upload "webship-test-red.jpg" to the library
11
+ And I create the album "Webship test album" with the photo taken on "May 1, 2024"
12
+ Then the library should say "Added 1 asset to the album"
13
+ And the album "Webship test album" should hold 1 item
14
+ When I share the album "Webship test album" by a link
15
+ And I open the shared link signed out
16
+ Then the shared page should show the photo taken on "May 1, 2024"
17
+
18
+ Scenario: A search by file name finds that photo
19
+ When I upload "webship-test-red.jpg" to the library
20
+ And I upload "webship-test-blue.jpg" to the library
21
+ And I search the library for the file name "webship-test-blue"
22
+ Then the search should find the photo taken on "August 15, 2023"
23
+
24
+ Scenario: A search for a file name the library does not have finds nothing
25
+ When I search the library for the file name "webship-test-no-such-file"
26
+ Then the search should find nothing
@@ -0,0 +1,30 @@
1
+ @removes-test-content
2
+ Feature: The library's API
3
+ The API every client of the library uses, signed in with a token or an API key: it takes an upload, says who is
4
+ signed in, and refuses a key it does not know. No browser is needed, so these scenarios run without JavaScript too.
5
+
6
+ Background:
7
+ Given the API base URL is "/"
8
+
9
+ Scenario: Signed in with a token, the API takes an upload, and the library holds it
10
+ Given I am signed in to the library's API as "user"
11
+ When I upload "webship-test-green.jpg" to the library through the API
12
+ Then the library should hold "webship-test-green.jpg"
13
+ And the library should not hold "webship-test-blue.jpg"
14
+
15
+ Scenario: An API key signs the requests on its own
16
+ Given the library's API uses a key of "user"
17
+ When I send a GET request to "/api/users/me"
18
+ Then the API response code should be 200
19
+ And the API response should contain "Webship user"
20
+
21
+ Scenario: A key the library does not know is refused
22
+ Given I set the header "x-api-key" to "not-a-key"
23
+ When I send a GET request to "/api/users/me"
24
+ Then the API response code should be 401
25
+ And the API response should contain "Invalid API key"
26
+
27
+ Scenario: The server answers its ping
28
+ When I send a GET request to "/api/server/ping"
29
+ Then the API response code should be 200
30
+ And the API response should contain "pong"
@@ -0,0 +1,46 @@
1
+ @needs-javascript @removes-test-content
2
+ Feature: Photos in the library
3
+ A photo uploaded through the page shows in the timeline by the date it was taken; the viewer shows its details,
4
+ marks it a favorite and moves it to the trash, whose Undo, Restore all and Empty trash do what they say.
5
+
6
+ Background:
7
+ Given I am signed in to the library as "user"
8
+
9
+ Scenario: An uploaded photo shows in the timeline, with its details in the viewer
10
+ When I upload "webship-test-red.jpg" to the library
11
+ Then the timeline should show the photo taken on "May 1, 2024"
12
+ When I open the photo taken on "May 1, 2024"
13
+ Then the photo's details should say "webship-test-red.jpg"
14
+ And the photo's details should say "Webship test camera"
15
+
16
+ Scenario: A favorite, marked and taken off
17
+ When I upload "webship-test-blue.jpg" to the library
18
+ And I open the photo taken on "August 15, 2023"
19
+ And I mark the photo as a favorite
20
+ Then the photo should be a favorite
21
+ When I unmark the photo as a favorite
22
+ Then the photo should not be a favorite
23
+
24
+ Scenario: A photo moved to the trash comes back with Undo
25
+ When I upload "webship-test-green.jpg" to the library
26
+ And I open the photo taken on "December 24, 2022"
27
+ And I move the photo to the trash
28
+ Then the library should say "Trashed 1 asset"
29
+ When I press "Undo" in the library's message
30
+ Then the trash should be empty
31
+
32
+ Scenario: The trash restored, then a photo deleted for good
33
+ When I upload "webship-test-red.jpg" to the library
34
+ And I open the photo taken on "May 1, 2024"
35
+ And I move the photo to the trash
36
+ Then the trash should hold the photo taken on "May 1, 2024"
37
+ When I confirm "Restore all"
38
+ Then the library should say "Restored 1 asset"
39
+ And the trash should be empty
40
+ When I go to "/photos"
41
+ And I open the photo taken on "May 1, 2024"
42
+ And I move the photo to the trash
43
+ And I go to "/trash"
44
+ And I confirm "Empty trash"
45
+ Then the library should say "Permanently deleted 1 asset"
46
+ And the trash should be empty
@@ -0,0 +1,21 @@
1
+ @needs-javascript
2
+ Feature: Signing in to the library
3
+ Its login form as a person uses it, the message a wrong password gets, and the first-run wizard an account meets on
4
+ its first sign-in.
5
+
6
+ Scenario: An account signs in through the form, and its timeline opens
7
+ When I sign in to the library as "user"
8
+ Then I should see "Click to upload your first photo"
9
+
10
+ # The browser logs the refused sign-in (a 401) as a console error: the refusal is what the scenario checks.
11
+ @js-warn
12
+ Scenario: A wrong password is refused, and the form says so
13
+ When I sign in to the library as "user" with a wrong password
14
+ Then the library should say "Incorrect email or password"
15
+
16
+ @removes-test-content
17
+ Scenario: A new account gets past its first-run wizard to its timeline
18
+ Given the library has a new account "newcomer"
19
+ When I sign in to the library as "newcomer"
20
+ And I get past the library's first-run wizard
21
+ Then I should see "Click to upload your first photo"