| name | harmony-ui-test |
| description | Installs HAP and runs on-device or Instrument UI tests (ohosTest, UiTest) per the project manifest. Use when hdc is up and the autofix loop reaches device-dependent tests, or when debugging failed ohosTest cases. |
harmony-ui-test
Scope: entry/src/ohosTest/** and on-device/Instrument tasks. Includes device-dependent cases not run in the no-device unit step.
Before running
- Emulator or device must be available (
harmony-emulator-manage succeeded or skipped with a target).
- Read
.cursor/ohos-dev-commands.md section UI / on-device (Instrument).
- Build artifacts: install the debug
.hap path your build produced (manifest may add exact path pattern).
- Apply
safe-command-policy.
Run
hdc install then run the manifest’s on-device / ohosTest / UiTest command (for example, an aa test invocation on device/emulator), as recorded for the team’s DevEco version.
On failure
harmony-log-analyzer, then test-failure-classifier: expect ui or env-infra (or unit-like if a non-UI instrument test failed—still use classifier consistently).
Notes
- Exact Hvigor task names change between SDKs—the manifest owns the string; this skill enforces when to run, not a hard-coded flag table.