Skip to content

Commit f2d3666

Browse files
committed
fix: make expect CI run all steps before failing
Add continue-on-error + final gate step so all test scenarios execute to completion. Upload session recordings as artifacts for debugging.
1 parent e91cdc2 commit f2d3666

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

.github/workflows/test-expect.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ jobs:
4848
run: pnpm dlx wait-on http://localhost:5175 --timeout 30000
4949

5050
- name: Run expect tests
51+
id: expect
52+
continue-on-error: true
5153
env:
5254
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
5355
run: >-
5456
pnpm dlx expect-cli@latest --verbose -y -m
55-
"Test only the element properties panel feature at http://localhost:5175.
57+
"Test the arrow-key navigation and selection label feature at http://localhost:5175.
5658
Do not explore unrelated flows. If a step is blocked after one retry, fail with evidence.
5759
5860
react-grab is a browser overlay tool that lets you inspect React elements.
5961
When active, hovering over elements shows a selection label with the element
60-
tag name and component name.
62+
tag name and component name (e.g. 'h1' or 'MyComponent.div').
6163
6264
Important repo-specific testing notes:
6365
1. This GitHub Actions run is on Linux, so the default activation shortcut is Ctrl+C.
@@ -73,27 +75,32 @@ jobs:
7375
document.querySelector('[data-react-grab]')?.shadowRoot, especially
7476
[data-react-grab-selection-label].
7577
6. After activation, hover an element, click it to select it, then use ArrowUp / ArrowDown
76-
to navigate and verify the panel updates.
77-
78-
What changed in this branch:
79-
The old inspect stack (a list of ancestor elements you could arrow-navigate through)
80-
has been replaced with an element properties panel that appears below the selection
81-
label when you arrow-navigate. This panel shows:
82-
- Size: width x height in pixels.
83-
- CSS Properties: color (with color swatch), background color (with swatch), font size + family, margin, padding, display, flex direction, gap, grid columns, position, overflow.
84-
- className: the elements CSS classes (line-clamped to 3 lines).
85-
- React Props section: props from the nearest React composite fiber (excluding children, key, ref). Values are formatted (strings quoted, functions as fn(), arrays as [length], objects as {count}).
86-
- Accessibility section: accessible name (aria-label / aria-labelledby / alt), role (explicit or implicit), keyboard-focusable indicator (check/X icon).
87-
- Contrast badge: when both foreground color and non-transparent background exist, shows the WCAG contrast ratio with AA/AAA pass/fail badges (green = pass, red = fail).
88-
- Box model overlay: margin regions rendered as semi-transparent overlay around the selection, padding regions rendered inside.
78+
to navigate between elements. ArrowUp moves to a parent/stacked element,
79+
ArrowDown reverses that. ArrowLeft navigates to parent, ArrowRight to child.
80+
7. When arrow navigation is active, an arrow navigation menu appears inside the
81+
selection label showing the list of stacked/ancestor elements. Each item shows
82+
the tag name and optionally the React component name. The active item is fully
83+
opaque while inactive items are dimmed.
84+
85+
IMPORTANT: Run every test scenario to completion. If a step fails, record the failure
86+
with evidence (screenshot or error) but continue testing remaining steps. Do not bail early.
8987
9088
Test scenarios:
91-
1. Activate react-grab with Ctrl+C, hover over the Todo List heading, click to select it, then press ArrowUp to navigate to parent — verify the properties panel appears showing size, font info, and class names.
92-
2. Select a button element (e.g. Submit button in the form section) — navigate with arrows and verify the panel shows the buttons role as button and keyboard-focusable as Yes.
93-
3. Select a text element and check that color swatches appear next to Color and Background values.
94-
4. Select a table cell and verify the accessibility section shows role cell.
95-
5. Select an input element and verify it shows role textbox and is keyboard-focusable.
96-
6. Navigate between elements with arrow keys and verify the panel updates with new element properties each time."
89+
1. Activate react-grab with Ctrl+C, hover over a list item, click to select it — verify the selection label appears showing the element tag name.
90+
2. Press ArrowUp — verify the selection box moves to a parent or stacked element and the selection label updates to show the new element tag name.
91+
3. Press ArrowDown to reverse the ArrowUp navigation — verify the selection returns to the previous element.
92+
4. Press ArrowLeft from a child element — verify navigation moves to the parent element and the selection box grows larger.
93+
5. Press ArrowRight from a container element — verify navigation moves to a child element.
94+
6. Navigate between multiple elements with arrow keys — verify the selection label updates with the correct tag name each time and the overlay remains visible throughout."
95+
96+
- name: Upload session recording
97+
if: always()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: expect-session-recording
101+
path: /tmp/expect-replays/
102+
if-no-files-found: ignore
103+
retention-days: 14
97104

98105
- name: Print expect debug logs
99106
if: always()
@@ -103,3 +110,9 @@ jobs:
103110
else
104111
echo "No .expect/logs.md file found"
105112
fi
113+
114+
- name: Fail if expect tests failed
115+
if: steps.expect.outcome == 'failure'
116+
run: |
117+
echo "::error::expect tests failed — see logs and artifacts above"
118+
exit 1

0 commit comments

Comments
 (0)