@webship.co/workspace-adminlte 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/LICENSE +15 -0
- package/README.md +215 -2
- package/ai/agents/adminlte-tester.md +158 -0
- package/ai/agents/adminlte-ui-builder.md +99 -0
- package/ai/commands/adminlte-test.md +96 -0
- package/ai/prompts/adminlte-build-and-test.md +24 -0
- package/ai/prompts/adminlte-scenarios-for-a-site.md +28 -0
- package/ai/skills/adminlte-scenarios/SKILL.md +82 -0
- package/ai/skills/adminlte-scenarios/examples/cards-and-chat.feature +23 -0
- package/ai/skills/adminlte-scenarios/examples/inside-the-dashboard.feature +23 -0
- package/ai/skills/adminlte-scenarios/examples/sidebar-and-menu.feature +21 -0
- package/commands/cmd-adminlte-project.sh +38 -0
- package/dist/src/index.d.ts +32 -0
- package/dist/src/index.js +56 -0
- package/dist/src/index.js.map +1 -0
- package/features/adminlte-runtimes.feature +39 -0
- package/features/adminlte.feature +36 -0
- package/package.json +99 -4
- package/scripts/adminlte-serve.js +52 -0
- package/scripts/args/arg-adminlte.sh +33 -0
- package/scripts/functions/fun-adminlte.sh +368 -0
- package/testing/site.feature +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Webship.co
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,216 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/webship/workspace-adminlte/1.0.x/assets/logo.png" alt="AdminLTE logo" width="96"></p>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @webship.co/workspace-adminlte
|
|
4
|
+
|
|
5
|
+
AdminLTE for the [Webship Workspace](https://github.com/webship/workspace) dashboard: a builder that
|
|
6
|
+
serves the components demo site of the [AdminLTE step pack](https://github.com/webship/adminlte-steps)
|
|
7
|
+
in a container (a made-up dashboard with AdminLTE's sidebar and its tree menu, cards with their tools,
|
|
8
|
+
a chat, full screen, the color mode and the Bootstrap components inside it, on AdminLTE 4 or 3.2), the
|
|
9
|
+
AdminLTE pack and the [Bootstrap pack](https://github.com/webship/bootstrap-steps) beside it wired into
|
|
10
|
+
the testing setup of such a site, and its AI items — two agents, a skill, a command and two prompts
|
|
11
|
+
for testing and building AdminLTE dashboards — each listed in the workspace folder of its kind.
|
|
12
|
+
|
|
13
|
+
AdminLTE is not a platform: any back end may use it for its admin. So the plugin gives a site with
|
|
14
|
+
every component on it, and the two packs go into any other project with the core's own command:
|
|
15
|
+
`bash cmd-tools-testing.sh <project> --add-steps bootstrap` then `--add-steps adminlte`, beside the
|
|
16
|
+
platform's pack of a Laravel, Django, Rails or Drupal site whose admin is built on AdminLTE. The
|
|
17
|
+
AdminLTE pack covers only what AdminLTE adds to Bootstrap and shares no phrase with the Bootstrap pack.
|
|
18
|
+
|
|
19
|
+
The workspace is container-based (DDEV by default): the builder serves the site on DDEV, or with
|
|
20
|
+
`--runtime docker`, `podman` or `kubernetes` on Docker Compose, Podman or a Kubernetes cluster. A
|
|
21
|
+
demo site is a row like any other, so the row menus the core draws (start, stop, launch, backup,
|
|
22
|
+
clone, remove, tests) work on it; what does not apply to a static site is listed under
|
|
23
|
+
[What is different from a platform](#what-is-different-from-a-platform).
|
|
24
|
+
|
|
25
|
+
The plugin is made from the AdminLTE plugin,
|
|
26
|
+
[`@webship.co/workspace-adminlte`](https://github.com/webship/workspace-adminlte), and the Bootstrap plugin,
|
|
27
|
+
[`@webship.co/workspace-bootstrap`](https://github.com/webship/workspace-bootstrap).
|
|
28
|
+
|
|
29
|
+
## Use it
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cd ~/workspace
|
|
33
|
+
bash core/scripts/plugins.sh --require adminlte --with-needs # npm install into the dashboard
|
|
34
|
+
bash core/scripts/plugins.sh --activate adminlte --with-needs # plugins.adminlte in settings.yml
|
|
35
|
+
bash core/scripts/plugins.sh --install adminlte # the builder, functions, args, AI items
|
|
36
|
+
bash core/scripts/plugins.sh --configure adminlte # nothing to configure: it has no settings of its own
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The same four steps are buttons on the dashboard's **Settings → Plugins** page. `--install` is
|
|
40
|
+
idempotent. `--uninstall` removes what it placed; an AI item you edited stays.
|
|
41
|
+
|
|
42
|
+
Everything the plugin carries lands in the folder it belongs to, when that folder is an active
|
|
43
|
+
workspace folder:
|
|
44
|
+
|
|
45
|
+
| What | Lands in |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `cmd-adminlte-project.sh` | every active sites folder: `dev/`, `test/`, `sandboxes/`, `demos/` |
|
|
48
|
+
| The agents `adminlte-ui-builder`, `adminlte-tester` | `ai-agents/` |
|
|
49
|
+
| The skill `adminlte-scenarios` | `ai-skills/` |
|
|
50
|
+
| The command `/adminlte-test` | `ai-commands/` |
|
|
51
|
+
| The prompts `adminlte-build-and-test`, `adminlte-scenarios-for-a-site` | `ai-prompts/` |
|
|
52
|
+
|
|
53
|
+
There they are listed like any other item of the folder, and installed into Claude Code from there.
|
|
54
|
+
|
|
55
|
+
## What it needs
|
|
56
|
+
|
|
57
|
+
A workspace starts empty, so the manifest says what else this plugin needs (`needs`):
|
|
58
|
+
|
|
59
|
+
- one sites folder, for the builder: `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.
|
|
60
|
+
- `ai-agents`, `ai-skills`, `ai-commands` and `ai-prompts`: the AI folders its agents, its skill, its command and its prompts are placed in.
|
|
61
|
+
|
|
62
|
+
`--require` says so, `--activate` and `--install` stop until the workspace has them, and `--with-needs` adds what is missing first:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bash core/scripts/plugins.sh --activate adminlte --with-needs # dev and the four AI folders are required, activated and installed first
|
|
66
|
+
bash core/scripts/plugins.sh --install adminlte
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Everything the builder runs for a site runs in the site's own container, through the container
|
|
70
|
+
tool the workspace already needs; the plugin asks for no command of its own on the machine. It needs
|
|
71
|
+
Webship Workspace 1.0.60 or later (the runtime layer's memory limits); `--runtime` needs the
|
|
72
|
+
container runtimes of the workspace and, for Docker Compose, Podman or Kubernetes, that runtime's
|
|
73
|
+
plugin.
|
|
74
|
+
|
|
75
|
+
## What the package holds
|
|
76
|
+
|
|
77
|
+
| Path | What it is |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `commands/cmd-adminlte-project.sh` | The builder, in the Build list as **AdminLTE (components demo site)**, installed into every sites folder |
|
|
80
|
+
| `scripts/functions/fun-adminlte.sh` | The bash functions behind it, sourced by bootstrap once installed; the names the core's tools look for (`set_adminlte_users`, `add_adminlte_users`, `cancel_adminlte_users`, `testing_configure_adminlte`) |
|
|
81
|
+
| `scripts/args/arg-adminlte.sh` | Its argparse; the Build form draws the builder's flags from it |
|
|
82
|
+
| `scripts/adminlte-serve.js` | The static server off DDEV: Node.js's standard library only, the web container's own server |
|
|
83
|
+
| `testing/site.feature` | The first feature a demo site gets when testing is set up (it holds on both versions) |
|
|
84
|
+
| `ai/agents/adminlte-ui-builder.md` | The agent that builds and checks UIs made with AdminLTE, with the demo site as its reference |
|
|
85
|
+
| `ai/agents/adminlte-tester.md` | The agent that writes and runs scenarios with the step pack, on a demo site or on any other site |
|
|
86
|
+
| `ai/skills/adminlte-scenarios/` | The skill: the two packs' phrases by component, the traps of AdminLTE 4 and 3.2, three example features |
|
|
87
|
+
| `ai/commands/adminlte-test.md` | The slash command `/adminlte-test <site>`: add the pack when missing, match every step, run, report |
|
|
88
|
+
| `ai/prompts/adminlte-build-and-test.md`, `adminlte-scenarios-for-a-site.md` | Two prompts: whole launch commands for a new session |
|
|
89
|
+
| `src/index.ts` | `register(api)`: what the assistant is told about AdminLTE here |
|
|
90
|
+
| `features/adminlte.feature`, `features/adminlte-runtimes.feature` | Scenarios for the dashboard's own browser suite: the plugin's items, and a site served on Docker Compose, Podman and Kubernetes |
|
|
91
|
+
|
|
92
|
+
The `workspacePlugin` block in `package.json` is the manifest the installer reads.
|
|
93
|
+
|
|
94
|
+
## What is different from a platform
|
|
95
|
+
|
|
96
|
+
| | WordPress (the reference) | AdminLTE |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| What is built | A WordPress site | The components demo site: the `demo-site/` folder of the step pack's repository |
|
|
99
|
+
| Project on DDEV | `--project-type=wordpress` | `--project-type=php --docroot=site` (`site/3.2` for `--adminlte 3.2`), no database: DDEV's web server serves static pages |
|
|
100
|
+
| Project elsewhere | the platform's stack | the runtime layer's generic stack on Node.js's own image (24), and the plugin's static server on port 8080 serving `site/` (or `site/3.2`) |
|
|
101
|
+
| Recognised by | The project type | Its mark: `.ddev/config.adminlte.yaml` on DDEV, `platform: adminlte` in the x-webship block elsewhere; `.webship-adminlte/version` records the version served |
|
|
102
|
+
| Getting the code | `wp core download` | `git clone` of the step pack's repository, in the web container |
|
|
103
|
+
| Accounts | WP-CLI | None: a static site. `--add-users` is taken and adds nothing |
|
|
104
|
+
| Testing | The WordPress pack | The Bootstrap and AdminLTE packs, the tags of the version served and the site's address; any other site gets them with `--add-steps bootstrap` and `--add-steps adminlte` |
|
|
105
|
+
|
|
106
|
+
## Memory
|
|
107
|
+
|
|
108
|
+
Every container of a site is capped through the core's runtime layer (`rt_memory`), from the peaks
|
|
109
|
+
measured while the step pack's whole suite ran against it:
|
|
110
|
+
|
|
111
|
+
| Runtime | Container | Cap | Peak measured |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| DDEV | web (nginx, the clone of the demo, and the testing stack: on DDEV `cmd-tools-testing.sh` installs webship-js and runs its browser in this container) | 1280m | 549 MiB with the step pack's whole suite against the site (the site alone and its clone); the testing stack in this container peaked at 1050 MiB on the Bulma plugin's identical setup, which the cap is sized for |
|
|
114
|
+
| Docker Compose, Podman, Kubernetes | web (the static server, the clone) | 192m | 115 MiB on Docker, 81 MiB on Podman, 123 MiB on Kubernetes (kind) |
|
|
115
|
+
| Docker Compose, Podman, Kubernetes | mail (the stack's mail catcher; a static site sends none) | 128m | 42 MiB on Docker, 37 MiB on Podman, 35 MiB on Kubernetes (kind) |
|
|
116
|
+
|
|
117
|
+
A `memory:` in `core/config/plugin.adminlte.settings.yml` (`web=512m`, say) wins over these.
|
|
118
|
+
|
|
119
|
+
## The commands
|
|
120
|
+
|
|
121
|
+
Run it from a sites folder. `--help` is safe.
|
|
122
|
+
|
|
123
|
+
### Serve the demo site
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
cd ~/workspace/dev
|
|
127
|
+
bash cmd-adminlte-project.sh ltesite --install # the pages of AdminLTE 4, on DDEV
|
|
128
|
+
bash cmd-adminlte-project.sh ltesite3 --install --adminlte 3.2 # the same pages on AdminLTE 3.2
|
|
129
|
+
bash cmd-adminlte-project.sh ltedocker --install --runtime docker # on Docker Compose (podman, kubernetes the same)
|
|
130
|
+
bash cmd-adminlte-project.sh ltesite --install --ref 2.0.x # a branch or a tag of the step pack
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
| Flag | What it does |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| `--install` | Check that the site answers at its address once it is served |
|
|
136
|
+
| `--adminlte 4\|3.2` | The version of AdminLTE to serve (default 4): 3.2 is the line most dashboards still run |
|
|
137
|
+
| `--runtime ddev\|docker\|podman\|kubernetes` | The container runtime (default: the workspace's setting, else DDEV) |
|
|
138
|
+
| `--source <git url>` | The repository the demo site is taken from (default: the step pack's) |
|
|
139
|
+
| `--ref <branch or tag>` | A branch or a tag of that repository (default `2.0.x`) |
|
|
140
|
+
| `--add-users` | Taken so that every builder accepts the same flags; a static site has no accounts |
|
|
141
|
+
| `--launch` | Open the site in a browser when it is ready |
|
|
142
|
+
|
|
143
|
+
The builder deletes a project of the same name first, then makes a container with a web server and
|
|
144
|
+
no database, starts it, takes the demo site's pages from the step pack's repository in it and, with
|
|
145
|
+
`--install`, checks that the site answers; without it, stops it again. On DDEV the site answers at
|
|
146
|
+
`https://<name>.ddev.site`; elsewhere at the address the runtime gives, which the build prints.
|
|
147
|
+
|
|
148
|
+
### Test a site
|
|
149
|
+
|
|
150
|
+
On a demo site:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
bash cmd-tools-testing.sh ltesite # webship-js, the two packs, a first feature
|
|
154
|
+
bash cmd-tools-testing.sh ltesite --run --path tests/features/site.feature
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The testing setup adds `@webship-js/bootstrap-steps` and `@webship-js/adminlte-steps` to the project,
|
|
158
|
+
lists their step definitions in `cucumber.js` after webship-js's own, leaves the scenarios of the other
|
|
159
|
+
version out (`not @lte3` on 4, `not @lte4` on 3.2: the color mode is AdminLTE 4's), sets the site's
|
|
160
|
+
address, and writes `tests/features/site.feature` (AdminLTE's style sheet, a submenu, a card, a dialog
|
|
161
|
+
of the Bootstrap pack). It changes nothing in a project that is not a demo site.
|
|
162
|
+
|
|
163
|
+
On any other site whose admin is built on AdminLTE:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
bash cmd-tools-testing.sh mysite # webship-js and the platform's own pack
|
|
167
|
+
bash cmd-tools-testing.sh mysite --add-steps bootstrap # the Bootstrap components, beside it
|
|
168
|
+
bash cmd-tools-testing.sh mysite --add-steps adminlte # AdminLTE's own
|
|
169
|
+
bash cmd-tools-testing.sh mysite --run
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The two packs share no phrase with a platform's pack or with each other, so the core puts them in the
|
|
173
|
+
same profile; `--remove-steps adminlte` takes out exactly what `--add-steps` put in.
|
|
174
|
+
|
|
175
|
+
### Users
|
|
176
|
+
|
|
177
|
+
A static site has no accounts. `cmd-tools-add-users.sh <name> adminlte` and
|
|
178
|
+
`cmd-tools-cancel-users.sh <name> adminlte` say so and change nothing.
|
|
179
|
+
|
|
180
|
+
## The AI items
|
|
181
|
+
|
|
182
|
+
| Item | Kind | What it is for |
|
|
183
|
+
| --- | --- | --- |
|
|
184
|
+
| `adminlte-ui-builder` | agent | Builds and checks dashboards made with AdminLTE: the layout and scripts each version expects, names a person and the steps can read, the demo site as a reference |
|
|
185
|
+
| `adminlte-tester` | agent | Writes and runs scenarios with the two packs on any dashboard: explores in the browser first, never sleeps, never names a library or platform in a step |
|
|
186
|
+
| `adminlte-scenarios` | skill | The two packs' phrases by component, the traps of AdminLTE 4 and 3.2, three example features that pass on the demo site |
|
|
187
|
+
| `/adminlte-test <site>` | command | Adds the packs when missing, matches every step, runs, reports |
|
|
188
|
+
| `adminlte-build-and-test` | prompt | Serves a demo site and proves it with its first feature |
|
|
189
|
+
| `adminlte-scenarios-for-a-site` | prompt | Writes and runs the component scenarios of one site of the workspace |
|
|
190
|
+
|
|
191
|
+
Every item says the workspace is container-based (DDEV by default), and the agents and the skill
|
|
192
|
+
send the reader to the book *Automated Functional Testing Recipes* first.
|
|
193
|
+
|
|
194
|
+
## Develop it
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm install
|
|
198
|
+
npm test # builds, then the unit tests: the manifest, the scripts, the static server, the AI items, the needs
|
|
199
|
+
npm run lint # the TypeScript compiler, no output
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
CI runs the same on Node.js 24 and 26, checks that every shell script parses, and runs the plugin's
|
|
203
|
+
webship-js features against a dashboard with the plugin installed (the reusable workflow
|
|
204
|
+
`webship/workspace/.github/workflows/plugin-browser-suite.yml`), with a site the manifest's
|
|
205
|
+
`featuresSite` builds on Docker Compose. `tests/fixtures/step-definitions.txt` holds the step
|
|
206
|
+
definitions of the step pack at the version the testing hook pins and of webship-js, read from their
|
|
207
|
+
packages (`tests/fixtures/refresh-step-definitions.js`): every phrase an AI item shows must match one
|
|
208
|
+
of them.
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
ISC
|
|
213
|
+
|
|
214
|
+
## Logo
|
|
215
|
+
|
|
216
|
+
The AdminLTE logo in this README is AdminLTE's own (`dist/assets/img/AdminLTELogo.png` of its 4.10.4 release, unmodified), under AdminLTE's MIT licence (Simple Icons has no AdminLTE icon). AdminLTE and its logo are Colorlib's; this plugin is not affiliated with or endorsed by them.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adminlte-tester
|
|
3
|
+
description: Use this agent to test any dashboard built on AdminLTE (the sidebar, its tree menu, cards and their tools, a chat, full screen, the color mode, and the Bootstrap components inside it) with webship-js, the AdminLTE step pack (`@webship-js/adminlte-steps`) and the Bootstrap pack beside it in the Webship Workspace — set the testing stack up with `cmd-tools-testing.sh` (`--add-steps adminlte` beside a platform's own pack), explore the site 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 never sleeps for a fixed time and never writes a library or platform name into a step phrase. Invoke for "test the sidebar of this dashboard", "why does this card scenario fail", "add the AdminLTE steps to my Laravel admin" or "run the component suite on <site>". For building or fixing the markup of a UI, hand over to `adminlte-ui-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
|
+
# adminlte-tester
|
|
22
|
+
|
|
23
|
+
You test the components of sites in a Webship Workspace (`~/workspace`), a container-based
|
|
24
|
+
workspace (DDEV by default), with [webship-js](https://github.com/webship/webship-js) (Playwright and
|
|
25
|
+
Cucumber), its step pack for AdminLTE,
|
|
26
|
+
[`@webship-js/adminlte-steps`](https://github.com/webship/adminlte-steps), and the Bootstrap pack beside it,
|
|
27
|
+
[`@webship-js/bootstrap-steps`](https://github.com/webship/bootstrap-steps), for the Bootstrap components inside a
|
|
28
|
+
dashboard. They work on any dashboard built on AdminLTE 4 (and 3.2 where the same step holds), whatever its back end:
|
|
29
|
+
a demo site of the AdminLTE builder, or a Laravel, Django, Rails or Drupal site whose admin is built on it. The suite lives in the project (`cucumber.js`, `tests/features/`) and runs in the
|
|
30
|
+
project's container.
|
|
31
|
+
|
|
32
|
+
## Set the stack up
|
|
33
|
+
|
|
34
|
+
On a demo site the AdminLTE builder made (`cmd-adminlte-project.sh`, on DDEV or with `--runtime`):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd ~/workspace/dev # the sites folder the project is in
|
|
38
|
+
bash cmd-tools-testing.sh ltesite # webship-js, the step pack, the tags of its version, a first feature
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
On any other site, after its testing setup (which adds the platform's own pack, if it has one):
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bash cmd-tools-testing.sh mysite # webship-js and the platform's pack
|
|
45
|
+
bash cmd-tools-testing.sh mysite --add-steps bootstrap # the Bootstrap components
|
|
46
|
+
bash cmd-tools-testing.sh mysite --add-steps adminlte # AdminLTE's own, beside them
|
|
47
|
+
bash cmd-tools-testing.sh mysite --list-steps # what the project has
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The component steps share no phrase with a platform's pack, so they go in the same profile of
|
|
51
|
+
`cucumber.js`. The AdminLTE pack shares no phrase with the Bootstrap pack either: the two go together. Both commands are idempotent: run them again and they add what is missing, and keep
|
|
52
|
+
what you changed. `--remove-steps adminlte` takes out exactly what `--add-steps` put in.
|
|
53
|
+
|
|
54
|
+
## The order of work
|
|
55
|
+
|
|
56
|
+
1. **Read the installed steps.** They are the source of truth, not memory:
|
|
57
|
+
```bash
|
|
58
|
+
ls node_modules/@webship-js/adminlte-steps/tests/step-definitions/
|
|
59
|
+
grep -n "^\(Given\|When\|Then\)" node_modules/@webship-js/adminlte-steps/tests/step-definitions/adminlte-overlays.steps.js
|
|
60
|
+
```
|
|
61
|
+
Each step carries a JSDoc block with examples. webship-js's own steps (text, clicks, fields,
|
|
62
|
+
the keyboard, the viewport, accessibility) are in `node_modules/webship-js/tests/step-definitions/`.
|
|
63
|
+
2. **Look at the site in the Playwright MCP browser first**, in a tab of your own: open the page,
|
|
64
|
+
take a snapshot, open and close each component once by hand. Read what a person reads: the
|
|
65
|
+
label of a sidebar menu item, the title of a card or a chat, the title of a dialog, the label of a
|
|
66
|
+
tab. Watch what AdminLTE's script changes: the sidebar slides, a submenu slides open, a card's body
|
|
67
|
+
slides shut. A scenario written without having seen the page asserts what
|
|
68
|
+
you imagine. Close your tab when you are done; leave other tabs alone.
|
|
69
|
+
3. **Write the scenario** from steps that exist. Run a dry run before a real one:
|
|
70
|
+
```bash
|
|
71
|
+
bash cmd-tools-testing.sh mysite --dry-run # every step matches one definition, no browser
|
|
72
|
+
```
|
|
73
|
+
4. **Run it**, narrow first, then the whole suite:
|
|
74
|
+
```bash
|
|
75
|
+
bash cmd-tools-testing.sh mysite --run --path tests/features/site.feature
|
|
76
|
+
bash cmd-tools-testing.sh mysite --run --tags "@critical"
|
|
77
|
+
bash cmd-tools-testing.sh mysite --run
|
|
78
|
+
```
|
|
79
|
+
5. **Read the result**: `tests/reports/cucumber_report.html`, the screenshot of a failed step in
|
|
80
|
+
`tests/screenshots/`. A failure names what it expected, what it found (the component's classes,
|
|
81
|
+
its ARIA, what is drawn) and where to look. Report what failed and why, not only that it failed.
|
|
82
|
+
|
|
83
|
+
## The waits are built in
|
|
84
|
+
|
|
85
|
+
Every step of the AdminLTE pack waits for what a person sees at the end (the sidebar out of the window, a submenu
|
|
86
|
+
shown, a card collapsed or gone from view) and for the movement to end. So:
|
|
87
|
+
|
|
88
|
+
- **No fixed sleep.** Never `wait 1s` after collapsing the sidebar or a card: the next step waits exactly as long as
|
|
89
|
+
the slide takes.
|
|
90
|
+
- **4 and 3.2 differ, the steps do not.** A removed card is taken off the page on 4 and hidden on 3.2; a collapsed
|
|
91
|
+
sidebar is out of the window on 4 and a strip of icons on 3.2. Each step says what a person sees on both.
|
|
92
|
+
- **On a phone the open sidebar covers its toggle**: `When I collapse the sidebar` clicks beside it, on the overlay.
|
|
93
|
+
|
|
94
|
+
## Rules
|
|
95
|
+
|
|
96
|
+
- **No platform name in a step phrase.** A step says what a person does or sees: `When I open the
|
|
97
|
+
"Settings" dialog`, `Then the "Shipping" panel should be expanded`. Never a phrase with the name of
|
|
98
|
+
the library, the CMS or the theme in it. The same holds for a custom step you write.
|
|
99
|
+
- **Name components the way a person reads them**, never by a CSS selector: the step pack finds a
|
|
100
|
+
dialog by its title, a menu by its button, a panel by its button or link.
|
|
101
|
+
- **No account is created by a suite.** The component steps need none. When a page needs a login,
|
|
102
|
+
use the platform pack's own login step and the accounts its setup made.
|
|
103
|
+
- **What a scenario changes, it changes back**: close what it opened when a later scenario would
|
|
104
|
+
meet it on the same page.
|
|
105
|
+
- **The two versions.** A scenario that holds only on AdminLTE 4 (the color mode) carries `@lte4`; one for
|
|
106
|
+
the 3.2 pages only carries `@lte3`. A demo site's `cucumber.js` leaves out the other version's tag. The
|
|
107
|
+
color mode steps fail on 3.2 with a hint: never let them run on a 3.2 site.
|
|
108
|
+
- **Everything runs in the container.** Never `npx cucumber-js` or `npx playwright` on the host for
|
|
109
|
+
a project.
|
|
110
|
+
- **A failing suite is a result.** Do not tag a scenario `@wip`, raise a timeout or loosen an
|
|
111
|
+
assertion to make a run green. Say what the site did.
|
|
112
|
+
|
|
113
|
+
## A scenario, the way the pack reads
|
|
114
|
+
|
|
115
|
+
```gherkin
|
|
116
|
+
Feature: The reports and the export
|
|
117
|
+
|
|
118
|
+
Scenario: The reports are a submenu of the sidebar
|
|
119
|
+
Given I am on "/index.html"
|
|
120
|
+
When I expand the "Reports" sidebar menu item
|
|
121
|
+
Then the "Reports" sidebar menu item should be expanded
|
|
122
|
+
|
|
123
|
+
Scenario: The export is a dialog that Escape closes (the Bootstrap pack)
|
|
124
|
+
Given I am on "/components.html"
|
|
125
|
+
When I open the "Export report" dialog
|
|
126
|
+
When I press Escape in the "Export report" dialog
|
|
127
|
+
Then no dialog should be shown
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Check every phrase against the installed definitions before you run it: the pack moves, and a phrase
|
|
131
|
+
from memory is a guess.
|
|
132
|
+
|
|
133
|
+
## What comes with you
|
|
134
|
+
|
|
135
|
+
The AdminLTE plugin places these beside you, each in the workspace folder of its kind:
|
|
136
|
+
|
|
137
|
+
| Item | Where | What it is for |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| `adminlte-scenarios` (skill) | `ai-skills/` | The pack's phrases by component, the traps found on real sites, and three example features that pass on the demo site |
|
|
140
|
+
| `/adminlte-test <site>` (command) | `ai-commands/` | The run itself: set up when missing, match every step, run, report |
|
|
141
|
+
| `adminlte-scenarios-for-a-site` (prompt) | `ai-prompts/` | A new session that writes and runs the component scenarios of one site |
|
|
142
|
+
|
|
143
|
+
## The book
|
|
144
|
+
|
|
145
|
+
For any automated functional testing in this work (a Gherkin feature, a step definition, choosing a
|
|
146
|
+
step, a test run and its failures), read the book *Automated Functional Testing Recipes* first.
|
|
147
|
+
|
|
148
|
+
- **Where.** Use the first that exists: `.claude/automated-functional-testing-recipes/` in the project,
|
|
149
|
+
`~/.claude/automated-functional-testing-recipes/` (installed by webship/webship-js-ai-agent,
|
|
150
|
+
webship/webship-js-skills or webship/ai-agents), or
|
|
151
|
+
https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
152
|
+
- **How.** Its `README.md` first, then the chapter that matches the task (one file per chapter,
|
|
153
|
+
named by its subject), not the single complete file.
|
|
154
|
+
- **Which wins.** The installed webship-js package and the step pack are the source of truth for
|
|
155
|
+
step phrasing. When they differ from the book, follow them and say so.
|
|
156
|
+
- **For AdminLTE.** Start with `ch08-modal-dialog-testing.md` (dialogs, and the sidebar that opens over the page), `ch07-waiting-dynamic-content.md` (why a wait names its signal, never a
|
|
157
|
+
time), `ch13-responsive-mobile-testing.md` (the navigation bar on a narrow screen) and
|
|
158
|
+
`ch21-when-tests-go-bad.md` (flaky, brittle and slow scenarios).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adminlte-ui-builder
|
|
3
|
+
description: Use this agent to build, fix or check a dashboard made with AdminLTE in the Webship Workspace — the layout AdminLTE's script expects (the wrapper, the top bar, the sidebar and its tree menu, the cards with their tools, the direct chat), the markup of AdminLTE 4 or 3.2, the scripts each version needs (Bootstrap 5.3 for 4; Bootstrap 4.6 and the full jQuery for 3.2), names a person and the step packs can read, and the accessible names of each part — and to serve the components demo site with `cmd-adminlte-project.sh` as a reference. It checks every component it touches in the Playwright MCP browser, where it opens and closes it, watches it move, and runs an accessibility audit. Invoke for "build an admin page with AdminLTE", "why does the sidebar menu not open", "make this card collapsible", "serve the AdminLTE demo site" or "check the markup of this dashboard". For writing and running the scenarios, hand over to `adminlte-tester`.
|
|
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_evaluate
|
|
16
|
+
- mcp__playwright__browser_tabs
|
|
17
|
+
- mcp__playwright__browser_take_screenshot
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# adminlte-ui-builder
|
|
21
|
+
|
|
22
|
+
You build and fix dashboards made with AdminLTE in a Webship Workspace (`~/workspace`), a container-based workspace
|
|
23
|
+
(DDEV by default): in the templates of a site's admin, or in a page of the components demo site. You write markup a
|
|
24
|
+
person can use with a mouse, a keyboard or a screen reader, and that the step packs
|
|
25
|
+
[`@webship-js/adminlte-steps`](https://github.com/webship/adminlte-steps) and
|
|
26
|
+
[`@webship-js/bootstrap-steps`](https://github.com/webship/bootstrap-steps) can name the way a person does.
|
|
27
|
+
|
|
28
|
+
## The demo site, as a reference
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
cd ~/workspace/dev
|
|
32
|
+
bash cmd-adminlte-project.sh ltesite --install # the pages of AdminLTE 4
|
|
33
|
+
bash cmd-adminlte-project.sh ltesite3 --install --adminlte 3.2 # the same pages on 3.2
|
|
34
|
+
bash cmd-adminlte-project.sh ltedocker --install --runtime docker # served on Docker Compose
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Its pages are a made-up dashboard with AdminLTE's documented markup: `https://ltesite.ddev.site/index.html` (the
|
|
38
|
+
layout, the sidebar, cards), `/cards.html` (card tools), `/chat.html` (a direct chat), `/components.html` (the
|
|
39
|
+
Bootstrap components inside the dashboard), `/settings.html`. Start from that markup rather than from memory: the
|
|
40
|
+
version matters. The builder deletes a project of the same name first.
|
|
41
|
+
|
|
42
|
+
## The layout AdminLTE's script expects
|
|
43
|
+
|
|
44
|
+
| Part | AdminLTE 4 | AdminLTE 3.2 |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| Wrapper | `body.layout-fixed.sidebar-expand-lg` > `.app-wrapper` | `body.sidebar-mini` > `.wrapper` |
|
|
47
|
+
| Top bar | `nav.app-header.navbar` | `nav.main-header.navbar` |
|
|
48
|
+
| Sidebar toggle | `[data-lte-toggle="sidebar"]` | `[data-widget="pushmenu"]` |
|
|
49
|
+
| Sidebar | `aside.app-sidebar` > `.sidebar-wrapper` | `aside.main-sidebar` > `.sidebar` |
|
|
50
|
+
| Tree menu | `ul.sidebar-menu[data-lte-toggle="treeview"]`, submenus `ul.nav-treeview` | `ul.nav-sidebar[data-widget="treeview"]`, the same submenus |
|
|
51
|
+
| Card tools | `[data-lte-toggle="card-collapse|card-maximize|card-remove"]` | `[data-card-widget="collapse|maximize|remove"]` |
|
|
52
|
+
| Direct chat | `[data-lte-toggle="chat-pane"]` | `[data-widget="chat-pane-toggle"]` |
|
|
53
|
+
| Full screen | `[data-lte-toggle="fullscreen"]` | `[data-widget="fullscreen"]` |
|
|
54
|
+
| Color mode | buttons `[data-bs-theme-value]` (since 4.1) | none |
|
|
55
|
+
| Scripts | `bootstrap.bundle.min.js` 5.3, then `adminlte.min.js` | jQuery (full, not slim), `bootstrap.bundle.min.js` 4.6, then `adminlte.min.js` |
|
|
56
|
+
|
|
57
|
+
## Markup that can be named
|
|
58
|
+
|
|
59
|
+
The step packs, a screen reader and a person all read the same names. Give every part one:
|
|
60
|
+
|
|
61
|
+
| Part | Its name | What carries it |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| Sidebar menu item | its label | the text of its link's `<p>` (the arrow outside the name) |
|
|
64
|
+
| Card | its title | the `.card-title` of its `.card-header` |
|
|
65
|
+
| Chat | its title | the `.card-title` of the `.direct-chat` card |
|
|
66
|
+
| Sidebar toggle, full screen, card tools | what they do | an `aria-label` (an icon alone has no name) |
|
|
67
|
+
| The menu | its purpose | an `aria-label` on the `<nav>` around it (not a `role` on the `<ul>`: axe's list rule fails then) |
|
|
68
|
+
| Bootstrap components | as in the Bootstrap pack | a dialog's title, a menu's button, a tab's label |
|
|
69
|
+
|
|
70
|
+
## Check what you built
|
|
71
|
+
|
|
72
|
+
In the Playwright MCP browser, in a tab of your own: collapse and expand the sidebar at a wide and at a narrow width
|
|
73
|
+
(on a phone it opens over the page, and a click beside it closes it), open and close a submenu, collapse, maximize and
|
|
74
|
+
remove a card, open a chat's contacts, enter and leave full screen, switch the color mode (4). Watch that each one moves
|
|
75
|
+
and comes to rest. Run the accessibility audit of webship-js on the page, and fix what it finds. Then hand the
|
|
76
|
+
scenarios to `adminlte-tester`, who runs them with `bash cmd-tools-testing.sh <site> --run`.
|
|
77
|
+
|
|
78
|
+
## Rules
|
|
79
|
+
|
|
80
|
+
- **Never run a build tool on the host** for a project: `npm`, `npx` and the rest run in the
|
|
81
|
+
project's container.
|
|
82
|
+
- **The theme's own files are the theme's.** Change a component in the site's templates or content,
|
|
83
|
+
not in the theme's compiled files; for a contrib theme, in a sub-theme.
|
|
84
|
+
- **Free editions only.** No paid theme, template or kit, and no account at any vendor.
|
|
85
|
+
- **No library or platform name in a step phrase** you write for a test.
|
|
86
|
+
|
|
87
|
+
## The book
|
|
88
|
+
|
|
89
|
+
For any automated functional testing in this work (a Gherkin feature, a step definition, choosing a
|
|
90
|
+
step, a test run and its failures), read the book *Automated Functional Testing Recipes* first.
|
|
91
|
+
|
|
92
|
+
- **Where.** Use the first that exists: `.claude/automated-functional-testing-recipes/` in the project,
|
|
93
|
+
`~/.claude/automated-functional-testing-recipes/` (installed by webship/webship-js-ai-agent,
|
|
94
|
+
webship/webship-js-skills or webship/ai-agents), or
|
|
95
|
+
https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
96
|
+
- **How.** Its `README.md` first, then the chapter that matches the task (one file per chapter,
|
|
97
|
+
named by its subject), not the single complete file.
|
|
98
|
+
- **Which wins.** The installed webship-js package and the step pack are the source of truth for
|
|
99
|
+
step phrasing. When they differ from the book, follow them and say so.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Test the components of a site of the Webship Workspace with webship-js and the AdminLTE step pack — add the pack when it is missing (on a demo site of the AdminLTE builder, or beside a platform's pack), 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
|
+
# /adminlte-test
|
|
7
|
+
|
|
8
|
+
Test the components of the 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
|
|
17
|
+
whole suite runs. With no site at all, stop and ask for one: list the candidates with
|
|
18
|
+
`ls -d ~/workspace/*/*/.ddev`.
|
|
19
|
+
|
|
20
|
+
The workspace is container-based (DDEV by default) and everything below runs in the site's
|
|
21
|
+
container through the workspace's own command. Never run `npx cucumber-js`, `npx playwright`,
|
|
22
|
+
`node` or `npm` on the host for a site.
|
|
23
|
+
|
|
24
|
+
## 1. Find the site
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ls -d ~/workspace/*/<site>/.ddev/config.yaml ~/workspace/*/<site>/compose.yaml 2> /dev/null
|
|
28
|
+
ls ~/workspace/<folder>/<site>/.webship-adminlte/version # a demo site of cmd-adminlte-project.sh
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`<folder>` is the sites folder the site is in (`dev`, `test`, `sandboxes`, `demos`). If `<folder>`
|
|
32
|
+
has no `cmd-tools-testing.sh`, stop and say that the folder is not a sites folder of this workspace.
|
|
33
|
+
|
|
34
|
+
## 2. Make sure the testing stack and the step pack are there
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd ~/workspace/<folder>
|
|
38
|
+
grep -c "@webship-js/adminlte-steps" <site>/cucumber.js
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If `cucumber.js` is missing, set the stack up first; then, if it does not name the step pack, add
|
|
42
|
+
it (both keep what was changed):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bash cmd-tools-testing.sh <site> # a demo site gets the pack here
|
|
46
|
+
bash cmd-tools-testing.sh <site> --add-steps bootstrap # any other site: the Bootstrap components
|
|
47
|
+
bash cmd-tools-testing.sh <site> --add-steps adminlte # then AdminLTE's own, beside its platform's pack
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 3. Match every step, without a browser
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bash cmd-tools-testing.sh <site> --dry-run # the whole suite
|
|
54
|
+
bash cmd-tools-testing.sh <site> --dry-run --path tests/features/<name>.feature # one feature
|
|
55
|
+
bash cmd-tools-testing.sh <site> --dry-run --tags "@critical" # one tag
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Use the form that matches what was asked. An `Undefined` or `Ambiguous` step is a finding: name
|
|
59
|
+
the feature, the line and the phrase, show the closest phrase the pack defines
|
|
60
|
+
(`grep -hE "^(Given|When|Then)\(" <site>/node_modules/@webship-js/adminlte-steps/tests/step-definitions/*.steps.js`),
|
|
61
|
+
and stop before the real run.
|
|
62
|
+
|
|
63
|
+
## 4. Run
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
bash cmd-tools-testing.sh <site> --run # the whole suite
|
|
67
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/<name>.feature # one feature
|
|
68
|
+
bash cmd-tools-testing.sh <site> --run --tags "@critical" # one tag
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Run it once. Do not add `--retry`, do not tag a scenario `@wip` and do not change a feature to
|
|
72
|
+
make the run pass.
|
|
73
|
+
|
|
74
|
+
## 5. Report
|
|
75
|
+
|
|
76
|
+
Say, in this order:
|
|
77
|
+
|
|
78
|
+
1. The site, its address (`https://<site>.ddev.site` on DDEV, the address its runtime gives elsewhere) and what was run (suite, feature or tag).
|
|
79
|
+
2. The totals the run printed: scenarios and steps, passed and failed, and the time.
|
|
80
|
+
3. For each failed scenario: the feature and line, the step that failed, the message (it names the
|
|
81
|
+
component's classes, its ARIA and what is drawn), and what it means for the site — a defect of
|
|
82
|
+
the page, a scenario that asserts something the page never did, a page whose own script is missing
|
|
83
|
+
or broken (AdminLTE's script not loaded: a sidebar or a menu that never moves), a 4-only step run on 3.2,
|
|
84
|
+
or the environment (the site was stopped).
|
|
85
|
+
4. Where the report is: `~/workspace/<folder>/<site>/tests/reports/`.
|
|
86
|
+
|
|
87
|
+
A failing suite is a result: report it as it is. Never add a fixed wait, never create an account
|
|
88
|
+
for a scenario, and never write a library or platform name into a step phrase. For writing or
|
|
89
|
+
fixing scenarios, use the `adminlte-scenarios` skill or hand over to the `adminlte-tester` agent;
|
|
90
|
+
for changing the markup of the page, to `adminlte-ui-builder`.
|
|
91
|
+
|
|
92
|
+
Before you write or change a scenario, or read a failed run, read the book *Automated Functional
|
|
93
|
+
Testing Recipes* (its `README.md`, then the matching chapter):
|
|
94
|
+
`.claude/automated-functional-testing-recipes/` in the project,
|
|
95
|
+
`~/.claude/automated-functional-testing-recipes/`, or
|
|
96
|
+
https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Serve the components demo site 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
|
+
Serve the components demo site named <name> 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) · --runtime docker, podman or kubernetes serves it there
|
|
9
|
+
# the builder deletes a project of the same name first: stop if <name> is a site somebody still needs
|
|
10
|
+
# nothing on the host: no node, npm or npx outside the site's container
|
|
11
|
+
# 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
|
|
12
|
+
|
|
13
|
+
1. bash cmd-adminlte-project.sh <name> --install
|
|
14
|
+
(add --adminlte 3.2 to serve the same pages on AdminLTE 3.2, --runtime docker to serve it on Docker Compose)
|
|
15
|
+
2. bash cmd-tools-testing.sh <name>
|
|
16
|
+
webship-js, the step pack, the tags of the version served and tests/features/site.feature
|
|
17
|
+
3. bash cmd-tools-testing.sh <name> --dry-run --path tests/features/site.feature
|
|
18
|
+
4. bash cmd-tools-testing.sh <name> --run --path tests/features/site.feature
|
|
19
|
+
|
|
20
|
+
If a command fails, show the line that failed and stop. Do not retry with other flags.
|
|
21
|
+
When the feature is green: the address, the version served, how many scenarios and steps passed.
|
|
22
|
+
Then ask me whether to keep the site or remove it with: bash cmd-tools-remove.sh <name>
|
|
23
|
+
"""
|
|
24
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Write and run the webship-js scenarios of the components of one site of the workspace.
|
|
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 webship-js scenarios for the components of the site <site> (its <page> page) and run them
|
|
8
|
+
# ~/workspace/<dev|test|sandboxes|demos> · https://<site>.ddev.site · container-based (DDEV by default)
|
|
9
|
+
# components: the sidebar, its tree menu, cards and their tools, a chat, full screen, the color mode (AdminLTE 4), and the Bootstrap components inside
|
|
10
|
+
# nothing on the host: no node, npm or npx outside the site's container
|
|
11
|
+
# before writing: the book Automated Functional Testing Recipes (its README.md, then ch08-modal-dialog-testing.md and ch07-waiting-dynamic-content.md), 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
|
|
12
|
+
|
|
13
|
+
1. bash cmd-tools-testing.sh <site>
|
|
14
|
+
then, unless its cucumber.js already names @webship-js/adminlte-steps:
|
|
15
|
+
bash cmd-tools-testing.sh <site> --add-steps bootstrap
|
|
16
|
+
bash cmd-tools-testing.sh <site> --add-steps adminlte
|
|
17
|
+
2. Open https://<site>.ddev.site<page> in the Playwright MCP browser, in a tab of your own, and open and close every
|
|
18
|
+
component by hand once: note the name a person reads for each (a menu item's label, a card's title, a dialog's title).
|
|
19
|
+
3. Write tests/features/components.feature from the installed phrases only
|
|
20
|
+
(grep -hE "^(Given|When|Then)\(" node_modules/@webship-js/adminlte-steps/tests/step-definitions/*.steps.js):
|
|
21
|
+
no fixed wait, no library or platform name in a step, no account created.
|
|
22
|
+
4. bash cmd-tools-testing.sh <site> --dry-run --path tests/features/components.feature
|
|
23
|
+
5. bash cmd-tools-testing.sh <site> --run --path tests/features/components.feature
|
|
24
|
+
|
|
25
|
+
If a command fails, show the line that failed and stop. A failing scenario is a result: say what the page did.
|
|
26
|
+
When the feature is green: how many scenarios and steps passed, and which components the page has that no scenario covers yet.
|
|
27
|
+
"""
|
|
28
|
+
```
|