greenrun-cli 0.2.12 → 0.2.13
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,22 @@ 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
|
-
1.
|
|
121
|
+
**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).
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
For each scripted test, launch in parallel:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Task tool with:
|
|
127
|
+
- subagent_type: "general-purpose"
|
|
128
|
+
- max_turns: 5
|
|
129
|
+
- model: "haiku"
|
|
130
|
+
- prompt: "Fetch the Playwright script for test {test_id} and write it to a file.
|
|
131
|
+
1. Call `get_test(\"{test_id}\")` to fetch the test
|
|
132
|
+
2. Write the `script` field to `/tmp/greenrun-tests/{test_id}.spec.ts` using the Write tool
|
|
133
|
+
3. Return: \"{test_name} | written\""
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
While the agents run, write `/tmp/greenrun-tests/playwright.config.ts` directly:
|
|
124
137
|
|
|
125
138
|
```ts
|
|
126
139
|
import { defineConfig } from '@playwright/test';
|
|
@@ -131,23 +144,24 @@ export default defineConfig({
|
|
|
131
144
|
reporter: [['json', { outputFile: 'results.json' }]],
|
|
132
145
|
use: {
|
|
133
146
|
baseURL: '{base_url}',
|
|
134
|
-
|
|
147
|
+
// include storageState ONLY if auth_mode is not 'none':
|
|
148
|
+
storageState: '/tmp/greenrun-auth-state.json',
|
|
135
149
|
},
|
|
136
150
|
});
|
|
137
151
|
```
|
|
138
152
|
|
|
139
|
-
|
|
153
|
+
Wait for all agents to complete before executing.
|
|
140
154
|
|
|
141
|
-
|
|
155
|
+
**2. Execute** — run via Bash:
|
|
142
156
|
```
|
|
143
157
|
npx playwright test --config /tmp/greenrun-tests/playwright.config.ts
|
|
144
158
|
```
|
|
145
159
|
|
|
146
|
-
|
|
160
|
+
**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
161
|
|
|
148
|
-
|
|
162
|
+
**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
163
|
|
|
150
|
-
|
|
164
|
+
**5. Clean up**: Call `browser_close` to reset the MCP browser context.
|
|
151
165
|
|
|
152
166
|
### Step 6: Circuit breaker
|
|
153
167
|
|