Files
OrcaSlicer/tools/mcp/tests/web_dialogs.json
T
SoftFever d64e10f4dd Regroup the slicer's MCP commands and let each run from its arguments
Outside the Design tab an agent had 175 commands, 50 of them in the tool
list. There are now 118, named by what they act on (`object_`, `plate_`,
`preset_`, `filament_`, `plugin_` and so on), and 115 are listed. Each takes
its target and values in the call, acts on the selection when it names no
target and says what it acted on; an old name is refused. Printers and
system filaments install and uninstall, preferences read and write, plugins
enable, reload, uninstall and refresh, and objects reorder, with no dialog
to drive.

The Speed Dial keeps its 129 tiles under the same ids. Eight defects in the
rows these commands share with the menus are fixed. For a person: an object
row that cannot run says why instead of "Select an object first.", rows
that failed no longer claim success, Duplicate Plate can be undone, and
Refresh Plugins picked while a refresh runs now runs after it instead of
beside it.
2026-11-18 16:50:32 +08:00

56 lines
4.1 KiB
JSON

// Orca's own web dialogs driven through the GUI tools alone, as an agent drives any dialog: the preset
// bundle dialog closed by its page's own button; the colour picker a filament swatch's "+ More Colors"
// opens, its hex field set and its spectrum (a canvas that captures the pointer) dragged, and the
// colour it returns read back from the native dialog under it; the setup wizard's first steps (a
// region, Next to the printer page, a printer card). Run it on a fresh datadir set up with the default
// printer:
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/web_dialogs.json --out /tmp/web_dialogs
{
"orca_replay_version": "0.2.0",
"name": "web dialogs through the GUI tools",
"steps": [
{"tool": "app_wait", "args": {"for": "ready"}},
{"tool": "window_set", "args": {"size": [1600, 900]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
// ---- The preset bundle dialog, closed by its page's own button ----
{"tool": "action_run", "args": {"id": "orca_command:preset_bundle:orca"}, "await": false, "save_as": "bundle"},
{"tool": "app_wait", "args": {"for": "dialog", "timeout_s": 10}, "expect": {"/satisfied": {"eq": true}}},
{"tool": "widget_list", "args": {"target": "dialog"}, "expect": {"/nodes": {"gt": 2}}},
{"tool": "widget_click", "args": {"target": {"css": "#close_btn", "within": "Preset Bundle"}}, "expect": {"/closed": {"eq": true}}},
{"tool": "app_wait", "args": {"for": "job", "job": "${jobs.bundle}"}},
{"tool": "app_state", "expect": {"/dialogs": {"empty": true}}},
// ---- The colour picker over the filament picker ----
{"tool": "widget_click", "args": {"target": {"label": "1", "class": "wxBitmapButton"}}, "await": false, "save_as": "swatch"},
{"tool": "app_wait", "args": {"for": "dialog", "timeout_s": 10}, "expect": {"/satisfied": {"eq": true}}},
{"tool": "widget_click", "args": {"target": {"label": "+ More Colors", "within": "Select Filament"}}, "await": false, "save_as": "more"},
{"tool": "widget_set_value", "args": {"target": {"web": "Hex color", "within": "Color Picker"}, "value": "FF0000"},
"expect": {"/value": {"eq": "FF0000FF"}}},
{"tool": "widget_list", "args": {"target": "dialog", "query": "FF0000FF"}, "expect": {"/nodes": {"ge": 1}}},
{"tool": "mouse_gesture", "args": {"target": {"css": "#spectrum", "within": "Color Picker"}, "action": "drag", "x": 20, "y": 20,
"to": [200, 100], "steps": 6},
"expect": {"/done": {"eq": "drag"}}},
{"tool": "widget_list", "args": {"target": "dialog", "query": "FF0000FF"}, "expect": {"/nodes": {"eq": 0}}},
{"tool": "widget_click", "args": {"target": {"web": "OK", "within": "Color Picker"}},
"expect": {"/closed": {"eq": true}, "/dialogs/0/title": {"eq": "Select Filament"}}},
{"tool": "app_wait", "args": {"for": "job", "job": "${jobs.more}"}},
{"tool": "widget_list", "args": {"target": "dialog", "query": "#26A69A"}, "expect": {"/nodes": {"eq": 0}}},
{"tool": "dialog_answer", "args": {"dialog": {"title": "Select Filament"}, "button": "cancel"}},
{"tool": "app_wait", "args": {"for": "job", "job": "${jobs.swatch}"}},
{"tool": "app_state", "expect": {"/dialogs": {"empty": true}}},
// ---- The setup wizard's first steps ----
{"tool": "action_run", "args": {"id": "orca_command:help_setup_wizard:orca"}, "await": false, "save_as": "wizard"},
{"tool": "app_wait", "args": {"for": "dialog", "timeout_s": 30}, "expect": {"/satisfied": {"eq": true}}},
{"tool": "widget_click", "args": {"target": {"web": "Europe", "within": "Setup Wizard"}}, "expect": {"/checked": {"eq": true}}},
{"tool": "widget_click", "args": {"target": {"web": "Next", "within": "Setup Wizard"}},
"expect": {"/navigated": {"eq": true}, "/url": {"contains": "/guide/21/"}}},
{"tool": "widget_click", "args": {"target": {"web": "Nozzle 0.4 Marlin", "kind": "button", "within": "Setup Wizard"}},
"expect": {"/checked": {"eq": true}}},
{"tool": "dialog_answer", "args": {"dialog": {"title": "Setup Wizard"}, "button": "close"}},
{"tool": "app_wait", "args": {"for": "job", "job": "${jobs.wizard}"}},
{"tool": "app_state", "expect": {"/dialogs": {"empty": true}}}
]
}