CMS QA Testing Skill
Executes structured QA test cases against a running dart_desk app via Marionette MCP.
Prerequisites
- Dart Desk app running in debug mode with the mock data source and test document types
- Marionette MCP server connected to the app's VM service URI
- The app should be on the studio screen with at least one document type visible in the sidebar
Invocation
User says one of:
- "run the CMS test suite" -> run all test files 01-10
- "run test 04" or "run field types basic" -> run a specific test file
- "re-discover test 02" -> force re-run discovery even if replay exists
Execution Flow
Phase 1: Discovery Run
For each test file to execute:
- Read the test file from
packages/dart_desk/test_automation/tests/
- Check if a replay file exists in
packages/dart_desk/test_automation/replays/ and is newer than the test file. If so, use Phase 2 instead.
- For each test case in the file:
a. Log the test case ID and title
b. Execute each step using marionette tools:
tap for button/element interactions
enter_text for text input
scroll_to for scrolling to elements
c. After each action, call get_interactive_elements to verify expected state
d. Compare actual elements against the Expected section
e. Take a screenshot and save to results/screenshots/{test_case_id}.png
f. Record PASS if all expectations met, FAIL with notes if not
g. Record the marionette commands (tap, enter_text, scroll_to only -- NOT get_interactive_elements or take_screenshots) into the replay action list
- After all test cases in a file pass, write the replay JSON to
replays/{test_file_name}.json
- Reset app state by calling
mcp__dart__hot_restart (requires DTD connection)
- Wait 3 seconds after hot restart for the app to stabilize, then reconnect marionette
Phase 2: Replay Run
- Read the replay JSON from
packages/dart_desk/test_automation/replays/{test_file_name}.json
- For each test case:
a. Execute the stored
actions sequentially (tap, enter_text, scroll_to)
b. At each verify checkpoint, call get_interactive_elements and check expect_text
c. Take a screenshot at each verify point
d. Record PASS/FAIL
- If any verification fails, mark as FAIL and suggest re-running discovery
Replay JSON Format
{
"test_file": "02_document_crud.md",
"recorded": "2026-03-16T10:30:00",
"test_cases": [
{
"id": "TC-02-01",
"title": "Create a new document",
"actions": [
{"action": "tap", "params": {"text": "+"}}
],
"verify": [
{"action": "get_interactive_elements", "expect_text": ["My Test Document"]}
]
}
]
}
Results Report
After all test files complete, write a markdown report to results/reports/YYYY-MM-DD-HHmm.md:
# CMS QA Test Report - {date}
## Summary
- **Total:** X test cases
- **Passed:** Y
- **Failed:** Z
- **Skipped:** W
## Results
### 01 - Sidebar Navigation
| ID | Title | Result | Notes |
|---|---|---|---|
| TC-01-01 | Select document type | PASS | |
| TC-01-02 | Selection indicator | PASS | |
### 02 - Document CRUD
...
Interaction Rules
- Always use
get_interactive_elements after every action to verify state
- Use
text parameter for tapping -- never coordinates
- Take screenshots only at verification checkpoints, not after every action
- If an element cannot be found by text, check if it has a
Key and use that
- If neither text nor key works, report the element as untestable and SKIP the test case
1---2name: cms-qa-testing3description: Comprehensive QA automation for dart_desk using Marionette MCP. Run test suites or individual test files against a running Flutter app.4---5
6# CMS QA Testing Skill
7
8Executes structured QA test cases against a running dart_desk app via Marionette MCP.
9
10## Prerequisites
11
12- Dart Desk app running in debug mode with the mock data source and test document types
13- Marionette MCP server connected to the app's VM service URI
14- The app should be on the studio screen with at least one document type visible in the sidebar
15
16## Invocation
17
18User says one of:
19- "run the CMS test suite" -> run all test files 01-10
20- "run test 04" or "run field types basic" -> run a specific test file
21- "re-discover test 02" -> force re-run discovery even if replay exists
22
23## Execution Flow
24
25### Phase 1: Discovery Run
26
27For each test file to execute:
28
291. **Read** the test file from `packages/dart_desk/test_automation/tests/`
302. **Check** if a replay file exists in `packages/dart_desk/test_automation/replays/` and is newer than the test file. If so, use Phase 2 instead.
313. **For each test case in the file:**
32 a. Log the test case ID and title
33 b. Execute each step using marionette tools:
34 - `tap` for button/element interactions
35 - `enter_text` for text input
36 - `scroll_to` for scrolling to elements
37 c. After each action, call `get_interactive_elements` to verify expected state
38 d. Compare actual elements against the **Expected** section
39 e. Take a screenshot and save to `results/screenshots/{test_case_id}.png`
40 f. Record PASS if all expectations met, FAIL with notes if not
41 g. Record the marionette commands (tap, enter_text, scroll_to only -- NOT get_interactive_elements or take_screenshots) into the replay action list
424. **After all test cases in a file pass**, write the replay JSON to `replays/{test_file_name}.json`
435. **Reset app state** by calling `mcp__dart__hot_restart` (requires DTD connection)
446. **Wait** 3 seconds after hot restart for the app to stabilize, then reconnect marionette
45
46### Phase 2: Replay Run
47
481. **Read** the replay JSON from `packages/dart_desk/test_automation/replays/{test_file_name}.json`
492. **For each test case:**
50 a. Execute the stored `actions` sequentially (tap, enter_text, scroll_to)
51 b. At each `verify` checkpoint, call `get_interactive_elements` and check `expect_text`
52 c. Take a screenshot at each verify point
53 d. Record PASS/FAIL
543. If any verification fails, mark as FAIL and suggest re-running discovery
55
56### Replay JSON Format
57
58```json
59{
60 "test_file": "02_document_crud.md",
61 "recorded": "2026-03-16T10:30:00",
62 "test_cases": [
63 {
64 "id": "TC-02-01",
65 "title": "Create a new document",
66 "actions": [
67 {"action": "tap", "params": {"text": "+"}}
68 ],
69 "verify": [
70 {"action": "get_interactive_elements", "expect_text": ["My Test Document"]}
71 ]
72 }
73 ]
74}
75```
76
77### Results Report
78
79After all test files complete, write a markdown report to `results/reports/YYYY-MM-DD-HHmm.md`:
80
81```markdown
82# CMS QA Test Report - {date}
83
84## Summary
85- **Total:** X test cases
86- **Passed:** Y
87- **Failed:** Z
88- **Skipped:** W
89
90## Results
91
92### 01 - Sidebar Navigation
93| ID | Title | Result | Notes |
94|---|---|---|---|
95| TC-01-01 | Select document type | PASS | |
96| TC-01-02 | Selection indicator | PASS | |
97
98### 02 - Document CRUD
99...
100```
101
102## Interaction Rules
103
104- **Always use `get_interactive_elements` after every action** to verify state
105- **Use `text` parameter for tapping** -- never coordinates
106- **Take screenshots** only at verification checkpoints, not after every action
107- If an element cannot be found by text, check if it has a `Key` and use that
108- If neither text nor key works, report the element as untestable and SKIP the test case