greenrun-cli 0.2.12 → 0.2.14
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/package.json
CHANGED
|
@@ -118,9 +118,24 @@ Call this via `browser_run_code`. If `auth_mode` is `none`, skip this step.
|
|
|
118
118
|
|
|
119
119
|
Gather all tests that have scripts (previously scripted + newly generated from Step 3).
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
**0. Clean up** — run `rm -rf /tmp/greenrun-tests` via Bash to clear any stale files from a previous run.
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
**1. Fetch scripts and write test files** — launch one Task agent per scripted test, all in parallel. These are just API calls + file writes so they don't conflict. Also write the Playwright config directly (it's small).
|
|
124
|
+
|
|
125
|
+
For each scripted test, launch in parallel:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Task tool with:
|
|
129
|
+
- subagent_type: "general-purpose"
|
|
130
|
+
- max_turns: 5
|
|
131
|
+
- model: "haiku"
|
|
132
|
+
- prompt: "Fetch the Playwright script for test {test_id} and write it to a file.
|
|
133
|
+
1. Call `get_test(\"{test_id}\")` to fetch the test
|
|
134
|
+
2. Write the `script` field to `/tmp/greenrun-tests/{test_id}.spec.ts` using the Write tool
|
|
135
|
+
3. Return: \"{test_name} | written\""
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
While the agents run, write `/tmp/greenrun-tests/playwright.config.ts` directly:
|
|
124
139
|
|
|
125
140
|
```ts
|
|
126
141
|
import { defineConfig } from '@playwright/test';
|
|
@@ -131,23 +146,24 @@ export default defineConfig({
|
|
|
131
146
|
reporter: [['json', { outputFile: 'results.json' }]],
|
|
132
147
|
use: {
|
|
133
148
|
baseURL: '{base_url}',
|
|
134
|
-
|
|
149
|
+
// include storageState ONLY if auth_mode is not 'none':
|
|
150
|
+
storageState: '/tmp/greenrun-auth-state.json',
|
|
135
151
|
},
|
|
136
152
|
});
|
|
137
153
|
```
|
|
138
154
|
|
|
139
|
-
|
|
155
|
+
Wait for all agents to complete before executing.
|
|
140
156
|
|
|
141
|
-
|
|
157
|
+
**2. Execute** — run via Bash:
|
|
142
158
|
```
|
|
143
159
|
npx playwright test --config /tmp/greenrun-tests/playwright.config.ts
|
|
144
160
|
```
|
|
145
161
|
|
|
146
|
-
|
|
162
|
+
**3. Parse results**: Read `/tmp/greenrun-tests/results.json`. Map each result back to a run ID via the filename: `{test_id}.spec.ts` → test_id → find the matching run_id from the batch.
|
|
147
163
|
|
|
148
|
-
|
|
164
|
+
**4. Report results**: Call `complete_run(run_id, status, result_summary)` for each test. Map Playwright statuses: `passed` → `passed`, `failed`/`timedOut` → `failed`, other → `error`.
|
|
149
165
|
|
|
150
|
-
|
|
166
|
+
**5. Clean up**: Call `browser_close` to reset the MCP browser context.
|
|
151
167
|
|
|
152
168
|
### Step 6: Circuit breaker
|
|
153
169
|
|