UI Test Verify
Purpose
Prove whether an explored UI flow actually succeeded using deterministic checks and safe fallback.
Operating Rules
- Use Playwright as verifier, not just recorder.
- Prefer role, label, placeholder with scope, stable attributes, row-scoped locators, visible dialog scope, URL, selected state, and API evidence.
- Mark weak locators:
nth(), rc_select_*, dynamic ID, long CSS, absolute XPath, global duplicate text, coordinate click, and fixed sleep.
- Every UI-changing action needs a postcondition.
- Fallback must preserve original failure and mark degraded execution.
- Formal regression is one Python pytest-playwright implementation per Source Case. Do not create a parallel TypeScript implementation.
- Generate a thin test that references versioned Flow/Page/Component/action bindings. Never copy page locators into each case.
- Every formal test gets a fresh BrowserContext and executes the complete setup Flow even when Midscene used a direct module route.
- Require an
in_sync active release and write evidence only to the Path Planner run namespace.
Workflow
- Read exploration output and evidence.
- Convert successful exploration stages into deterministic Playwright functions.
- Replace weak locators with scoped semantic or stable locators where possible.
- Add verification after input, select, click, modal open, navigation, submit, and result display.
- If Midscene failed, apply bounded fallback and record cause.
- Output
next_action: evidence or next_action: review.
Validation
- Each action has a concrete verifier.
- Dynamic selectors have a fallback strategy.
- Fixed waits are replaced by condition-based waits where possible.
- The script can be run by Codex and by a tester in PyCharm when packaged for Python.
Read the locator policy before promoting generated automation.
Safety
Verification cannot create new write authority. Require a current-run R2 approval before any visible UI submit, and block production, API business creation, second submit, and assertion weakening.
1---2name: ui-test-verify3description: Convert UI exploration results into deterministic Playwright verification and bounded fallback. Use when validating Midscene output, hardening recorded Playwright scripts, replacing weak locators, checking assertions, or deciding whether a UI flow can become a stable regression script.4---56# UI Test Verify78## Purpose910Prove whether an explored UI flow actually succeeded using deterministic checks and safe fallback.1112## Operating Rules1314- Use Playwright as verifier, not just recorder.15- Prefer role, label, placeholder with scope, stable attributes, row-scoped locators, visible dialog scope, URL, selected state, and API evidence.16- Mark weak locators: `nth()`, `rc_select_*`, dynamic ID, long CSS, absolute XPath, global duplicate text, coordinate click, and fixed sleep.17- Every UI-changing action needs a postcondition.18- Fallback must preserve original failure and mark degraded execution.19- Formal regression is one Python pytest-playwright implementation per Source Case. Do not create a parallel TypeScript implementation.20- Generate a thin test that references versioned Flow/Page/Component/action bindings. Never copy page locators into each case.21- Every formal test gets a fresh BrowserContext and executes the complete setup Flow even when Midscene used a direct module route.22- Require an `in_sync` active release and write evidence only to the Path Planner run namespace.2324## Workflow25261. Read exploration output and evidence.272. Convert successful exploration stages into deterministic Playwright functions.283. Replace weak locators with scoped semantic or stable locators where possible.294. Add verification after input, select, click, modal open, navigation, submit, and result display.305. If Midscene failed, apply bounded fallback and record cause.316. Output `next_action: evidence` or `next_action: review`.3233## Validation3435- Each action has a concrete verifier.36- Dynamic selectors have a fallback strategy.37- Fixed waits are replaced by condition-based waits where possible.38- The script can be run by Codex and by a tester in PyCharm when packaged for Python.3940Read [the locator policy](references/locator-policy.md) before promoting generated automation.4142## Safety4344Verification cannot create new write authority. Require a current-run R2 approval before any visible UI submit, and block production, API business creation, second submit, and assertion weakening.