SWTBot Probe Scripts
Use this skill to create or update JSON probes for com.microsoft.copilot.eclipse.swtbot.test.
Probes drive the workbench through SWTBot actions and run as Tycho tests; no Java is compiled per test case.
Quick start
Create one focused JSON script at
com.microsoft.copilot.eclipse.swtbot.test/probe-scripts/<plan-slug>-<tc-id>.json.
Start by settling the workbench and opening the view under test:
[
{ "action": "waitForIdle" },
{ "action": "screenshot", "id": "01-startup" },
{ "action": "showView", "idRef": "com.microsoft.copilot.eclipse.ui.chat.ChatView" },
{ "action": "waitForIdle" },
{ "action": "screenshot", "id": "02-chat-open" }
]
Add user-level steps only, such as click, typeIn, clearElement, pressKey,
invokeCommand, waitFor, waitForMethod, assertExists, screenshot, or
dumpUi. Prefer widgetId locators for widgets the plugin owns.
Run from the repository root:
./mvnw clean verify -Dprobe.script=probe-scripts/<name>.json
Use root clean verify as the default. Tycho can reuse stale bundle jars
when only the SWTBot module is run, making source edits appear ignored. Use
xvfb-run -a on Linux headless.
Read com.microsoft.copilot.eclipse.swtbot.test/target/probe-results/results.json,
workspace.log, screenshots/, and ui-dumps/.
If -Dprobe.script is unset, ProbeRunner skips itself so ordinary ./mvnw verify runs are unaffected.
Authoring workflow
- Convert one scenario/test case into one probe. Split unrelated behaviors so each failure screenshot has one meaning.
- Drive the UI the way a user does.
invokeCommand is allowed for registered Eclipse command IDs; do not call
OSGi services, private methods, or test-only shortcuts.
- Pair screenshots with machine-checked assertions. Screenshots never fail a step;
assertExists, waitFor, and
waitForMethod decide pass/fail.
- Wait for asynchronous UI state before acting. For chat, wait for the
model-picker selected model before Send,
then wait for user-turn and model-info-label.
- When a locator fails, insert
dumpUi before the failure and inspect ui-dumps/*.xml for widget class names and
SWTBot widget IDs.
- For unauthenticated chat probes, assert the "Sign in to GitHub" UI. Do not poll internal auth managers.
Chat send skeleton
[
{ "action": "waitForIdle" },
{ "action": "showView", "idRef": "com.microsoft.copilot.eclipse.ui.chat.ChatView" },
{ "action": "waitFor", "locator": { "by": "styledText" }, "timeoutSec": 30 },
{ "action": "clearElement", "locator": { "by": "styledText" } },
{ "action": "typeIn", "locator": { "by": "styledText" }, "text": "hello" },
{ "action": "waitForMethod", "locator": { "by": "widgetId", "value": "model-picker" },
"method": "getSelectedItemId", "timeoutSec": 60 },
{ "action": "click", "locator": { "by": "buttonWithTooltip", "tooltip": "Send" } },
{ "action": "waitFor", "locator": { "by": "widgetId", "value": "user-turn" }, "timeoutSec": 30 },
{ "action": "waitFor", "locator": { "by": "cssClass", "value": "model-info-label" }, "timeoutSec": 120 },
{ "action": "assertExists", "locator": { "by": "widgetId", "value": "copilot-turn" } },
{ "action": "screenshot", "id": "agent-response" }
]
Pass/fail judgment
A probe passes only when Maven exits 0 and results.json has "failed": 0.
On failure, inspect the failed step message, FAILED-stepNN-*.png, nearest ui-dumps/*.xml, and workspace.log.
Extending probes
The vocabulary lives in com.microsoft.copilot.eclipse.swtbot.test/src/.../probe/.
Add UI-level primitives in ProbeStep, Locator, and StepExecutor, then update REFERENCE.md.
See REFERENCE.md for action/locator tables, platform notes, result queries, troubleshooting, and current stable widget IDs.
Source: microsoft/copilot-for-eclipse — distributed by TomeVault.
1---2name: ui-action3description: Authors and validates SWTBot JSON probe scripts for GitHub Copilot for Eclipse UI flows against a real Eclipse workbench. Use when creating or updating probe-scripts, converting test plans to UI probes, validating end-to-end Eclipse UI behavior, or troubleshooting ProbeRunner failures. Use when this capability is needed.4---56# SWTBot Probe Scripts78Use this skill to create or update JSON probes for `com.microsoft.copilot.eclipse.swtbot.test`.9Probes drive the workbench through SWTBot actions and run as Tycho tests; no Java is compiled per test case.1011## Quick start12131. Create one focused JSON script at14 `com.microsoft.copilot.eclipse.swtbot.test/probe-scripts/<plan-slug>-<tc-id>.json`.152. Start by settling the workbench and opening the view under test:1617 ```json18 [19 { "action": "waitForIdle" },20 { "action": "screenshot", "id": "01-startup" },21 { "action": "showView", "idRef": "com.microsoft.copilot.eclipse.ui.chat.ChatView" },22 { "action": "waitForIdle" },23 { "action": "screenshot", "id": "02-chat-open" }24 ]25 ```26273. Add user-level steps only, such as `click`, `typeIn`, `clearElement`, `pressKey`,28 `invokeCommand`, `waitFor`, `waitForMethod`, `assertExists`, `screenshot`, or29 `dumpUi`. Prefer `widgetId` locators for widgets the plugin owns.304. Run from the repository root:3132 ```bash33 ./mvnw clean verify -Dprobe.script=probe-scripts/<name>.json34 ```3536 Use root `clean verify` as the default. Tycho can reuse stale bundle jars37 when only the SWTBot module is run, making source edits appear ignored. Use38 `xvfb-run -a` on Linux headless.395. Read `com.microsoft.copilot.eclipse.swtbot.test/target/probe-results/results.json`,40 `workspace.log`, `screenshots/`, and `ui-dumps/`.4142If `-Dprobe.script` is unset, `ProbeRunner` skips itself so ordinary `./mvnw verify` runs are unaffected.4344## Authoring workflow4546- Convert one scenario/test case into one probe. Split unrelated behaviors so each failure screenshot has one meaning.47- Drive the UI the way a user does. `invokeCommand` is allowed for registered Eclipse command IDs; do not call48 OSGi services, private methods, or test-only shortcuts.49- Pair screenshots with machine-checked assertions. Screenshots never fail a step; `assertExists`, `waitFor`, and50 `waitForMethod` decide pass/fail.51- Wait for asynchronous UI state before acting. For chat, wait for the `model-picker` selected model before Send,52 then wait for `user-turn` and `model-info-label`.53- When a locator fails, insert `dumpUi` before the failure and inspect `ui-dumps/*.xml` for widget class names and54 SWTBot widget IDs.55- For unauthenticated chat probes, assert the "Sign in to GitHub" UI. Do not poll internal auth managers.5657## Chat send skeleton5859```json60[61 { "action": "waitForIdle" },62 { "action": "showView", "idRef": "com.microsoft.copilot.eclipse.ui.chat.ChatView" },63 { "action": "waitFor", "locator": { "by": "styledText" }, "timeoutSec": 30 },64 { "action": "clearElement", "locator": { "by": "styledText" } },65 { "action": "typeIn", "locator": { "by": "styledText" }, "text": "hello" },66 { "action": "waitForMethod", "locator": { "by": "widgetId", "value": "model-picker" },67 "method": "getSelectedItemId", "timeoutSec": 60 },68 { "action": "click", "locator": { "by": "buttonWithTooltip", "tooltip": "Send" } },69 { "action": "waitFor", "locator": { "by": "widgetId", "value": "user-turn" }, "timeoutSec": 30 },70 { "action": "waitFor", "locator": { "by": "cssClass", "value": "model-info-label" }, "timeoutSec": 120 },71 { "action": "assertExists", "locator": { "by": "widgetId", "value": "copilot-turn" } },72 { "action": "screenshot", "id": "agent-response" }73]74```7576## Pass/fail judgment7778A probe passes only when Maven exits `0` and `results.json` has `"failed": 0`.79On failure, inspect the failed step message, `FAILED-stepNN-*.png`, nearest `ui-dumps/*.xml`, and `workspace.log`.8081## Extending probes8283The vocabulary lives in `com.microsoft.copilot.eclipse.swtbot.test/src/.../probe/`.84Add UI-level primitives in `ProbeStep`, `Locator`, and `StepExecutor`, then update [REFERENCE.md](REFERENCE.md).8586See [REFERENCE.md](REFERENCE.md) for action/locator tables, platform notes, result queries, troubleshooting, and current stable widget IDs.8788---89> Source: [microsoft/copilot-for-eclipse](https://github.com/microsoft/copilot-for-eclipse) — distributed by [TomeVault](https://tomevault.io).90<!-- tomevault:4.0:skill_md:2026-06-30 -->