You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `inspect` output includes `DESCRIBE NAVIGATION Responsive` at the end — use those exact strings in `page.getByRole("menuitem", { name: "..." })`.
@@ -41,17 +42,19 @@ Standard naming convention per widget:
41
42
42
43
```bash
43
44
# Full CI run (Docker):
44
-
pnpm --filter @mendix/<widget> run e2e
45
+
pnpm --filter @mendix/badge-web run e2e# replace with actual widget name
45
46
46
-
# Skip re-downloading the test project:
47
+
# Skip re-downloading the test project (useful when iterating locally):
47
48
pnpm --filter @mendix/<widget> run e2e --no-setup-project
48
49
49
-
# Skip re-downloading and rebuilding:
50
+
# Skip re-downloading and rebuilding (fastest iteration; requires local test project files):
50
51
pnpm --filter @mendix/<widget> run e2e --no-setup-project --no-update-project
51
52
```
52
53
53
54
⚠️ Pass flags directly — do NOT use `pnpm run e2e -- --no-setup-project`. The `--` separator causes yargs-parser to ignore the flags.
54
55
56
+
> Use `--no-setup-project --no-update-project` when you have the test project files locally and want to commit them to the `testProjects` repository after confirming tests pass.
57
+
55
58
## Checklist
56
59
57
60
-[ ] Import from `@mendix/run-e2e/fixtures` — NOT `@playwright/test`
Copy file name to clipboardExpand all lines: .claude/commands/mendix/e2e-workflow.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,34 @@ If no widget name is provided, ask the user which widget they are working on (e.
7
7
## Prerequisites
8
8
9
9
-`automation/tools/mxcli` must exist. If missing, run: `bash automation/mxcli/setup.sh`
10
-
- The `.mpr` test project must be **closed in Studio Pro** before any mxcli edits
10
+
- The `.mpr` test project must be **closed in Studio Pro** before any mxcli edits. Check with:
11
+
```bash
12
+
ls packages/pluggableWidgets/<widget>/tests/testProject/.mendix-cache/lock 2>/dev/null \
13
+
&&echo"⚠️ Studio Pro lock file present — close the project first" \
14
+
||echo"OK — no lock file"
15
+
```
11
16
- Docker must be running for the full CI e2e run
12
17
13
18
---
14
19
15
-
## Phase 1 — Inspect the test project
20
+
## Phase 1 — Download and inspect the test project
21
+
22
+
Download the test project (if not already present):
23
+
24
+
```bash
25
+
pnpm --filter @mendix/<widget> run e2edev --setup-project
26
+
```
27
+
28
+
If this fails with `404 Not Found` / `Cannot find test project in GitHub repository`, the branch does not exist yet in`mendix/testProjects`. In that case:
29
+
30
+
1. Copy an existing chart/widget MPR as a base (e.g. from `column-chart-web/tests/testProject/`).
31
+
2. Place it at `packages/pluggableWidgets/<widget>/tests/testProject/<WidgetName>.mpr`.
32
+
3. Copy the `widgets/`, `deployment/`, `theme/`, and `themesource/` folders from the same source.
33
+
4. Replace the source widget's `.mpk` in `widgets/` with the new widget's built `.mpk` (run `pnpm --filter @mendix/<widget> run release` first).
34
+
5. Adapt the domain model and microflows via mxcli (see `mendix:edit-test-project`).
35
+
6. After Studio Pro has opened the MPR and registered the new widget type, push a new branch `<widget>` to `mendix/testProjects` so CI can download it.
> **Note**: `DESCRIBE PAGE` may show an empty body for pages that only contain pluggable widgets. Use `automation/tools/mxcli bson dump -p <MPR> --type page --object <Module>.<Page>` and grep for widget names to verify content. See `mendix:edit-test-project` for details.
50
+
27
51
**Output**: map of modules, pages, navigation labels, and `.mx-name-*` widget names.
> **`DESCRIBE PAGE` caveat**: pages containing only pluggable widgets (no built-in widgets like `DATAVIEW`, `LAYOUTGRID`, etc.) may render as an empty body even when widget content exists in the MPR. Use `automation/tools/mxcli bson dump -p <MPR> --type page --object <Module>.<Page>` and grep for widget names to verify content was written.
48
+
49
+
> **`SEARCH` quoting**: use single-quoted strings — `SEARCH 'keyword'`, not `SEARCH "keyword"`. Double quotes cause a parse error.
50
+
51
+
> **`SHOW ROLES IN <Module>`** — this MDL statement does not exist. Use `SHOW MODULES` output to see module source; roles are returned inline. To query roles programmatically use the catalog: `SELECT Name FROM CATALOG.USER_ROLES`.
| Preview changes as diff |`mxcli diff -p app.mpr changes.mdl`|
136
152
153
+
## Pluggable widget limitations
154
+
155
+
mxcli can only create pluggable widget instances (`PLUGGABLEWIDGET '...' name (...)`) when the MPR **already contains an existing instance** of that widget type (Studio Pro registers the BSON template the first time the widget is imported). If no instance exists yet, mxcli fails with `template not found: <widgetname>`.
156
+
157
+
**Workaround for a brand-new widget in a new test project:**
158
+
159
+
1. Create the page with **named containers** and placeholder `DYNAMICTEXT` widgets (these are built-in and always work).
160
+
2. Open the `.mpr` in Studio Pro — it will register the widget type from the `.mpk` in `tests/testProject/widgets/`.
161
+
3. Inside each container, replace the placeholder with the actual pluggable widget instance.
162
+
4. After Studio Pro saves, run `automation/tools/mxcli widget init -p <MPR>` to cache the widget definition.
163
+
5. Future `PLUGGABLEWIDGET` statements for that widget will then work via mxcli.
164
+
165
+
**Widget management commands:**
166
+
167
+
```bash
168
+
# Register widget definitions from all .mpk files in the project's widgets/ dir
169
+
automation/tools/mxcli widget init -p <MPR_PATH>
170
+
171
+
# Extract a .def.json skeleton from a specific .mpk (does not bootstrap the BSON template)
The `widget list` output shows the MDL keyword (e.g. `bubblechart`) needed in `PLUGGABLEWIDGET` blocks. The keyword lookup is case-insensitive but the widget ID string is exact.
182
+
137
183
## Warnings
138
184
139
-
-`CREATE OR MODIFY PAGE ... {}` wipes all widget content — never use on existing pages
140
-
- Do NOT run mxcli while Studio Pro has the project open
185
+
- Do NOT run mxcli while Studio Pro has the project open — check for the lock file (Step 2)
141
186
- New pages need `GRANT VIEW ON PAGE` — missing it causes mxbuild exit code 3
142
187
-`automation/tools/mxcli` is gitignored — run `bash automation/mxcli/setup.sh` on first checkout
188
+
-`PLUGGABLEWIDGET` requires an existing instance in the MPR — use named containers as placeholders for brand-new widgets and configure them in Studio Pro first
143
189
- Test project changes may require updating the `testProjects` repo branch for CI — flag this to the user
0 commit comments