mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-26 07:11:23 -05:00
A tool, Speed Dial action or CAD tool called through the wrong tool is told where it runs, search_actions ranks a query's words as search_tools does, and every list replies with items. Renamed arguments: set_view's target and view are look_at and canvas, list_widgets' root is target, mouse_gesture's path is waypoints, the presets' changes is preset_changes, set_height_ranges' layer_config_ranges is ranges, and the main window is "main" for screenshot and start_recording. The harness's launch takes --python-scripts to allow Python scripts in the instance it starts.
56 lines
4.1 KiB
JSON
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": 1,
|
|
"name": "web dialogs through the GUI tools",
|
|
"steps": [
|
|
{"tool": "wait", "args": {"for": "ready"}},
|
|
{"tool": "set_window", "args": {"size": [1920, 1200]}},
|
|
{"tool": "set_view", "args": {"tab": "prepare"}},
|
|
|
|
// ---- The preset bundle dialog, closed by its page's own button ----
|
|
{"tool": "run_action", "args": {"id": "orca_command:preset_bundle:orca"}, "await": false, "save_as": "bundle"},
|
|
{"tool": "wait", "args": {"for": "dialog", "timeout_s": 10}, "expect": {"/satisfied": {"eq": true}}},
|
|
{"tool": "list_widgets", "args": {"target": "dialog"}, "expect": {"/nodes": {"gt": 2}}},
|
|
{"tool": "click", "args": {"target": {"css": "#close_btn", "within": "Preset Bundle"}}, "expect": {"/closed": {"eq": true}}},
|
|
{"tool": "wait", "args": {"for": "job", "job": "${jobs.bundle}"}},
|
|
{"tool": "get_app_state", "expect": {"/dialogs": {"empty": true}}},
|
|
|
|
// ---- The colour picker over the filament picker ----
|
|
{"tool": "click", "args": {"target": {"label": "1", "class": "wxBitmapButton"}}, "await": false, "save_as": "swatch"},
|
|
{"tool": "wait", "args": {"for": "dialog", "timeout_s": 10}, "expect": {"/satisfied": {"eq": true}}},
|
|
{"tool": "click", "args": {"target": {"label": "+ More Colors", "within": "Select Filament"}}, "await": false, "save_as": "more"},
|
|
{"tool": "set_widget_value", "args": {"target": {"web": "Hex color", "within": "Color Picker"}, "value": "FF0000"},
|
|
"expect": {"/value": {"eq": "FF0000FF"}}},
|
|
{"tool": "list_widgets", "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": "list_widgets", "args": {"target": "dialog", "query": "FF0000FF"}, "expect": {"/nodes": {"eq": 0}}},
|
|
{"tool": "click", "args": {"target": {"web": "OK", "within": "Color Picker"}},
|
|
"expect": {"/closed": {"eq": true}, "/dialogs/0/title": {"eq": "Select Filament"}}},
|
|
{"tool": "wait", "args": {"for": "job", "job": "${jobs.more}"}},
|
|
{"tool": "list_widgets", "args": {"target": "dialog", "query": "#26A69A"}, "expect": {"/nodes": {"eq": 0}}},
|
|
{"tool": "answer_dialog", "args": {"dialog": {"title": "Select Filament"}, "button": "cancel"}},
|
|
{"tool": "wait", "args": {"for": "job", "job": "${jobs.swatch}"}},
|
|
{"tool": "get_app_state", "expect": {"/dialogs": {"empty": true}}},
|
|
|
|
// ---- The setup wizard's first steps ----
|
|
{"tool": "run_action", "args": {"id": "orca_command:help_setup_wizard:orca"}, "await": false, "save_as": "wizard"},
|
|
{"tool": "wait", "args": {"for": "dialog", "timeout_s": 30}, "expect": {"/satisfied": {"eq": true}}},
|
|
{"tool": "click", "args": {"target": {"web": "Europe", "within": "Setup Wizard"}}, "expect": {"/checked": {"eq": true}}},
|
|
{"tool": "click", "args": {"target": {"web": "Next", "within": "Setup Wizard"}},
|
|
"expect": {"/navigated": {"eq": true}, "/url": {"contains": "/guide/21/"}}},
|
|
{"tool": "click", "args": {"target": {"web": "Nozzle 0.4 Marlin", "kind": "button", "within": "Setup Wizard"}},
|
|
"expect": {"/checked": {"eq": true}}},
|
|
{"tool": "answer_dialog", "args": {"dialog": {"title": "Setup Wizard"}, "button": "close"}},
|
|
{"tool": "wait", "args": {"for": "job", "job": "${jobs.wizard}"}},
|
|
{"tool": "get_app_state", "expect": {"/dialogs": {"empty": true}}}
|
|
]
|
|
}
|