Skip to content

Commit cfe4454

Browse files
committed
feat: save SVG screenshots as artifacts on every TUI test flow
1 parent 9c73cee commit cfe4454

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/agent-sops/task-tester.sop.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ For each flow in the test spec:
3535
3. Follow the flow steps: use `tui_action` (preferred — combines send + wait + read in one call) or `tui_wait_for` +
3636
`tui_send_keys` for multi-step interactions
3737
4. Verify each expectation against the screen content
38-
5. On **pass**: record the flow name as passed
39-
6. On **failure**: use `tui_screenshot` to capture the terminal state, record the flow name, expected behavior, actual
40-
behavior, and the screenshot text
38+
5. On **pass**: use `tui_screenshot` with `format: "svg"` and `savePath: "/tmp/tui-screenshots/<flow-name>-pass.svg"` to
39+
capture the final state, then record the flow name as passed
40+
6. On **failure**: use `tui_screenshot` with `format: "svg"` and `savePath: "/tmp/tui-screenshots/<flow-name>-fail.svg"`
41+
to capture the terminal state, also take a text screenshot for the PR comment, record the flow name, expected
42+
behavior, actual behavior, and the screenshot text
4143
7. Always `tui_close` the session when done, even on failure
4244

4345
**Constraints:**
4446

47+
- Create `/tmp/tui-screenshots/` at the start before running any flows
4548
- Use `timeoutMs: 10000` (10 seconds) minimum for all `tui_wait_for` and `tui_action` pattern waits
4649
- Use small terminal dimensions: `cols: 100, rows: 24`
4750
- If a wait times out, retry once before declaring failure

.github/workflows/strands-command.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ jobs:
141141
S3_SESSION_BUCKET: ${{ secrets.AGENT_SESSIONS_BUCKET }}
142142
BRANCH_NAME: ${{ steps.process-inputs.outputs.branch_name }}
143143

144+
- name: Upload TUI screenshots
145+
if: always() && steps.process-inputs.outputs.mode == 'tester'
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: tui-screenshots
149+
path: /tmp/tui-screenshots/
150+
if-no-files-found: ignore
151+
144152
- name: Remove strands-running label
145153
if: always()
146154
uses: actions/github-script@v8

0 commit comments

Comments
 (0)