|
| 1 | +--- |
| 2 | +name: testar-cli |
| 3 | +description: "Use when operating the distributed testar-cli launcher to execute goals through CLI commands, keep one session alive per goal, and drive SUTs step by step." |
| 4 | +--- |
| 5 | + |
| 6 | +# TESTAR CLI |
| 7 | + |
| 8 | +Use this skill for the distributed `testar-cli` runtime that is bundled with TESTAR. |
| 9 | + |
| 10 | +Treat the CLI distribution as an operational environment, not as a source-code workspace. |
| 11 | + |
| 12 | +## When to use |
| 13 | + |
| 14 | +- The user wants a goal executed through the installed `testar-cli` launcher. |
| 15 | +- The task requires step-by-step control of a live Windows, WebDriver, or Android session. |
| 16 | +- The task requires using `getState`, `getStateScreenshot`, and `getDerivedActions` as execution evidence. |
| 17 | + |
| 18 | +## Runtime layout |
| 19 | + |
| 20 | +- Distribution root contains the public launcher. |
| 21 | +- This skill is copied into `.agents/skills/testar-cli/` inside the CLI distribution. |
| 22 | + |
| 23 | +## Public launcher paths |
| 24 | + |
| 25 | +- Windows: `testar-cli.bat` |
| 26 | +- Linux or macOS: `./testar-cli` |
| 27 | + |
| 28 | +## Public commands |
| 29 | + |
| 30 | +- `sessionStatus` |
| 31 | +- `startSession windows <path>` |
| 32 | +- `startSession webdriver <url>` |
| 33 | +- `startSession android <apk>` |
| 34 | +- `getState` |
| 35 | +- `getStateScreenshot` |
| 36 | +- `getDerivedActions` |
| 37 | +- `executeAction click <semanticText>` |
| 38 | +- `executeAction type <semanticText> <inputText>` |
| 39 | +- `executeAction select <semanticText> <value>` |
| 40 | +- `stopSession` |
| 41 | +- `shutdownDaemon` |
| 42 | + |
| 43 | +## Semantic action matching |
| 44 | + |
| 45 | +For `executeAction click`, `executeAction type`, and WebDriver-only `executeAction select`, `<semanticText>` is intended to match the derived action description text. |
| 46 | + |
| 47 | +Use short meaningful text that is likely to appear in the action description, for example: |
| 48 | + |
| 49 | +- `executeAction click Open` |
| 50 | +- `executeAction type input_contact This_is_a_message` |
| 51 | +- `executeAction select select_amount 99999` |
| 52 | + |
| 53 | +## Action availability |
| 54 | + |
| 55 | +- `executeAction click` is available in Windows, WebDriver, and Android sessions. |
| 56 | +- `executeAction type` is available in Windows, WebDriver, and Android sessions. |
| 57 | +- `executeAction select` only makes sense in WebDriver sessions, where HTML select/dropdown elements can expose selectable values. |
| 58 | +- Do not use `executeAction select` in Windows or Android sessions. For Windows or Android dropdowns or combo boxes, inspect `getDerivedActions` and use the available derived `click` or `type` actions instead. |
| 59 | + |
| 60 | +## Workflow |
| 61 | + |
| 62 | +1. Work from the CLI distribution root. |
| 63 | +2. Start one session with the selected platform and target. |
| 64 | +3. Use `getState`, `getStateScreenshot`, and `getDerivedActions` to inspect the live UI. |
| 65 | +4. Execute actions one at a time. |
| 66 | +5. Re-check state for execution evidence. |
| 67 | +6. Stop the session when the goal is finished. |
| 68 | +7. Shutdown the daemon after stopping the session. |
| 69 | + |
| 70 | +## Resilience and retry behavior rules |
| 71 | + |
| 72 | +Some SUTs may need time to start, load screens, populate state information, or expose derived actions after an action is executed. |
| 73 | + |
| 74 | +When `getState`, `getStateScreenshot`, or `getDerivedActions` fails, returns incomplete information, or does not yet reflect the expected UI change: |
| 75 | + |
| 76 | +- Do not assume the goal failed immediately. |
| 77 | +- Retry the same observation command after a short wait. |
| 78 | +- Prefer re-running `getState` before `getDerivedActions` when the UI may still be loading. |
| 79 | +- Retry a small number of times before changing strategy. |
| 80 | +- Keep retries sequential; do not run overlapping commands. |
| 81 | +- Ground decisions in the latest successful command output. |
| 82 | + |
| 83 | +If derived actions are missing or stale, first refresh the state with: |
| 84 | + |
| 85 | +- `getState` |
| 86 | +- `getStateScreenshot` |
| 87 | +- `getDerivedActions` |
| 88 | + |
| 89 | +Only execute an action after the relevant action appears in the latest `getDerivedActions` output. |
| 90 | + |
| 91 | +## Session examples |
| 92 | + |
| 93 | +Windows testing: |
| 94 | + |
| 95 | +- `testar-cli.bat sessionStatus` |
| 96 | +- `testar-cli.bat startSession windows notepad.exe` |
| 97 | +- `testar-cli.bat getState` |
| 98 | +- `testar-cli.bat getStateScreenshot` |
| 99 | +- `testar-cli.bat getDerivedActions` |
| 100 | +- `testar-cli.bat executeAction click Open` |
| 101 | +- `testar-cli.bat executeAction type Editor Writing_text_in_Notepad` |
| 102 | +- `testar-cli.bat stopSession` |
| 103 | +- `testar-cli.bat shutdownDaemon` |
| 104 | + |
| 105 | +WebDriver testing: |
| 106 | + |
| 107 | +- `testar-cli.bat sessionStatus` |
| 108 | +- `testar-cli.bat startSession webdriver https://para.testar.org/` |
| 109 | +- `testar-cli.bat getState` |
| 110 | +- `testar-cli.bat getStateScreenshot` |
| 111 | +- `testar-cli.bat getDerivedActions` |
| 112 | +- `testar-cli.bat executeAction click a_about` |
| 113 | +- `testar-cli.bat executeAction type input_contact This_is_a_message` |
| 114 | +- `testar-cli.bat executeAction select select_amount 99999` |
| 115 | +- `testar-cli.bat stopSession` |
| 116 | +- `testar-cli.bat shutdownDaemon` |
| 117 | + |
| 118 | +Android testing: |
| 119 | + |
| 120 | +- `testar-cli.bat sessionStatus` |
| 121 | +- `testar-cli.bat startSession android ApiDemos-debug.apk` |
| 122 | +- `testar-cli.bat getState` |
| 123 | +- `testar-cli.bat getStateScreenshot` |
| 124 | +- `testar-cli.bat getDerivedActions` |
| 125 | +- `testar-cli.bat executeAction click Graphics` |
| 126 | +- `testar-cli.bat executeAction type username Writing_text_in_Android` |
| 127 | +- `testar-cli.bat stopSession` |
| 128 | +- `testar-cli.bat shutdownDaemon` |
| 129 | + |
| 130 | +## Operational rules |
| 131 | + |
| 132 | +- Use one stable session per goal when possible. |
| 133 | +- Run commands sequentially. |
| 134 | +- Treat `startSession`, `stopSession`, and `shutdownDaemon` as the public lifecycle commands. |
| 135 | +- Prefer observing the live state through CLI commands. |
| 136 | +- Keep evidence grounded in command outputs. |
0 commit comments