@webship.co/workspace-nextcloud 0.0.0-stage → 1.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/README.md +264 -2
- package/ai/agents/nextcloud-site-builder.md +104 -0
- package/ai/agents/nextcloud-tester.md +116 -0
- package/ai/commands/nextcloud-test.md +75 -0
- package/ai/prompts/nextcloud-build-and-test.md +27 -0
- package/ai/prompts/nextcloud-scenarios-for-an-area.md +26 -0
- package/ai/skills/nextcloud-scenarios/SKILL.md +102 -0
- package/ai/skills/nextcloud-scenarios/examples/account.feature +32 -0
- package/ai/skills/nextcloud-scenarios/examples/files.feature +33 -0
- package/ai/skills/nextcloud-scenarios/examples/sharing.feature +25 -0
- package/commands/cmd-nextcloud-project.sh +31 -0
- package/commands/cmd-tools-nextcloud-occ.sh +26 -0
- package/dist/src/index.d.ts +30 -0
- package/dist/src/index.js +54 -0
- package/dist/src/index.js.map +1 -0
- package/features/nextcloud.feature +36 -0
- package/package.json +96 -4
- package/scripts/args/arg-nextcloud-occ.sh +21 -0
- package/scripts/args/arg-nextcloud.sh +24 -0
- package/scripts/functions/fun-nextcloud.sh +446 -0
- package/scripts/nextcloud-site.sh +212 -0
- package/testing/site.feature +44 -0
package/README.md
CHANGED
|
@@ -1,3 +1,265 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @webship.co/workspace-nextcloud
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nextcloud for the [Webship Workspace](https://github.com/webship/workspace) dashboard: a builder that makes a real
|
|
4
|
+
Nextcloud file and collaboration server in containers (the release tarball, its SHA-256 sum checked, installed with
|
|
5
|
+
its own installer on the project's database, with only the apps the release bundles), a tool for the server's own
|
|
6
|
+
command-line tool (occ), the default accounts, the [Nextcloud step pack](https://github.com/webship/nextcloud-steps)
|
|
7
|
+
wired into the workspace's testing setup, and its AI items — two agents, a skill, a command and two prompts — each
|
|
8
|
+
listed in the workspace folder of its kind.
|
|
9
|
+
|
|
10
|
+
The workspace is container-based (DDEV by default): a Nextcloud site is a row like any other, so the row menus the
|
|
11
|
+
core draws (start, stop, launch, clone, remove, tests) work on it unchanged, but for its accounts: its row has no
|
|
12
|
+
Users menu, and the test users items of its Tests menu are not for it. See [The default accounts](#the-default-accounts).
|
|
13
|
+
|
|
14
|
+
It is made from the reference platform plugin, `@webship.co/workspace-wordpress`, and runs its server the way the
|
|
15
|
+
Moodle plugin runs its learning site: a project of DDEV type `php`, the release package unpacked by the build and
|
|
16
|
+
installed with the platform's own command-line installer.
|
|
17
|
+
|
|
18
|
+
## Use it
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cd ~/workspace
|
|
22
|
+
bash core/scripts/plugins.sh --require @webship.co/workspace-nextcloud --with-needs # npm install into the dashboard
|
|
23
|
+
bash core/scripts/plugins.sh --activate nextcloud --with-needs # plugins.nextcloud in settings.yml
|
|
24
|
+
bash core/scripts/plugins.sh --install nextcloud # commands, functions, args, AI items
|
|
25
|
+
bash core/scripts/plugins.sh --configure nextcloud # nothing to configure: it has no settings file
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The same four steps are buttons on the dashboard's **Settings → Plugins** page. `--install` is idempotent.
|
|
29
|
+
`--uninstall` removes what it placed; an AI item you edited stays. `--remove nextcloud` then takes the package out of
|
|
30
|
+
the dashboard.
|
|
31
|
+
|
|
32
|
+
Everything the plugin carries lands in the folder it belongs to, when that folder is an active workspace folder:
|
|
33
|
+
|
|
34
|
+
| What | Lands in |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `cmd-nextcloud-project.sh`, `cmd-tools-nextcloud-occ.sh` | every active sites folder: `dev/`, `test/`, `sandboxes/`, `demos/` |
|
|
37
|
+
| The agents `nextcloud-site-builder`, `nextcloud-tester` | `ai-agents/` |
|
|
38
|
+
| The skill `nextcloud-scenarios` | `ai-skills/` |
|
|
39
|
+
| The command `/nextcloud-test` | `ai-commands/` |
|
|
40
|
+
| The prompts `nextcloud-build-and-test`, `nextcloud-scenarios-for-an-area` | `ai-prompts/` |
|
|
41
|
+
|
|
42
|
+
There they are listed like any other item of the folder, and installed into Claude Code from there.
|
|
43
|
+
|
|
44
|
+
## What it needs
|
|
45
|
+
|
|
46
|
+
A workspace starts empty, so the manifest says what else this plugin needs (`needs`):
|
|
47
|
+
|
|
48
|
+
- one sites folder, for the builder and the tool: `dev`, `test`, `sandboxes`, `demos` (`dev` is the one added when none is there). The folder also carries `cmd-tools-testing.sh` and the Users tools this plugin's hooks answer to.
|
|
49
|
+
- `ai-agents`, `ai-skills`, `ai-commands` and `ai-prompts`: the AI folders its agents, its skill, its command and its prompts are placed in.
|
|
50
|
+
|
|
51
|
+
`--require` says so, `--activate` and `--install` stop until the workspace has them, and `--with-needs` adds what is missing first:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bash core/scripts/plugins.sh --activate nextcloud --with-needs # dev and the four AI folders are required, activated and installed first
|
|
55
|
+
bash core/scripts/plugins.sh --install nextcloud
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Everything the builder runs for a server runs in containers, through the container tool the workspace already
|
|
59
|
+
needs, and Python 3, which writes the testing setup's `cucumber.js` on the machine: the release tarball is fetched
|
|
60
|
+
and checked, unpacked and installed in the web container. The plugin asks for no command of its own on the machine.
|
|
61
|
+
|
|
62
|
+
## What the package holds
|
|
63
|
+
|
|
64
|
+
| Path | What it is |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `commands/cmd-nextcloud-project.sh` | The builder, in the Build list as **Nextcloud (a file and collaboration server)**, installed into every sites folder |
|
|
67
|
+
| `commands/cmd-tools-nextcloud-occ.sh` | The server's command-line tool for one site: what the server is, an `occ` command, the default accounts, the files a test run left |
|
|
68
|
+
| `scripts/functions/fun-nextcloud.sh` | The bash functions behind both, sourced by bootstrap once installed; the names the core's tools look for (`set_nextcloud_users`, `add_nextcloud_users`, `cancel_nextcloud_users`, `testing_configure_nextcloud`) |
|
|
69
|
+
| `scripts/args/arg-nextcloud.sh`, `arg-nextcloud-occ.sh` | Their argparse; the Build form draws the builder's flags from the first |
|
|
70
|
+
| `scripts/nextcloud-site.sh` | Run by bash in the web container with the server's own `occ`: the release fetched and checked, the installer, the settings for testing, the default accounts, their files, their listing (the same script the step pack's test site is built with) |
|
|
71
|
+
| `testing/site.feature` | The first feature a site gets when testing is set up |
|
|
72
|
+
| `ai/agents/nextcloud-site-builder.md` | The agent that builds and maintains file servers with these commands |
|
|
73
|
+
| `ai/agents/nextcloud-tester.md` | The agent that writes and runs scenarios with the Nextcloud step pack |
|
|
74
|
+
| `ai/skills/nextcloud-scenarios/` | The skill: the step pack's phrases by area, the traps found on a real server, three example features |
|
|
75
|
+
| `ai/commands/nextcloud-test.md` | The slash command `/nextcloud-test <site>`: set up, match every step, run, report |
|
|
76
|
+
| `ai/prompts/nextcloud-build-and-test.md`, `nextcloud-scenarios-for-an-area.md` | Two prompts: whole launch commands for a new session |
|
|
77
|
+
| `src/index.ts` | `register(api)`: what the assistant is told about Nextcloud here |
|
|
78
|
+
| `features/nextcloud.feature` | Scenarios for the dashboard's own browser suite |
|
|
79
|
+
|
|
80
|
+
The `workspacePlugin` block in `package.json` is the manifest the installer reads.
|
|
81
|
+
|
|
82
|
+
## What is different from the reference
|
|
83
|
+
|
|
84
|
+
DDEV has no project type for Nextcloud, and its official way to install is the release tarball and its own
|
|
85
|
+
command-line installer. The plugin keeps the shape of the reference and changes only this:
|
|
86
|
+
|
|
87
|
+
| | WordPress (the reference) | Nextcloud |
|
|
88
|
+
| --- | --- | --- |
|
|
89
|
+
| Project | `--project-type=wordpress`, nginx and PHP | `--project-type=php --docroot=nextcloud --webserver-type=apache-fpm`: Apache, so the release's own `.htaccess` rules give short addresses (`/apps/files`, not `/index.php/apps/files`); PHP 8.4 (the release takes 8.3 to 8.5) with APCu on the command line too |
|
|
90
|
+
| Recognised by | The DDEV project type | The file `.ddev/config.nextcloud.yaml` (with the release, and the daemon that runs the background jobs) |
|
|
91
|
+
| Getting the code | `wp core download` | The release tarball from download.nextcloud.com at `--nextcloud-version` (35.0.3 by default, or a major line for its newest release), its SHA-256 sum checked against the one the server publishes, unpacked in `nextcloud/`; the data folder `data/` sits beside it, outside the docroot |
|
|
92
|
+
| Install | `wp core install` | `--install`: `occ maintenance:install` on the project's database with the workspace account as the administrator, then the settings for testing (below) |
|
|
93
|
+
| Database | The container tool's | The same (MariaDB) |
|
|
94
|
+
| Mail | The container tool's mail catcher | The same: the site sends to the web container's Mailpit (`127.0.0.1:1025`), read at `https://<name>.ddev.site:8026` |
|
|
95
|
+
| Background jobs | WordPress's own | `occ background:cron`, and a daemon of the web container that runs `cron.php` every five minutes |
|
|
96
|
+
| Accounts | WP-CLI | `scripts/nextcloud-site.sh`, with the server's own `occ` (`user:add` with the password in its environment) and the server's API for the display name and the email |
|
|
97
|
+
| Removing it | `ddev delete` | The same |
|
|
98
|
+
| Users menu of the row | Reads the project type | None (the type is `php`; the Tests menu's test users items hand it the Webship list): the occ tool's `--add-users`, or `cmd-tools-add-users.sh <name> nextcloud` |
|
|
99
|
+
|
|
100
|
+
The settings for testing that `--install` writes: the site's address behind the router (`trusted_domains`,
|
|
101
|
+
`overwrite.cli.url`, `overwriteprotocol` https), short addresses, a local memory cache (APCu), no app store (only the
|
|
102
|
+
apps the release bundles), no first-run wizard, new accounts start with no files and no templates, no connection to
|
|
103
|
+
the internet (no update check, no news, no lookup server), the mail to the mail catcher, background jobs by cron,
|
|
104
|
+
and the throttling of failed logins and the rate limits off (every request reaches the server from the router's
|
|
105
|
+
address, so the failed logins of a test run would slow down every later login, and the server sends an account at most
|
|
106
|
+
five password reset mails in thirty minutes).
|
|
107
|
+
|
|
108
|
+
No public domain, no hosted service and no account anywhere: the site answers at `https://<name>.ddev.site` through
|
|
109
|
+
the container tool's router.
|
|
110
|
+
|
|
111
|
+
## The commands
|
|
112
|
+
|
|
113
|
+
Run them from a sites folder. `--help` is safe on both.
|
|
114
|
+
|
|
115
|
+
### Build a site
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
cd ~/workspace/dev
|
|
119
|
+
bash cmd-nextcloud-project.sh myfiles --install --add-users
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
| Flag | What it does |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| `--install` | Install the server with its own installer, the workspace account as its administrator, and set it up for testing |
|
|
125
|
+
| `--add-users` | With `--install`: add the default accounts |
|
|
126
|
+
| `--nextcloud-version <v>` | The release: `35.0.3` by default, or a major line (`34`) for its newest release |
|
|
127
|
+
| `--php-version <v>` | The PHP of the web container: `8.4` by default (`8.3` and `8.5` too) |
|
|
128
|
+
| `--launch` | Open the site when it is ready |
|
|
129
|
+
|
|
130
|
+
The site answers at `https://myfiles.ddev.site` and the mail catcher at `https://myfiles.ddev.site:8026`. Without
|
|
131
|
+
`--install` the release is unpacked but not installed: the site shows its installer. A project of the same name is
|
|
132
|
+
deleted first, with its database.
|
|
133
|
+
|
|
134
|
+
A build takes a few minutes (the release tarball is about 240 MB, the site about 1 GB on disk). Check the free
|
|
135
|
+
memory and disk first (`free -g`, `df -h`), and build one site at a time on a machine others use.
|
|
136
|
+
|
|
137
|
+
### Work on a site
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bash cmd-tools-nextcloud-occ.sh myfiles # version, addresses, accounts
|
|
141
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --occ "status"
|
|
142
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --occ "app:list"
|
|
143
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --occ "user:info editor"
|
|
144
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --add-users # the default accounts
|
|
145
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --cancel-users # delete them
|
|
146
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --empty-files # take away their files (an interrupted test run's)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The occ commands run in the project's web container, as the web server's user; a password never goes on a command
|
|
150
|
+
line of the host.
|
|
151
|
+
|
|
152
|
+
### The default accounts
|
|
153
|
+
|
|
154
|
+
| Account | Address | Group | Handle in the tests |
|
|
155
|
+
| --- | --- | --- | --- |
|
|
156
|
+
| `administrator` | `administrator@example.com` | `admin` | `administrator` |
|
|
157
|
+
| `editor` | `editor@example.com` | none | `editor` |
|
|
158
|
+
| `user` | `user@example.com` | none | `user` |
|
|
159
|
+
|
|
160
|
+
The server logs in with the username or the email. Each account has the password of the workspace's other default
|
|
161
|
+
lists, and a display name (Administrator, Editor, User). They are for local sites and for tests; the administrator
|
|
162
|
+
from `--install` is the workspace account and is never written into a test.
|
|
163
|
+
|
|
164
|
+
**Manage them with the occ tool, not the dashboard's menus.** The dashboard picks a project's account list by its
|
|
165
|
+
type, and a Nextcloud site's type is `php`: its row has no Users menu, and the "Add the test users" and "Cancel the
|
|
166
|
+
test users" items of its Tests menu hand it the list of the Webship distribution, which starts by adding Drush to
|
|
167
|
+
the project with Composer. Leave those two items alone on a Nextcloud site until the base asks the plugins which
|
|
168
|
+
list a project takes (webship/workspace#490). Use:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --add-users # add them, or give them back their password, email, display name and groups
|
|
172
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --cancel-users # delete them
|
|
173
|
+
bash cmd-tools-add-users.sh myfiles nextcloud # the core's tool: the same list
|
|
174
|
+
bash cmd-tools-cancel-users.sh myfiles nextcloud
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Test a site
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
bash cmd-tools-testing.sh myfiles # webship-js, the step pack, the users registry, a first feature
|
|
181
|
+
bash cmd-tools-testing.sh myfiles --run # run the suite in the container
|
|
182
|
+
bash cmd-tools-testing.sh myfiles --run --path tests/features/site.feature
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`cmd-tools-testing.sh` is the workspace's own. For a Nextcloud site it also adds `@webship-js/nextcloud-steps` to
|
|
186
|
+
`package.json`, lists its step definitions in `cucumber.js` after webship-js's own, writes the mail catcher (the
|
|
187
|
+
project's own port in the web container, where the suite runs; `:8026` from the host), `dataAdmin` (the handle the
|
|
188
|
+
step pack uses for what only an administrator may do), the browser messages that are no error of a step, the users
|
|
189
|
+
registry (the handles above, by their usernames, with their display names, overridable with
|
|
190
|
+
`NEXTCLOUD_<HANDLE>_USERNAME` and `NEXTCLOUD_<HANDLE>_PASSWORD`), the tags that keep the pack's assertions that must
|
|
191
|
+
fail out of a normal run, and the site's address in place of the starter's `http://localhost:8080`. It places
|
|
192
|
+
`tests/features/site.feature` when the project has none, and makes sure an installed site has the default accounts.
|
|
193
|
+
Run it again and it adds what is missing and keeps what you changed.
|
|
194
|
+
|
|
195
|
+
Until `@webship-js/nextcloud-steps` is on npm, give the testing setup its tarball (`npm pack` of the pack) with
|
|
196
|
+
`bash cmd-tools-testing.sh myfiles --add-steps <path to the tarball>`, then run the setup again.
|
|
197
|
+
|
|
198
|
+
The suite runs in the project's container, where the network changes of the host (another container starting) do
|
|
199
|
+
not cut the browser's requests.
|
|
200
|
+
|
|
201
|
+
A scenario of your own reads like this one, from the step pack's phrases (the skill `nextcloud-scenarios` lists them
|
|
202
|
+
by area); the file it makes is taken away after it:
|
|
203
|
+
|
|
204
|
+
```gherkin
|
|
205
|
+
Feature: A deleted file comes back
|
|
206
|
+
Scenario: The deleted files give it back
|
|
207
|
+
Given "user" has the file "budget.txt"
|
|
208
|
+
And I am a logged in user with the "user" user
|
|
209
|
+
When I go to the files
|
|
210
|
+
And I delete "budget.txt"
|
|
211
|
+
And I go to the deleted files
|
|
212
|
+
Then the deleted files should list "budget.txt"
|
|
213
|
+
When I restore "budget.txt" from the deleted files
|
|
214
|
+
And I go to the files
|
|
215
|
+
Then the file list should show "budget.txt"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`tests/features/site.feature` passes on a site built with `--install --add-users`, and so do the features of the
|
|
219
|
+
step pack.
|
|
220
|
+
|
|
221
|
+
## The AI items
|
|
222
|
+
|
|
223
|
+
`ai/` in the package holds one folder per kind, the manifest's `ai` block names each item, and `--install` places
|
|
224
|
+
it in the workspace folder of that kind.
|
|
225
|
+
|
|
226
|
+
| Kind | Item | Use it to |
|
|
227
|
+
| --- | --- | --- |
|
|
228
|
+
| Agent | `nextcloud-site-builder` | Build, maintain or remove a file server with the commands above, in containers only |
|
|
229
|
+
| Agent | `nextcloud-tester` | Set the testing stack up, look at the apps in the Playwright MCP browser first, write scenarios from the pack's steps and run them; it never creates an account in a suite and never writes a platform name into a step phrase |
|
|
230
|
+
| Skill | `nextcloud-scenarios` | Write a scenario from phrases that exist: the pack's steps by area, the handles of the users registry, the test-data steps, the traps found on a real server, and three features that pass on a site with the default accounts |
|
|
231
|
+
| Command | `/nextcloud-test <site> [feature or @tag]` | Run the suite of a site from inside a session: set up when missing, match every step, run, report what failed and why |
|
|
232
|
+
| Prompt | `nextcloud-build-and-test` | Start a session that builds a site, says what it is, sets the testing stack up and runs the first feature |
|
|
233
|
+
| Prompt | `nextcloud-scenarios-for-an-area` | Start a session that writes and runs the scenarios of one area of the server |
|
|
234
|
+
|
|
235
|
+
After `--install` each is in its folder on the dashboard. **Install** there puts an agent, a skill or a command into
|
|
236
|
+
Claude Code (`~/.claude/agents`, `~/.claude/skills`, `~/.claude/commands`), or from the command line:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
cd ~/workspace/ai-agents && bash cmd-tools-ai-items.sh nextcloud-tester --install
|
|
240
|
+
cd ~/workspace/ai-skills && bash cmd-tools-ai-items.sh nextcloud-scenarios --install
|
|
241
|
+
cd ~/workspace/ai-commands && bash cmd-tools-ai-items.sh nextcloud-test --install
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
A prompt is not installed: it is the whole `claude …` launch command of a new session, and the dashboard's **New
|
|
245
|
+
screen** form lists it as a template. By hand, fill the placeholders in and run the command of the file from the
|
|
246
|
+
folder it names.
|
|
247
|
+
|
|
248
|
+
The items are written for any AI CLI, with Claude Code as the default shape: the frontmatter and the file layout are
|
|
249
|
+
Claude Code's, the body of each item is plain Markdown that names no tool or feature of one CLI, a command says in
|
|
250
|
+
words what its arguments are, and the text between the triple quotes of a prompt can be given to another AI CLI as it
|
|
251
|
+
is.
|
|
252
|
+
|
|
253
|
+
Every step phrase the items show is checked against the definitions of the step pack and of webship-js
|
|
254
|
+
(`tests/fixtures/step-definitions.txt`), and every command and flag against the plugin's own.
|
|
255
|
+
|
|
256
|
+
## Develop it
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
npm install # builds dist/ (TypeScript)
|
|
260
|
+
npm run lint
|
|
261
|
+
npm test # the manifest, the commands, the AI items, the functions against a scaffolded project
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
CI runs the same on Node.js 20 and 24, parses every shell script, and runs the plugin's `features/nextcloud.feature`
|
|
265
|
+
against a dashboard with this plugin installed (`webship/workspace/.github/workflows/plugin-browser-suite.yml`).
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nextcloud-site-builder
|
|
3
|
+
description: Use this agent to build, maintain or remove a Nextcloud file and collaboration server in the Webship Workspace — a new site from `cmd-nextcloud-project.sh` (the release tarball with its SHA-256 sum checked, installed with its own installer on the project's database, the workspace account as its administrator, the default accounts), the server's command-line tool through `cmd-tools-nextcloud-occ.sh` (an occ command, the default accounts, the files a test run left), clones and removal, always in containers. Invoke for "build a Nextcloud server", "install another release of the file server", "add the default accounts to the file server", "run an occ command on <site>", or "remove the file server". For testing a site, hand over to `nextcloud-tester`.
|
|
4
|
+
model: fable
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# nextcloud-site-builder
|
|
15
|
+
|
|
16
|
+
You build and look after Nextcloud file and collaboration servers in a Webship Workspace (`~/workspace`), a
|
|
17
|
+
container-based workspace (DDEV by default). Everything goes through the `cmd-*.sh` commands of a sites folder
|
|
18
|
+
(`dev/`, `test/`, `sandboxes/`, `demos/`) and through the project's web container. The commands come from the
|
|
19
|
+
Nextcloud plugin (`@webship.co/workspace-nextcloud`); if a folder has no `cmd-nextcloud-project.sh`, the plugin is
|
|
20
|
+
not installed there: say so, and name the steps (`bash core/scripts/plugins.sh --require @webship.co/workspace-nextcloud`,
|
|
21
|
+
`--activate nextcloud`, `--install nextcloud`) instead of working around it.
|
|
22
|
+
|
|
23
|
+
Read the command before quoting a flag: `bash <command> --help` is always safe.
|
|
24
|
+
|
|
25
|
+
## Build a site
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd ~/workspace/sandboxes # or dev, test, demos
|
|
29
|
+
bash cmd-nextcloud-project.sh myfiles --install --add-users
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The server is the release tarball from download.nextcloud.com (its SHA-256 sum checked in the web container),
|
|
33
|
+
unpacked in `nextcloud/`, the docroot of a PHP project served by Apache with the release's own rewrite rules, with
|
|
34
|
+
its data folder `data/` beside it, outside the docroot. It answers at `https://myfiles.ddev.site`; its mail goes to
|
|
35
|
+
the project's mail catcher (`https://myfiles.ddev.site:8026`), and a daemon of the web container runs its background
|
|
36
|
+
jobs (cron.php every five minutes). A build takes a few minutes (the tarball is about 240 MB). Check the free memory
|
|
37
|
+
and disk first (`free -g`, `df -h`) and build one site at a time.
|
|
38
|
+
|
|
39
|
+
| Flag | What it does |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `--install` | Install the server with its own installer (occ maintenance:install) on the project's database, with the workspace account as its administrator, and set it up for testing |
|
|
42
|
+
| `--add-users` | With `--install`: the default accounts |
|
|
43
|
+
| `--nextcloud-version <v>` | The release (35.0.3 by default), or a major line (34) for its newest release |
|
|
44
|
+
| `--php-version <v>` | The PHP of the web container (8.4 by default; the release takes 8.3 to 8.5) |
|
|
45
|
+
| `--launch` | Open the site when it is ready |
|
|
46
|
+
|
|
47
|
+
`--install` sets the site up for testing: its address behind the router (https), short addresses, a local memory
|
|
48
|
+
cache, no app store (only the apps the release bundles), no first-run wizard, new accounts start with no files, no
|
|
49
|
+
connection to the internet (no update check, no news, no lookup server), the mail to the mail catcher, background
|
|
50
|
+
jobs by cron, and the throttling of failed logins and the rate limits off (every request reaches the server from the
|
|
51
|
+
router's address, and the server sends an account at most five password reset mails in thirty minutes).
|
|
52
|
+
A project of the same name is deleted first, with its database.
|
|
53
|
+
|
|
54
|
+
## Work on a site
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bash cmd-tools-nextcloud-occ.sh myfiles # version, addresses, accounts
|
|
58
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --occ "status"
|
|
59
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --occ "app:list"
|
|
60
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --occ "user:info editor"
|
|
61
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --add-users # the default accounts
|
|
62
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --cancel-users # delete them
|
|
63
|
+
bash cmd-tools-nextcloud-occ.sh myfiles --empty-files # take away their files (an interrupted test run's)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The occ commands run in the project's web container, as the web server's user. The row's Users menu on the
|
|
67
|
+
dashboard picks its actions by the project type, and a Nextcloud site's type is `php`: use `--add-users` and
|
|
68
|
+
`--cancel-users` of the occ tool, or `bash cmd-tools-add-users.sh myfiles nextcloud` and
|
|
69
|
+
`bash cmd-tools-cancel-users.sh myfiles nextcloud`.
|
|
70
|
+
|
|
71
|
+
## The default accounts
|
|
72
|
+
|
|
73
|
+
| Account | Address | Group |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `administrator` | `administrator@example.com` | `admin` |
|
|
76
|
+
| `editor` | `editor@example.com` | none |
|
|
77
|
+
| `user` | `user@example.com` | none |
|
|
78
|
+
|
|
79
|
+
The server logs in with the username or the email. Each account has the password of the workspace's other default
|
|
80
|
+
lists. Adding them again gives back the password, the email, the display name and the groups.
|
|
81
|
+
|
|
82
|
+
## Rules
|
|
83
|
+
|
|
84
|
+
- Containers only: never run `occ` or PHP on the host for a project; the occ tool runs in the web container.
|
|
85
|
+
- No public domain, no hosted service and no account anywhere; only the open-source server and the apps it bundles
|
|
86
|
+
(the app store is off).
|
|
87
|
+
- Clone to try something (`bash cmd-tools-clone.sh myfiles --to myfiles2`), and remove with
|
|
88
|
+
`bash cmd-tools-remove.sh myfiles`: removing the project removes its database and its files.
|
|
89
|
+
- The workspace account is the server's administrator: never write its password anywhere.
|
|
90
|
+
- Testing is `nextcloud-tester`'s work: hand over with the site's name and folder.
|
|
91
|
+
|
|
92
|
+
## The book
|
|
93
|
+
|
|
94
|
+
For any automated functional testing in this work (a Gherkin feature, a step definition, choosing a
|
|
95
|
+
step, a test run and its failures), read the book *Automated Functional Testing Recipes* first.
|
|
96
|
+
|
|
97
|
+
- **Where.** Use the first that exists: `.claude/automated-functional-testing-recipes/` in the project,
|
|
98
|
+
`~/.claude/automated-functional-testing-recipes/` (installed by webship/webship-js-ai-agent,
|
|
99
|
+
webship/webship-js-skills or webship/ai-agents), or
|
|
100
|
+
https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
101
|
+
- **How.** Its `README.md` first, then the chapter that matches the task (one file per chapter,
|
|
102
|
+
named by its subject), not the single complete file.
|
|
103
|
+
- **Which wins.** The installed webship-js package and the step pack are the source of truth for
|
|
104
|
+
step phrasing. When they differ from the book, follow them and say so.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nextcloud-tester
|
|
3
|
+
description: Use this agent to test a Nextcloud file and collaboration server of the Webship Workspace with webship-js and the Nextcloud step pack (`@webship-js/nextcloud-steps`) — set the testing stack up with `cmd-tools-testing.sh`, explore the apps in the Playwright MCP browser first, write Gherkin scenarios from the pack's own steps, run them in the project's container and read the report. It logs in by the handles of the users registry, makes its files, shares and notifications with the test-data steps that take them away after the scenario, never creates an account in a suite, and never writes a platform name into a step phrase. Invoke for "test the file server", "write scenarios for sharing", "why does this scenario fail", or "run the suite on <site>". For building or changing the server itself, hand over to `nextcloud-site-builder`.
|
|
4
|
+
model: fable
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- mcp__playwright__browser_navigate
|
|
13
|
+
- mcp__playwright__browser_snapshot
|
|
14
|
+
- mcp__playwright__browser_click
|
|
15
|
+
- mcp__playwright__browser_type
|
|
16
|
+
- mcp__playwright__browser_evaluate
|
|
17
|
+
- mcp__playwright__browser_tabs
|
|
18
|
+
- mcp__playwright__browser_take_screenshot
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# nextcloud-tester
|
|
22
|
+
|
|
23
|
+
You test Nextcloud file and collaboration servers in a Webship Workspace (`~/workspace`), a container-based
|
|
24
|
+
workspace (DDEV by default), with [webship-js](https://github.com/webship/webship-js) (Playwright and Cucumber) and
|
|
25
|
+
its Nextcloud step pack, [`@webship-js/nextcloud-steps`](https://github.com/webship/nextcloud-steps). The pack
|
|
26
|
+
covers the login and its refusal, logging out and the forgotten password, the header and the dashboard, Files
|
|
27
|
+
(upload, folders, rename, move or copy, delete and restore, favorites, the details sidebar), sharing with an account
|
|
28
|
+
and a public link with a password and an expiration date, the viewers for pictures, PDF and text, the unified
|
|
29
|
+
search, notifications, the activity stream, the personal settings, and the administrator's accounts page.
|
|
30
|
+
|
|
31
|
+
## 1. Set the testing stack up
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cd ~/workspace/<folder> # the sites folder of the server
|
|
35
|
+
bash cmd-tools-testing.sh <site> # webship-js, the step pack, the users registry, a first feature
|
|
36
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/site.feature
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The testing setup adds the pack to `package.json`, its step definitions to `cucumber.js`, the mail catcher, the
|
|
40
|
+
users registry (`administrator`, `editor`, `user`), `dataAdmin` (the handle the test-data steps use for what only an
|
|
41
|
+
administrator may do), the browser messages that are no error of a step, and the tags that keep the assertions that
|
|
42
|
+
must fail out of a normal run, and places `tests/features/site.feature`. Run again, it adds what is missing and
|
|
43
|
+
keeps what you changed.
|
|
44
|
+
|
|
45
|
+
## 2. Look at the pages in the browser first
|
|
46
|
+
|
|
47
|
+
Before you write a scenario for an app, open it in the Playwright MCP browser first, in a tab of your own, as the
|
|
48
|
+
account the scenario uses, and note the labels, headings, menus and messages a person sees. A step for a page you
|
|
49
|
+
did not look at is a guess.
|
|
50
|
+
|
|
51
|
+
## 3. Write scenarios from the pack's steps
|
|
52
|
+
|
|
53
|
+
Every phrase you write must exist: the pack's steps (`node_modules/@webship-js/nextcloud-steps/README.md` lists
|
|
54
|
+
them) and webship-js's own. The skill `nextcloud-scenarios` groups them by area, with three whole features that pass
|
|
55
|
+
on a site built with `--install --add-users`.
|
|
56
|
+
|
|
57
|
+
```gherkin
|
|
58
|
+
Feature: A public link
|
|
59
|
+
Scenario: A visitor opens a link with a password
|
|
60
|
+
Given "user" has the file "team-photo.png"
|
|
61
|
+
And I am a logged in user with the "user" user
|
|
62
|
+
When I go to the files
|
|
63
|
+
And I create a public link for "team-photo.png"
|
|
64
|
+
And I protect the public link of "team-photo.png" with the password "Webship-Share-2026"
|
|
65
|
+
And I open the public link of "team-photo.png" as a visitor
|
|
66
|
+
Then I should be asked for the password of the share
|
|
67
|
+
When I enter the share password "Webship-Share-2026"
|
|
68
|
+
Then the shared file "team-photo.png" should be shown
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The rules of a suite:
|
|
72
|
+
|
|
73
|
+
- Log in by a handle of the users registry; never write an account's password into a feature.
|
|
74
|
+
- Never create or delete an account in a suite: accounts are configuration. The accounts page is tested read only,
|
|
75
|
+
or through its refusals (`When I try to create the account "editor"`).
|
|
76
|
+
- Make test data with the steps that take it away after the scenario: `Given "user" has the file "…"`
|
|
77
|
+
(`… in the folder "…"`), `Given "user" has the folder "…"`, `Given "user" has shared the file "…" with "…"`,
|
|
78
|
+
`Given "user" has the notification "…"`. What a scenario adds or changes on screen (files, shares, a field of the
|
|
79
|
+
profile, the theme, the status, the dashboard, a password) is taken back after it too.
|
|
80
|
+
- The files a scenario uploads are the pack's own (`meeting-notes.md`, `budget.txt`, `team-photo.png`,
|
|
81
|
+
`annual-report.pdf`) or the project's, in `tests/assets/`.
|
|
82
|
+
- No platform name in a step phrase.
|
|
83
|
+
- `Given I am a logged in user with the "…" user` takes the account's session over after its first login; keep
|
|
84
|
+
form logins for the scenarios about the login itself.
|
|
85
|
+
|
|
86
|
+
## 4. Run and read
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
bash cmd-tools-testing.sh <site> --run # the whole suite, in the container
|
|
90
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/site.feature
|
|
91
|
+
bash cmd-tools-testing.sh <site> --run --tags @critical
|
|
92
|
+
bash cmd-tools-testing.sh <site> --dry-run # every step matched, nothing run
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The runner works in the project's container, where the network changes of the host (another container starting)
|
|
96
|
+
do not cut the browser's requests. A step that says the request was cut was not the scenario's fault: run it again.
|
|
97
|
+
Each failure names what was expected, what was found and where to look; read the report and the screenshot before
|
|
98
|
+
changing a step. A run cut off in the middle can leave files behind: `bash cmd-tools-nextcloud-occ.sh <site>
|
|
99
|
+
--empty-files` takes the default accounts' files away.
|
|
100
|
+
|
|
101
|
+
## The book
|
|
102
|
+
|
|
103
|
+
For any automated functional testing in this work (a Gherkin feature, a step definition, choosing a
|
|
104
|
+
step, a test run and its failures), read the book *Automated Functional Testing Recipes* first.
|
|
105
|
+
|
|
106
|
+
- **Where.** Use the first that exists: `.claude/automated-functional-testing-recipes/` in the project,
|
|
107
|
+
`~/.claude/automated-functional-testing-recipes/` (installed by webship/webship-js-ai-agent,
|
|
108
|
+
webship/webship-js-skills or webship/ai-agents), or
|
|
109
|
+
https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
110
|
+
- **How.** Its `README.md` first, then the chapter that matches the task (one file per chapter,
|
|
111
|
+
named by its subject), not the single complete file.
|
|
112
|
+
- **Which wins.** The installed webship-js package and the step pack are the source of truth for
|
|
113
|
+
step phrasing. When they differ from the book, follow them and say so.
|
|
114
|
+
- **For the file server.** Start with `ch10-authentication-authorization.md` (logins, sessions and refusals),
|
|
115
|
+
`ch07-waiting-dynamic-content.md` and `ch27-testing-spa.md` (each app is a single-page app: wait on its own
|
|
116
|
+
signals), and `ch20-design-patterns-for-tests.md` (test data a scenario makes and takes away).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Test a Nextcloud site of the Webship Workspace with webship-js and the Nextcloud step pack — set the testing stack up when it is missing, match every step, run the suite (or one feature, or one tag) in the site's container, and report what failed and why.
|
|
3
|
+
argument-hint: '<site> [tests/features/<name>.feature | @tag]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /nextcloud-test
|
|
7
|
+
|
|
8
|
+
Test the Nextcloud site named in: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
`$ARGUMENTS` stands for what was typed after the command. An AI CLI that does not fill it in
|
|
11
|
+
reads the same from the request: the name of the site, then, if anything, one feature path or one
|
|
12
|
+
tag.
|
|
13
|
+
|
|
14
|
+
The first word is the site (its folder name in a sites folder of the workspace). What follows, if
|
|
15
|
+
anything, narrows the run: a path that starts with `tests/features/` is one feature (or one folder
|
|
16
|
+
of features), a word that starts with `@` is a tag expression. With nothing after the site, the whole
|
|
17
|
+
suite runs. With no site at all, stop and ask for one: list the candidates with
|
|
18
|
+
`ls -d ~/workspace/*/*/.ddev/config.nextcloud.yaml`.
|
|
19
|
+
|
|
20
|
+
The workspace is container-based (DDEV by default) and everything below runs in the project's
|
|
21
|
+
containers through the workspace's own command. Never run `npx cucumber-js`, `npx playwright`, `node`,
|
|
22
|
+
`occ` or PHP on the host for a site.
|
|
23
|
+
|
|
24
|
+
## 1. Find the site
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ls -d ~/workspace/*/<site>/.ddev/config.nextcloud.yaml
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Work from that sites folder (`cd ~/workspace/<folder>`). A site that is not installed has no account to
|
|
31
|
+
test with: say so, and name `bash cmd-nextcloud-project.sh <site> --install --add-users` (it rebuilds the
|
|
32
|
+
site from nothing).
|
|
33
|
+
|
|
34
|
+
## 2. Set the testing stack up, when it is missing
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bash cmd-tools-testing.sh <site>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
It adds webship-js, the Nextcloud step pack, the mail catcher of the site, the users registry
|
|
41
|
+
(`administrator`, `editor`, `user`), the handle the test-data steps use, and `tests/features/site.feature`.
|
|
42
|
+
A project that has `cucumber.js` already keeps it; the setup adds only what is missing.
|
|
43
|
+
|
|
44
|
+
## 3. Match every step
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
bash cmd-tools-testing.sh <site> --dry-run
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Every step must match exactly one definition. An undefined step is a phrase that does not exist: find
|
|
51
|
+
the real one in the pack's README or in the `nextcloud-scenarios` skill, never invent a step.
|
|
52
|
+
|
|
53
|
+
## 4. Run
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
bash cmd-tools-testing.sh <site> --run # the whole suite
|
|
57
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/site.feature # one feature
|
|
58
|
+
bash cmd-tools-testing.sh <site> --run --tags @critical # one tag
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 5. Report
|
|
62
|
+
|
|
63
|
+
The scenarios and steps that passed and failed, then for each failure: the step, its message and
|
|
64
|
+
hint, the screenshot the run kept, and what it means (a defect of the server, a scenario to fix, or a
|
|
65
|
+
request the browser cut, which a second run clears). A run cut off in the middle can leave files behind:
|
|
66
|
+
`bash cmd-tools-nextcloud-occ.sh <site> --empty-files` takes the default accounts' files away. A suite never
|
|
67
|
+
creates an account, never writes an account's password into a feature file, and never writes a platform name
|
|
68
|
+
into a step phrase. For writing or fixing scenarios, use the `nextcloud-scenarios` skill or hand over to the
|
|
69
|
+
`nextcloud-tester` agent; for changing the server, to `nextcloud-site-builder`.
|
|
70
|
+
|
|
71
|
+
Before you write or change a scenario, or read a failed run, read the book *Automated Functional
|
|
72
|
+
Testing Recipes* (its `README.md`, then the matching chapter):
|
|
73
|
+
`.claude/automated-functional-testing-recipes/` in the project,
|
|
74
|
+
`~/.claude/automated-functional-testing-recipes/`, or
|
|
75
|
+
https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Build a Nextcloud file and collaboration server with its default accounts in a sites folder and prove it with its first webship-js feature.
|
|
2
|
+
|
|
3
|
+
The launch command below is for Claude Code, the default; the text between the triple quotes can be given to another AI CLI as it is.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
claude --permission-mode bypassPermissions """
|
|
7
|
+
Build a Nextcloud server named <name> with its default accounts in this sites folder and test it with webship-js
|
|
8
|
+
# ~/workspace/<dev|test|sandboxes|demos> · https://<name>.ddev.site · container-based (DDEV by default)
|
|
9
|
+
# the builder deletes a project of the same name first: stop if <name> is a site somebody still needs
|
|
10
|
+
# the release tarball is about 240 MB and the site about 1 GB on disk: check free -g and df -h first, build one site at a time
|
|
11
|
+
# nothing on the host: no occ or PHP outside the containers; no public domain, no app store, no account anywhere
|
|
12
|
+
# a feature to write or a run to read: the book Automated Functional Testing Recipes first (its README.md, then the matching chapter), from .claude/automated-functional-testing-recipes/ in the project, ~/.claude/automated-functional-testing-recipes/ or https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
13
|
+
|
|
14
|
+
1. bash cmd-nextcloud-project.sh <name> --install --add-users
|
|
15
|
+
(a few minutes: the release, the installer, the settings for testing, the accounts)
|
|
16
|
+
2. bash cmd-tools-nextcloud-occ.sh <name>
|
|
17
|
+
tell me the version, the addresses and the accounts it lists
|
|
18
|
+
3. bash cmd-tools-testing.sh <name>
|
|
19
|
+
webship-js, the step pack, the users registry and tests/features/site.feature
|
|
20
|
+
4. bash cmd-tools-testing.sh <name> --dry-run --path tests/features/site.feature
|
|
21
|
+
5. bash cmd-tools-testing.sh <name> --run --path tests/features/site.feature
|
|
22
|
+
|
|
23
|
+
If a command fails, show the line that failed and stop. Do not retry with other flags.
|
|
24
|
+
When the feature is green: the address, the version, how many scenarios and steps passed.
|
|
25
|
+
Then ask me whether to keep the site or remove it with: bash cmd-tools-remove.sh <name>
|
|
26
|
+
"""
|
|
27
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Write and run the webship-js scenarios of one area of a Nextcloud file server (Files, sharing, the viewers, search, notifications, activity, settings, the accounts page), from the step pack's own phrases.
|
|
2
|
+
|
|
3
|
+
The launch command below is for Claude Code, the default; the text between the triple quotes can be given to another AI CLI as it is.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
claude --permission-mode bypassPermissions """
|
|
7
|
+
Write and run the scenarios of <area> for the Nextcloud site <site> of this sites folder
|
|
8
|
+
# ~/workspace/<dev|test|sandboxes|demos> · https://<site>.ddev.site · container-based (DDEV by default)
|
|
9
|
+
# the area: <login|dashboard|files|sharing|viewers|search|notifications|activity|personal settings|accounts page>
|
|
10
|
+
# every phrase from the step pack or webship-js (the nextcloud-scenarios skill lists them by area): never invent a step, never name the platform in a step phrase
|
|
11
|
+
# accounts are configuration: never create or delete one in a suite, never write an account's password into a feature; the accounts page is tested read only or through its refusals
|
|
12
|
+
# test data through the steps that take it away after the scenario: Given "user" has the file "…", has the folder "…", has shared the file "…" with "…", has the notification "…"
|
|
13
|
+
# a feature to write or a run to read: the book Automated Functional Testing Recipes first (its README.md, then the matching chapter), from .claude/automated-functional-testing-recipes/ in the project, ~/.claude/automated-functional-testing-recipes/ or https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
14
|
+
|
|
15
|
+
1. bash cmd-tools-testing.sh <site>
|
|
16
|
+
(once: webship-js, the step pack, the users registry)
|
|
17
|
+
2. Open the pages of the area in the Playwright MCP browser, in a tab of your own, as the account each scenario uses; note what a person reads.
|
|
18
|
+
3. Write tests/features/<area>.feature from those notes: one scenario per behaviour, the test-data steps for what a scenario needs.
|
|
19
|
+
4. bash cmd-tools-testing.sh <site> --dry-run --path tests/features/<area>.feature
|
|
20
|
+
5. bash cmd-tools-testing.sh <site> --run --path tests/features/<area>.feature
|
|
21
|
+
6. Run it a second time: it must pass again (the steps take away what a scenario added or changed).
|
|
22
|
+
|
|
23
|
+
If a scenario fails, read its message and its screenshot, look at the page again in the browser, then fix the scenario, not the step pack.
|
|
24
|
+
When the feature is green twice: the scenarios, the steps, and anything the pages did that surprised you.
|
|
25
|
+
"""
|
|
26
|
+
```
|