* Run the MCP sweep on GNOME Shell and fix its Linux failures On a GNOME machine without KWin, orca_mcp.py launch --headless and the sweep now start a private GNOME Shell, so the tests run on the GPU instead of falling back to Xvfb. Picking an item far down a long ImGui list, such as a font near the end of the Text tool's list, no longer fails as out of view, and an item only half shown is scrolled into view before it is clicked. window_set restores a minimized window under GNOME Shell on X11, and the sweep's checks no longer depend on a desktop's top bar or on the fonts installed. * Fix the window_set note unit test failing on every platform
54 KiB
Windows, views, printers and web pages
The design of this area's sweep tests. The rules every entry follows and the grades are in TESTS.md.
Two facts about the shared app and data folder decide several entries here, both measured on Windows:
- The main window's place carries over within an app's run, and no further.
start()gives the main window the baseline's 1600×900, normal, and leaves it where the test before moved it, so a test that needs a place sets it. The app writeswindow_mainframeonly when its main window closes, and the runner's stop ends the app without closing it, so a new launch on a job's folder opens the window where the seed put it: 1600×900 at the top left of the work area, trimmed to it. Afterwindow_setto 1300×820 at [100, 50] and a stop, the conf still read0; 0; 1600; 900; 0. No test on a shared folder closes the main window. Neither the Plugins window nor Preferences stores a size or a place. - A capture without
save_pathstays in the folder.window_screenshotwith nosave_pathsaves its PNG under<datadir>/automation/out. Areplay_runwith noout_dirwrites outside it, to areplay-<time>folder inorca_action_replayin the temporary folder.
test_printers
test_printers.py · Python
Tests: Printers other than the default one, in four parts on the job's app, each from start() on its printer.
On the Bambu Lab X1 Carbon 0.4 nozzle, printer_status, print_pause, print_resume and print_stop with no
printer connected: the test reads printer_status first and calls a job command only when it says no printer is
connected. On the Bambu Lab H2D 0.4 nozzle (two extruders) it checks four things. settings_set validates a whole
call before any variant switch or flow-type pick. A variant switch asks about unsaved printer changes unless
reset_all is given. A plate's filament_map_mode and filament_map round-trip through plate_set_settings and
plate_get_settings. The second extruder's nozzle_volume_type can be set. On the A1 mini, a flow type that its 0.2
nozzle preset doesn't offer is refused. On the Eryone ER20, extruders_count 2 gives two extruders. The H2D, the A1
mini and the ER20 are the subject, not a default: their extruders, nozzle variants and nozzle cards are what the
checks read. The X1 Carbon is chosen for what the folder may keep, not for a behaviour of its own (see Starts
from).
The refusals of settings_set on a printer each stand for one check of Tools/PresetTools.cpp, all made before
anything changes:
| Case | Code path |
|---|---|
nozzle_volume_type with a printable_height that does not parse (H2D) |
the strict parse of every value, after the nozzle cards' checks (parse_values() in settings_set): "Invalid value for printable_height" |
nozzle_diameter 0.6 with printable_height 300 (H2D) |
nozzle_picks()'s variant switch with another key: "Set printable_height in a second call" |
nozzle_diameter 0.2 with High Flow on extruder 2 (H2D) |
nozzle_picks()'s flow type against the card of the preset the switch selects, which offers others (Sidebar::nozzle_volume_types(target->config, e)) |
nozzle_diameter 0.2 with High Flow (A1 mini) |
the same check where that card offers none: "no nozzle flow type to pick" |
| TPU High Flow on extruder 1, no switch (H2D) | the same check against the card the sidebar shows (sidebar().nozzle_volume_types(e)) |
extruders_count 3 (H2D) |
extruders_count_value()'s refusal while single extruder multi-material is on |
A nozzle_diameter 0.6 beside a printable_height that does not parse is not a case of its own: nozzle_picks()
refuses it as another key beside a variant switch before any value is parsed, so the printable_height 300 case
covers it.
Starts from: start(client, printer=X1C) for the job commands, which installs the X1 Carbon on the first test of
a job that needs it. The X1 Carbon is chosen for what the folder may keep: on the Klipper printer, a machine of the
Orca printer agent an earlier test stored is selected at the start when it is the agent's only one, and
printer_status then reads it connected (measured with one machine of those test_send_gcode leaves). The Bambu
printer agent selects only a Bambu Lab printer bound to the folder, and the folder has none: it is signed out
(use_encrypted_token_file, and no test signs in), the Bambu network plugin is not installed, and no test binds a
printer. Measured on the X1 Carbon with that Orca machine stored, and in the app test_send_gcode had just run in,
its two machines stored: {"connected": false}. The guard stays, since a person's own folder may hold a bound
printer.
The H2D part starts from start() on Bambu Lab H2D 0.4 nozzle, 0.20mm Standard @BBL H2D and two slots of
Bambu PLA Basic @BBL H2D, two filaments for two extruders; the ER20 part from start() on Eryone ER20 0.4 nozzle, 0.20mm Standard @Eryone ER20 and Generic PLA @System. checks.PRINTERS does not list these two, so the
test installs each first, after project_new, with printer_install ({vendor: "BBL", model: "Bambu Lab H2D", nozzles: ["0.4"]}, {vendor: "Eryone", model: "Eryone ER20", nozzles: ["0.4"]}) when preset_list does not list
it installed. The conf remembers each printer preset's nozzle flow types (nozzle_volume_types), which a variant
switch restores, and the test leaves High Flow on the H2D's second extruder, so before its checks it sets
Standard,Standard on the 0.6 nozzle preset and then on the 0.4 (settings_set {nozzle_diameter, nozzle_volume_type}) and checks the printer and flow types are Bambu Lab H2D 0.4 nozzle and Standard,Standard.
Measured: a second run on one folder without this started from Standard,High Flow. The A1 mini is selected by
preset_select, discarding changes: the BBL vendor's presets are loaded, so it needs no install.
Leaves: The X1 Carbon, the H2D 0.4 and the ER20 0.4 installed: the BBL and Eryone vendors' profiles, the
H2D's default filaments that printer_install installs with it, and each printer's presets remembered in the conf.
The ER20 is selected, with one extruder. The conf's nozzle_volume_types holds Standard,High Flow for the H2D
0.4 and 0.6 nozzle presets. The A1 mini was selected once and is not installed: preset_select adds it to no model
list. An empty project. The next test's start() selects its own printer. Nothing is sent, and no printer is bound.
Decides by: Exits 1 when a check prints FAIL or on an uncaught exception, which fails its part's scenario and lets the next part run.
- Job commands (X1 Carbon):
start()returns{printer: X1C, process: X1C_STD, filaments: [BAMBU_PLA]}. The guard:printer_statusreplies exactly{"connected": false}. Otherwise the check "no printer is connected" fails with the printer'snameandmodelfrom the reply, and the part ends there, having called no job command.print_pause,print_resumeandprint_stopare each refusedno_printer_connected, asserted withchecks.py'srefused; after each,printer_statusreplies exactly{"connected": false}again anddialogs()is empty. - Start (H2D):
start()returns the H2D's presets as written above, and the printer and flow types read("Bambu Lab H2D 0.4 nozzle", "Standard,Standard"). - Validation before change (H2D): the three refusals of the table hold their words, the flow type's naming
"extruder 2 with the printer preset Bambu Lab H2D 0.2 nozzle" and "not High Flow". After each, the printer and flow
types are still
("Bambu Lab H2D 0.4 nozzle", "Standard,Standard"). - Variant switch (H2D): the switch with High Flow on extruder 2 replies
applied{"nozzle_diameter": "0.6,0.6", "nozzle_volume_type": "Standard,High Flow"}and reads("Bambu Lab H2D 0.6 nozzle", "Standard,High Flow"); back on 0.4 withStandard,Standardit reads the start again. With unsaved changes, the reply'sstatusmust beblocked_by_dialog. After Discard, or withreset_all(then nostatus), the 0.6 preset is selected, no dialog is open andpreset_listmarks nothingmodified. - Plate grouping (H2D):
filament_map_modestarts asAuto For Flush, withManualamong the options offered.applied, the read-backvalueandeffectiveall equalManual, then[2, 1].[1, 3]is refused naming "extruder 3", and the map stays[2, 1].- Setting the mode to null reads it back as
None.
- Flow types and counts (H2D):
nozzle_volume_typehas thevariantsextruder 1andextruder 2and the valueStandard,Standard. Setting index 1 givesStandard,High Flowin the reply'sappliedand on read-back.TPU High Flowon extruder 1 is refused naming "extruder 1 offers" and "not TPU High Flow", andextruders_count3 naming "single extruder multimaterial". - A1 mini: the printer and flow type read
("Bambu Lab A1 mini 0.4 nozzle", "Standard")before and after a switch to 0.2 with a flow type, which is refused naming "extruder 1" and "no nozzle flow type to pick". - ER20:
start()returns its presets as written above.nozzle_diameteris0.4before,0.4,0.4with the twovariantsafter, and0.4again afterreset_all.appliedequals{"extruders_count": 2}.
Not checked:
- A connected printer: what each job command publishes, refusals by the printer's state, resume where the printer
allows it only at the printer, and the status fields are unit cases against the printer agent double
(
tests/slic3rutils/test_device_manager_integration.cpp). No test reaches a physical printer: a real printer's status and refusals, and a print paused, resumed and stopped, are the maintainer's to check. - The machine a Klipper printer's print host makes, which
printer_statusreads as connected: a job command there would go to the host. - "Nothing changed" after a refusal is judged by the printer preset's name and the flow types only.
- The unsaved-changes dialog is answered with Discard without checking which dialog it is. The
printable_heightof 300 that made the change is never read back. - On the ER20, only
nozzle_diameteris read back; no other per-extruder key is. - Clean-up calls have no check of their own: the 0.4 restore at the end of the unsaved-changes steps, and the H2D's
reset_all, which leaves the flow types: they are the sidebar's picks, remembered per printer preset, not changes of the preset.
Strength: Strong — preset names, values and refusal texts are checked exactly, and each refusal is checked to leave the state as it was; the job commands are checked with no printer connected only, since no test reaches a printer.
test_project_open_settings
test_project_open_settings.py · Python
Tests: The test launches its own instance on a new data folder whose Preferences say to load a project's
geometry only (project_load_behaviour = load_geometry_only). It checks that opening a saved project still loads
the process settings saved with it (layer_height 0.28), and that the preference stays as it was. It runs on the
default printer, the Generic Klipper Printer 0.4 nozzle: nothing in it is a Bambu Lab printer's own.
Starts from: A new data folder of its own, seeded by seed_datadir() with the default printer (MyKlipper 0.4 nozzle, 0.20mm Standard @MyKlipper, Generic PLA @System), with project_load_behaviour written into the seeded
conf before the launch, as Preferences > Load behavior writes it. The test reads both back before its first step:
app_state.presets and preferences_get. No other test's state reaches the folder.
Leaves: Nothing: the folder, with the saved layer_height.3mf in it, is deleted at the end unless --datadir
names it.
Decides by: Exits 1 when a check prints FAIL, when its own launch fails, or on an uncaught exception.
- Start:
app_state.presetsis{printer: "MyKlipper 0.4 nozzle", process: "0.20mm Standard @MyKlipper", filaments: ["Generic PLA @System"]}. - Preference:
preferences_getreadsproject_load_behaviour=load_geometry_only, both before and after the open. - Layer height: the process
layer_heightfromsettings_getis checked three times. It is 0.28 aftersettings_set, 0.2 afterproject_newdrops the presets' changes (the layer height of0.20mm Standard @MyKlipper), and 0.28 again afterproject_open. - Open: the
namesinproject_open's reply has exactly one entry.
Not checked:
- Only
layer_heightis checked. No other process, filament or printer setting saved in the project is read, and nothing checks whether the process preset shows as modified after the open. - The object's name isn't checked. Nor is whether the open asked anything: a job envelope would fail only because
its
namesis missing. project_save's reply isn't checked; the later open implies the file was written.
Strength: Strong — the round-tripped layer height, the preset's own layer height and the unchanged preference are checked exactly, though only one setting is covered.
test_sidebar_floating
test_sidebar_floating.py · Python
Tests: While the sidebar floats in its own window, view_set {sidebar_width} is refused and the width stays unchanged. The test launches its own instance twice on one new data folder. The first run saves app.window_layout. The test then marks the sidebar's AUI entry in that layout as floating, so the second run starts with it floating. On Linux both runs start as X11 clients (GDK_BACKEND=x11, through XWayland on a Wayland desktop), as the runner's own launches do by default, since a native Wayland app drops the saved floating state.
Starts from: A new data folder of its own, seeded by orca_mcp.py launch with the default printer, the Generic Klipper Printer 0.4 nozzle; no check reads a preset. The second run starts from the conf the first run wrote, with the sidebar's entry of window_layout marked floating by the test. A shared folder's window layout, with a sidebar another test collapsed or sized, never reaches it.
Leaves: Nothing: the folder is deleted at the end unless --datadir names its root.
Decides by: Exits 1 when a check prints FAIL or on an uncaught exception.
- "the app starts" and "the window layout the first run saved has the sidebar": the first launch succeeds, and the
window_layoutinOrcaSlicer.confhas aname=sidebar;entry. The app writes the conf at its next idle moment and the stop writes nothing (on Windows it kills the app), so the first run is stopped once the conf on disk holds that entry, read withuntil()for up to 30 s; when it never does, the check fails. - "view_set of sidebar_width while the sidebar floats is refused": the call must raise, with "The sidebar floats in a window of its own" in the message.
- "and the sidebar's width stays as it was":
app_state.view.sidebar_widthequals the value read before.
Not checked:
- A native Wayland app is not tested: its saved floating state is dropped, and nothing checks that it starts docked.
- Nothing reads the state to confirm the sidebar really floats; only the refusal text suggests it. No docked control shows that
sidebar_widthis accepted when the sidebar isn't floating.
To settle in review:
- That an X11 client is what a sweep on a Wayland desktop should test here. A
--waylandsweep means native Wayland launches; this test could instead check there that the sidebar starts docked andview_set {sidebar_width}is taken. The proposal keeps one behaviour, the floating one, on every platform.
Strength: Strong — the refusal text and the unchanged width are checked exactly on every platform.
test_set_window
test_set_window.py · Python
Tests: window_list and window_set on four kinds of window, plus the read side in app_state.displays:
- The list a launch starts with: a page of windows, the main window first, with a ref, not modal.
- The main window: size, position, maximize, minimize and restore, a size given while maximized or after a minimize from maximized, and a contradictory request.
- The modeless Plugins window, by its ref: listed as not modal and holding a web page; size and position; a
window_screenshotand awidget_listby its ref, each of that window alone;keyboard_pressEscape by its ref closes it, and its ref is then stale. - The modal Preferences dialog: listed last, as modal; by
target: "dialog"and by a{label}locator; it never minimizes; and it stays above the main window in the stacking order. - Action Replay, a window the tools reach: listed with a ref, and closed by Escape sent to that ref.
Starts from: start(client) on the Generic Klipper Printer 0.4 nozzle, which leaves the Prepare tab and the
main window 1600×900, normal. No check reads a preset, and nothing here is a Bambu Lab printer's own. The window list
is the one start() leaves: the main window alone, as it closes every other window, such as the Plugins dialog and
the fixture's window test_web_ui leaves open. The checks find Plugins, Preferences and Action Replay by title. The
main window is where the test before left it (see the top of this file), but no check rests on its place: each size,
place and state is given by a call before it is read, and the contradiction is compared with the size read just
before it. The Plugins window lists the plugins an earlier test left (test_web_ui's fixture); its size and place are
set by the call that reads them.
Leaves: Nothing the checks change reaches the data folder: the main window's placement is not written, and the
Plugins window, Preferences and Action Replay store no size or place. Under <datadir>/automation/out: the
captures of the Plugins window and of the main window, and, off Wayland, the canvas capture after the restore; on
Wayland, a second capture of the main window instead. The project is start()'s, empty. The main window is left
normal at 1500×950, the last call's size, where the calls before placed it: the next start() gives it the
baseline's size and leaves its place.
Decides by: Exits 1 when any check fails or on an uncaught exception. SKIPs never fail it.
- Start:
start()returns{printer: KLIPPER, process: KLIPPER_STD, filaments: [GENERIC_PLA]}. - The list at the start:
total == len(items)andoffset == 0; the first item haskind: "main", aref,modal: false, and a width and height above 0. - Main-window size:
- Size 1400×900, then 1300×820: the reply's
sizeandstateandwindow_list's width and height equal it. - A size of 1300×850 given while maximized replies
normalwith that size. - The flat
width/heightform replies 1500×950.
- Size 1400×900, then 1300×820: the reply's
- Position, everywhere except Wayland:
app_state.window.positionequals [40, 30], or [40, top] where the work area in the first reply'sdisplayhas its top edge lower on the screen than y = 30: a top bar holds windows below it, as GNOME Shell's does at 32.- A position plus a size equal to the work area in the first reply's
displayis echoed back.
- On Wayland instead:
app_state.windowmust have noposition.- A
window_screenshotof the main window (no image) must report a width and height equal to 1300×820 times the reply'sscale. Only that pixel size is compared.
- Minimize and restore, everywhere except Wayland:
- Minimize replies
minimizedwith nonote. A wait for the 3D frame a minimized window never draws would run to its 3 s and reply with a note that the 3D view did not draw; the call has 30 s before the test reads it as hung. - Restore replies
normal, and a canvaswindow_screenshotreports a width > 0. - Maximized, minimized, then
normal: the reply saysnormalwith nonote, andwindow_list, read every 0.1 s through the second after the reply, readsnormaleach time. - Maximized, minimized, then a size: the reply says
normalwith that size.
- Minimize replies
- Contradiction:
state: maximizedtogether with a size raises, and the size inwindow_listis unchanged. - Plugins window:
- It is listed within 30 s with a
ref,modal: falseandweb: true. - The reply's size is 900×700, or 900 by more than 700 with
sizelisted inadjusted. - "Plugins: the reply has the position": off Wayland the reply's position is [100, 100]; on Wayland, where no
position is given or known, the reply has no
position(its fields arewindow_list's entry, which has noxorythere). window_list's place and size equal the reply's.- A
window_screenshotby its ref (no image) has apath, a width above 0, and a size other than that of a screenshot ofmaintaken after it. widget_listby its ref, without web pages, has"Plugins"on its first line and noMainFrame.keyboard_press Escapeby its ref removes it from the list within 30 s, and its ref then raises namingwindow_list.
- It is listed within 30 s with a
- Preferences:
- It is listed within 30 s with
modal: trueand aref, last in the list. - "dialog: window_set sizes the topmost modal dialog":
window_set {target: "dialog", size: [1000, 760]}replieskinddialogand the size 1000×760, or 1000 by more than 760 withsizeinadjusted;window_list's Preferences entry then has that width and height. Measured on Windows at 100 % scaling: Preferences opens at 640×640 with a minimum height of 640, and takes 1000×760 as asked (1000×600 is held to 1000×640 withsizeinadjusted); the allowance for a held minimum matters only where a platform's Preferences needs more than 760. - "dialog: a {label} locator finds it": the
{label: "Preferences"}call repliestitlePreferences. Off Wayland it is given the position [60, 60], and the reply'spositionandwindow_list's Preferencesxandyare 60 and 60, with the size from the call before. On Wayland it is given the size 1000×760 again, andwindow_list's width and height equal the reply's. state: minimizedraises.- It closes through
dialog_answer, and the list then leaves it out.
- It is listed within 30 s with
- Stacking, on Linux X11 only, where libX11 opens the display: the main window is minimized, restored and raised.
In the X server's stacking order its title must then sit below
Preferences. - Action Replay: listed within 30 s of
action_run open_action_replay, with nohiddenkey, aref,modal: falseandweb: true;keyboard_press Escapeby its ref removes it from the list within 30 s. - Each "within 30 s" is
until()onwindow_list, which fails its check when the 30 s pass. - Read side:
- Every window with a ref has a valid
stateand a booleanresizable. displaysis not empty and has exactly oneprimary.- Each display has the keys
index x y width height scale.
- Every window with a ref has a valid
Not checked:
- SKIP paths by platform:
- Windows and macOS run everything except the stacking check, which is a SKIP because
x11_stackingfinds no libX11 or display. - Linux X11 runs all 55.
- Linux Wayland (
--wayland) skips position, both minimize sections (9 checks) and stacking. - The Plugins window's checks after "listed with a ref" run only when it has a ref, and Action Replay's Escape only when it has one.
- Windows and macOS run everything except the stacking check, which is a SKIP because
- Maximize is checked only by the reply's
state; neitherwindow_listnor the size is read. The minimize and work-area checks also trust the reply alone. - The Plugins screenshot is checked only for a size unlike the main window's. It is not compared with the size
window_listgives for Plugins, and its pixels are never compared. - "the modal dialog comes last" runs after Plugins has closed. Measured on Windows: the list then holds the main window and Preferences alone, so "last" says only that the dialog follows the main window.
- Action Replay's size and position, and what its page shows.
- The work-area fill compares the reply with the work area the app reported in its own first reply. That makes it
self-referential, and
window_listisn't read. - "restore: the 3D view captures" only requires a reported width > 0; no pixels are compared.
- "a contradiction is refused" accepts any error text.
- "and window_list reads it normal throughout the second after" samples a fixed second: no signal tells when the
window manager is done with a window, and
app_wait {for: "idle"}waits for jobs and dialogs, not for it. A re-zoom later than that second is missed. - Displays are checked for key presence only; their values aren't compared with the OS.
- The stacking check isn't gated by platform. On a Mac where
ctypes.util.find_library("X11")succeeds andDISPLAYis set (XQuartz), it would read XQuartz's stacking order, which lists no Cocoa windows, and fail. I could not confirm whether any sweep machine hits this. - That a placement survives a restart: the app stores the main window's only when the window closes, which no test on a shared folder does.
Strength: Partial — main-window and dialog sizes and places are read back from window_list, and the list's
flags, refs, order and removals are checked exactly, but maximize, minimize and the work-area fill trust the reply,
and Wayland skips about a fifth of the test.
test_set_view_camera
test_set_view_camera.py · Python
Tests: view_set's camera fields (look_at, zoom, camera, orbit) and the camera_state it returns,
checked against app_state.camera. It covers four views: Prepare (including straight after project_new's queued
fit), Preview, the Design tab's own camera, and the assemble view's first showing. It also covers zoom clamping,
click_px_per_mm, a fit after a resize on the Home tab, and a zoom given on Home while the fit plate_add queues
waits for a 3D view to draw.
Starts from: start(client) on the Generic Klipper Printer 0.4 nozzle, which leaves the main window 1600×900 and
the perspective projection; no check reads a preset, and nothing here is a Bambu Lab printer's own. Then a
project_new of the test's own, which the first scenario starts straight after, while the fit it queues has yet to
run. auto_perspective, which would change the projection with the view's direction, is no preference a tool writes;
no test turns it on, and the app's default is off. The camera is the one the test before left, and each scenario
sets the camera it reads. The sweep launches the app with --cad.
Leaves: use_perspective_camera on; three canvas captures under <datadir>/automation/out (Prepare, assemble and
Home; measured); the imported cube and an empty second plate, added on Home, on the Prepare tab. For the rest of the
app's run, which the next start() resets: the main window at 1400×800, from the resize on Home, and the
auto-answer rule for the unsaved changes question. The window's size and the cameras are not stored.
Decides by: Exits 1 when a check prints FAIL or on an uncaught exception.
- Start:
start()returns{printer: KLIPPER, process: KLIPPER_STD, filaments: [GENERIC_PLA]}. - Prepare after
project_new:- The reply echoes
cameratop, andcamera_statehas zoom 3,look_at[50, 60, 0] andelevation90. - "prepare: the 3D view captures":
window_screenshot {target: "canvas"}repliessourcecanvas, a width and height above 0, and noapproximatekey (a 3D view that comes back blank is markedapproximate). - After that capture forces a frame,
app_state.camerastill has zoom 3 and thatlook_at. - "prepare: camera_state has a projection type":
typeisperspective, the projectionstart()sets.
- The reply echoes
click_px_per_mm: zoom divided byclick_px_per_mmlies in [1, 3].- Clamping:
zoom=1000gives 250, andadjusted== ["zoom"]. - Orbit:
camera=front, orbit=[30, 20]giveselevation20 andazimuth-60.look_atequals the one before, and the reply echoesorbitandcamera. - Preview: the imported cube slices with
outcomeok. Zoom 2 andlook_at[0, 0, 0] appear in both the reply andapp_state.camera. - Design (the sweep launches with
--cad):- The zoom is within 1e-3 of
250/1.4^15. look_atis within 1e-3 ofdesign_describe'smodeling_origin.- The reply echoes the camera, and
app_state.camerahas the zoom. - An orbit is accepted and keeps that zoom.
- Back on Prepare, the zoom is 2. That value was set on Preview, so this shows the two share a camera.
- The zoom is within 1e-3 of
- Assemble: the call raises no error, and after a capture
app_state.camerahas zoom 4 andlook_at[10, 20, 0]. - Home, after
plate_addthere (Add Plate queues a fit of all plates and leaves the tab as it is):app_statehas nocamera.- A zoom's reply has a
note. - After switching to Prepare and a capture, the zoom is not 3.
Not checked:
- The captures in assemble and on Home only force a frame; their replies are not read unless the call fails, and no capture's pixels are compared.
- After the Design orbit, the resulting elevation and azimuth are not checked; only the kept zoom is.
- "resized on home: a fit on prepare uses the new size" compares two fits in a row with each other, not with the zoom expected for a 1400×800 canvas. A fit that used a stale size both times would pass.
- "home: the fit replaces the zoom once the view draws" checks only
!= 3, not the fit's zoom. Thenoteis checked for presence, not for its text. click_px_per_mmis checked against a range, not the display's known scale. Both values come from oneapp_state.- An orthographic camera's
camera_state, andauto_perspectiveturned on:start()sets perspective, and no tool setsauto_perspective.
Strength: Partial — Prepare, Preview, assemble and clamping values are exact, but the Design orbit, the resized fit and the Home fit are checked loosely or only against each other.
test_speed_dial_open
test_speed_dial_open.py · Python
Tests: The app goes from Home to Prepare, Design and Preview by tab clicks. After each switch, the page's 3D
view (OrcaSceneCanvas) must hold the keyboard focus, Space sent with no target must open the Speed Dial, and
Escape must close it. Where KWin answers on D-Bus, it also checks that KWin draws no title bar on the dial. The
test runs exclusive in the sweep.
Starts from: start(client) on the Generic Klipper Printer 0.4 nozzle, which leaves the Prepare tab's 3D view and
the main window 1600×900, normal; no check reads a preset. Then window_set places the main window at the top left
of the primary display's work area (its x and y in app_state.displays), which the work area may trim; on
Wayland, which takes no position, the window keeps start()'s size alone. That placement keeps (0, 0) off the 3D
view, wherever the test before left the window (see the top of this file). The sweep launches the app with --cad.
Leaves: Nothing in the data folder beyond start()'s empty project: the dial is opened and closed without
running an action, so its recent actions are as they were. The system pointer is left at (0, 0).
Decides by: Exits 1 when a check prints FAIL or on an uncaught exception, such as a tab missing from
widget_list.
- Start:
start()returns{printer: KLIPPER, process: KLIPPER_STD, filaments: [GENERIC_PLA]}. - The pointer off the view: the 3D view also takes the focus when the pointer enters it, so before each tab click
the test moves the system pointer to the primary display's top-left corner, (0, 0), and reads the pointer's
position back from the system: (0, 0). The start placed the main window at the work area's top left, so that
corner is its top bar or lies outside it, never in the 3D view below the tab bar. It moves the pointer with
SetCursorPoson Windows,CGWarpMouseCursorPositionon macOS andXWarpPointeron X11, each throughctypes, and reads it withGetCursorPos,CGEventGetLocationandXQueryPointer. A pointer that does not read back at (0, 0) fails the page's focus check. - Per page:
- "the tab is shown":
app_state.tabreadshomewithin 30 s of the click on Home's tab, and then the page's tab within 30 s of the click on it. - The first
[focused]line inwidget_listcontainsname=OrcaSceneCanvas. - Within 30 s of Space,
window_listshows a web dialog with no title. - Within 30 s of Escape sent to the dial's ref, it is gone.
- Each "within 30 s" is
until(), which fails its check when the 30 s pass.
- "the tab is shown":
- On a native Wayland display, where an app can neither move the pointer nor read where it is, each focus check prints SKIP with that reason instead of passing.
- KWin, on the first page only: KWin's frame height for the app's window with no caption must be at most the dial's
height in
window_list+ 2.
Not checked:
- The focus checks are not made on a native Wayland display.
- Any web dialog with no title counts as the dial, and its content isn't checked, so what it lists, which a plugin an earlier test left adds to, plays no part. Escape is sent to the dial's ref, so Escape through the keyboard focus isn't tested.
- The KWin title-bar check prints "skip", which isn't a counted check, in two cases:
- No KWin answers: Windows, macOS and GNOME.
- KWin's window runner doesn't list the dial. Per the code comment this covers X11 clients, so it includes the
default Linux sweep and
--headless. It runs only for a native Wayland app on KWin (--waylandon Plasma).
To settle in review:
- Moving the user's pointer during a sweep on a desktop: the test is exclusive in the sweep, so nothing else runs meanwhile, but a person using the machine sees the pointer jump.
- That (0, 0) lies outside the 3D view on every sweep machine: the start puts the window at the work area's top left, and the 3D view is below the tab bar in any case; with a monitor at negative coordinates, (0, 0) is still the primary's corner.
Strength: Partial — opening and closing the dial are checked on every page, and the focus check is made with the pointer off the view, but the KWin check almost never runs and native Wayland skips the focus checks.
test_send_gcode
test_send_gcode.py · Python
Tests: Printing and sending through a print host, run against an OctoPrint stub host inside the test process,
on the Generic Klipper Printer 0.4 nozzle: the send_gcode Speed Dial action (orca_command:send_gcode:orca),
printer_send with plates, print_start, and printer_test_host. A printer of the Custom vendor sends through a
print host as its own route: its Print button offers Send G-code and the exports, and no call reaches the Bambu
network, so nothing is switched first. It covers:
- Refusals for a printer with no print host, a plate not sliced, and all plates, which the Print button offers no action on.
print_startandprinter_sendopening the host's upload dialog, which the test cancels: nothing is uploaded.- The host test, answered by the stub, refused with no address, and failing on a port nothing listens on.
- An upload through the action's dialog, with the file name set by
widget_set_valueand Upload pressed bydialog_answer, tracked inapp_state.uploads. - The exported replay of that send, which uploads again.
- HTTP 500 replies, delayed and immediate, which must end as errors, with the queue's error dialog.
Starts from: start(client) on the Klipper printer, which leaves use_printer_agents at a new folder's false,
read with preferences_get: with printer agents on, the Print button routes through an agent instead of the print
host and could reach a printer, so a value other than false stops the test before any print call. The print-host values
(host_type, print_host, use_3mf) are set on the printer by the scenarios as unsaved changes, so the preset's
saved ones play no part. The machines earlier runs stored (see Leaves) play none either: the route follows the
preset's print host, not the machine the app selected.
Leaves: In the conf, measured:
- Two machines of the Orca printer agent in
local_machines, the stub's127.0.0.1:<port>and the closed port's, withlast_selected_machinenaming the closed port's. Setting a Klipper printer'sprint_hostmakes the app add and select a machine for that address, as the connection settings do for a person, and it keeps them; while the app runs,printer_statusreads that address connected. A later launch with a Klipper printer whoseprint_hostis empty selects a stored machine only when it is the agent's only one: with these two, the next launch read{"connected": false}; with one of them alone, the printer connected. - The upload queue dialog's size, place and column widths (
print_host_queue_dialog_*).
The project holds the imported cube on plate 0 and an empty plate 1, with the printer's print-host changes unsaved;
the auto-answer rule for the unsaved changes question is in force for the rest of the app's run. The next start()
discards the changes and clears the rule; the print-host changes are never saved.
Decides by: Exits 1 when a check prints FAIL or on an uncaught exception. Every refusal is asserted by its code
with checks.py's refused, then app_state.uploads and dialogs() are read back. "Nothing sent" below means:
app_state.uploads is as before the call, the stub got no file, and dialogs() is empty. "Cancelled" means: the
call replies blocked_by_dialog, dialogs() lists one dialog titled "Send G-code to printer host",
dialog_answer {button: "Cancel"} closes it, and then nothing was sent. Measured on the Klipper printer: every
check below passes.
- Start:
start()returns{printer: KLIPPER, process: KLIPPER_STD, filaments: [GENERIC_PLA]}, anduse_printer_agentsreadsfalse. - Discovery:
action_list {section: "Slice & Export"}lists the idorca_command:send_gcode:orca. - No address.
settings_set {type: "printer", values: {host_type: "octoprint", print_host: "", use_3mf: false}}, with the imported cube not sliced (plain G-code, so the dialog proposes a.gcodename). The values are the Klipper printer's own, so the preset as edited is the preset as stored:- The action is refused
no_print_host; nothing sent. printer_send {plates: 0}is refusedno_print_host; nothing sent.printer_test_hostis refusedno_print_host;dialogs()is empty.settings_get {type: "printer", compare: ":saved"}lists no key: the refused calls changed nothing in the printer preset.- A Send with no objects, or with the plate sliced, meets the same refusal, and no row makes one:
Ops::print_route()refuses a host upload with no address before it selects a plate or reads the slice (PrinterOps.cpp).
- The action is refused
- The stub's address set (
print_host127.0.0.1:<port>), the cube still not sliced:printer_test_hostrepliesoktrue andmessage"Connection to OctoPrint is working correctly."; the stub answered one more version check (GET /api/version);dialogs()is empty.print_startis refusednot_sliced; nothing sent.print_start {plates: "all"}andprinter_send {plates: "all"}are each refusedall_plates_not_offered: the Print button of a printer not of Bambu Lab offers Send G-code and the exports, none of them on all plates; nothing sent.plate_add, thenplate_select {plate: 1}: plate 1, empty, is current.print_start {plates: 0}is refusednot_sliced; nothing sent;plate_listreads plate 1 current again, and the call's undo steps are four"select partplate!": a change of the current plate logs two (Plater::select_plate()one, andPartPlateList::select_plate()another, astest_files'SELECTEDhas it), once as plate 0 is made current for the Print button's check and once as the plate that was current is put back, as a refused export that names a plate does. Thenplate_select {plate: 0}.
- Sliced (
plate_slice, the plate'soutcomeok):print_startis cancelled: the Print button's action is Send G-code, the host's upload.printer_send {plates: 0}is cancelled.plate_select {plate: 1}, thenprinter_send {plates: 0}is cancelled;plate_listreads plate 0 current, and the call's undo steps are the two"select partplate!"of one change of plate: the plate it named stays current. Plate 0 stays current for the steps below.
- The stub's gate: for the two sends caught in flight, the stub, once it has read the whole file, holds its answer
until the test opens its gate, which it does once the row reads (
uploading, 99), read every 0.2 s for up to 30 s; then the row is read every 0.2 s until it ends, for up to 120 s. A read that runs out fails the checks after it. - Upload answered 200:
- The row ends
completedat progress 100 and was seen at (uploading, 99) while the stub held its answer. - The row has
filenamemcp_send_ok.gcodeand the stub's port inhost. - The stub received exactly
{"filename": "mcp_send_ok.gcode", "print": "false"}.
- The row ends
- Replay:
- The
replay_exportsteps equal exactlyaction_run, app_wait(dialog), widget_set_value, app_wait(dialog), dialog_answer, app_wait. replay_runpasses, a new row completes, and the stub has 2 uploads.
- The
- 500 once caught in flight:
- The row ends
errorwith "HTTP 500" inerror, never readcompleted, and was seen at (uploading, 99). - An error dialog appears within 30 s, and after
dialog_answer ok,app_state.dialogsis empty.
- The row ends
- 500 at once: the row ends
error. - A port nothing listens on (
print_hostset to it):printer_test_hostrepliesokfalse and amessagestarting "Could not connect to OctoPrint";dialogs()is empty.
Not checked:
- The uploaded file's content. The stub parses only the multipart
filenameandprintfields, so an empty or wrong body would pass. - The replayed upload's file name.
- The error dialog's text: only that some dialog opened and closed. For the immediate 500, neither the
"HTTP 500" text nor the dialog is checked;
close_error_dialog's result is ignored. - A Bambu Lab printer made a print host (
bbl_use_printhost), whose Print button takes Print plate to the host's upload by a route of its own; the Klipper printer takes the route of other vendors' printers. - The Print and storage dialogs of a printer on the Bambu network, and
printer_send'snot_slicedthere: no test opens them, since they message a physical printer. They are the maintainer's to check on a printer of his. - A SimplyPrint host's Print all, which only a Bambu Lab printer made a print host offers, and a cloud host's login: the stub is an OctoPrint host.
printer_statusonce a print host is set, which reads the host's address connected:test_printerscoversprinter_status.- The host test's message in another language: the sweep runs the app in English.
- Row ids are assumed to be
count + 1. Different numbering makesfollowtime out, which fails rather than passes falsely.
Strength: Strong — row states, progress, the file name, the print flag and the exported steps are checked exactly against an independent stub, and each refusal by its code with the uploads and dialogs read back.
test_web_ui
test_web_ui.py · Python
Tests: The GUI tools on web pages, through the side-loaded mcp_web_fixture plugin, on the Generic Klipper
Printer 0.4 nozzle; nothing here is a Bambu Lab printer's own. Before the launch, the sweep's setup step
(--install {datadir}) copies mcp_web_fixture.py and an enabled .install_state.json into orca_plugins of the
job's data folder.
- What the plugin provides:
- One page with every kind of control, opened as a modal dialog and as a modeless window.
- A dock panel whose CSP forbids eval.
- A page among the main window's tabs.
- A thread that brings up the permission prompt.
- A configuration UI in the Plugins dialog's sandboxed frame.
- What it exercises:
widget_listsnapshots.widget_click,widget_set_value,keyboard_pressandmouse_gesture, with their effects on the page.- Locators into a shadow root, frames, by index, and as the journal records them.
- Refusals, the timeout contract and stale refs.
- Navigation and token redaction.
dialog_answeranddialog_auto_answeron web dialogs and on the permission prompt.- The web snapshot budget.
Starts from: The fixture plugin installed and enabled by the setup step, which writes it afresh on every run: it
copies the script over the one there and rewrites .install_state.json with the five capabilities on and no stored
permission, so a run after a failed one, such as the rerun alone on the folder it failed on, starts from the same
plugin. A test with a setup step gets a new launch of its job's app after it, so the plugin loads at the launch. Then
start(client) on the Klipper printer; no check reads a preset. The stored state the checks read is the
plugin's own, written during the run. The configuration saved through the Plugins dialog is a speed drawn for the run,
so a value an earlier run saved does not pass the check. The submitted JSON is looked for in this app's Python log,
<datadir>/log/python_*_<pid>.log with the pid the session names, not in the newest log: the app makes its log only
when the plugin first writes to it, so until then the newest is an earlier run's, which holds the same line.
Leaves: Measured after a run, and at the next launch on the folder:
- The fixture plugin, installed and enabled, with the threading permission it was refused stored in its
.install_state.json. Every later launch on the job has the main-window tab "MCP web fixture page" after Project, and five more actions in the Speed Dial andaction_list(the page and the four scripts). Nothing opens at startup and nothing asks:window_listlists the main window alone, and an untargetedwebview_run_javascripton Home still reaches the Home page, as the plugin's page makes its web view only when shown. The test does not remove the plugin: a plugin a person installs stays, and the tests after it check what they own, as TESTS.md's rule says of the menu items a plugin adds. orca_plugins/config.jsonwith the fixture dialog capability's entry; after the run it held the capability's defaults, speed 0 and enabled false.- The plugin's Python log in
<datadir>/log, and its pages' WebView2 data in<datadir>/webview2on Windows, whereorca_mcp.pyputs the profile. - The project
start()made. Its own dialogs are closed. For the rest of the app's run, measured: the Plugins dialog with the configuration frame muted and the fixture's modeless window are left open, and the nextstart()closes both, whichwindow_listlists. The dock panel is closed at the end of its part by its page's Close panel button ("the dock panel's page closes the panel": its Ping button is no longer listed), sincestart()closes no dock panel and one left open would narrow the 3D view of every test after it.
Decides by: Exits 1 when any check prints FAIL or on an uncaught exception. call() turns most tool errors
into {"error": ...}, and the check that follows judges it. Measured on the Klipper printer: every check passes, the
conditional one not run.
- Start:
start()returns{printer: KLIPPER, process: KLIPPER_STD, filaments: [GENERIC_PLA]}. - Snapshot:
- 19 needles must be listed, e.g.
spin "Count" = "3"and[options: Red | Green | Blue]. - The table cell is named
1 / 2with value "91". - The checked, unchecked and disabled markers are right, and the hidden element is absent.
- 19 needles must be listed, e.g.
- Actions:
- Each reply's
value,checked,clickedordonemust equal the expected value. - The page's own
<pre id="log">must hold 18 exact lines, e.g.pad up 59,29 after 4 moves,cap samples 5andf2 submitted by go-value. - The caret ends at positions [1, 3].
- Text editing works without
execCommandorSelection.modify("acd", "abd"). - Tab order is checked through
[focused]. - An emoji is typed and deleted whole.
- A form with an empty required field isn't submitted until the field is filled.
- Each reply's
- Press bookkeeping: after each click, refusal, busy page, replay end and auto-answer, the count of
pad up,dock uporframe uplines must be exactly right. - Refusals and the timeout contract:
- Error texts are matched by substring: "covered by (span#veil)", "outside the element", "file input",
"That is a web view", "No page element matches", "2 page elements match", "outcome is unknown",
"gone from the page", "page changed", "may not be the only match", and "page has no button" with
page_buttons. - A click queued behind a busy page is never run: the count of
oklines stays the same. - "and the panel's own page never saw that click": the dock panel's log, read from
widget_list, is exactly two pings (label "ping ping", from the click "its page, whose CSP forbids eval, takes a click" and the click on Ping that ends the press held on the window's pad) before the refused click and still exactly that after it. A log that is not found reads as no line, which fails. - "the page answers again once its stall ends": after the stalled
dialog_answer, a script with a 30 stimeout_srepliesresult1, so the close section starts on a page that is free. - The calls whose deadline is what they test keep it: the
timeout_s1 of a locator that matches nothing, an up whose target is not found, a down and an up the page answers too late, a slow handler and a click queued behind a busy page. So do three that run to their deadline by design: the click refused beside the window's page, which stalls past whatever deadline the call has (5 s, the panel's page's time to answer); the Mute click (2 s), whose frame stops answering; and the Add note click (5 s), whose requests to the muted frame must be given up before the watch's 10 s for the relay check to find the watch the last one waiting. - "a request with no deadline is given up after the tools' default": a watch a script asks the page's agent for
itself, with no deadline, is relayed to the muted configuration frame. The "Add note" check runs while it
waits; then the page's
relayingcount, read again until it is 0 for up to 30 s, must read 0, and no sooner than 10 s after the request.
- Error texts are matched by substring: "covered by (span#veil)", "outside the element", "file input",
"That is a web view", "No page element matches", "2 page elements match", "outcome is unknown",
"gone from the page", "page changed", "may not be the only match", and "page has no button" with
- Every wait for the page, the dialogs, the Python log or
config.jsonisuntil(), asked every 0.2 s for up to 30 s, and one that runs out fails its check. - Page changes and navigation:
page.changed,addedandpartialmust match.navigatedURLs must end with#bottom,#top,#evaluatedand#orca-token=REDACTED&view=2.- "and the snapshot shows no secret either": the dialog's
widget_listsnapshot answers, lists the page'sToken link(the link just clicked, so the snapshot is of that page), and holds nofixture-secret.
- The dock panel's script: "webview_run_javascript there runs, or names the page's Content-Security-Policy" takes
one outcome per platform. On Windows, whose WebView2 does not hold the injected script to the page's policy, the
reply's
resultis 1. On macOS and Linux the call is refused with text holdingContent-Security-Policy. - Dialogs:
- Closes report
closed. - During a close, 15
widget_listcalls from a second client must all answer. - The permission prompt's buttons are exactly ["Yes", "No"].
- An auto-answer rule answers an already open prompt, with
uses1. - The submitted JSON shows up in this app's Python log.
dialog_answerpast its 3 s, judged by the reply, each call given 30 s before the test reads it as hung: a page button that shows half a second late is refused with "page has no button", and is not pressed once it shows, as a call that looked on would press it. Cancel on a page that is busy, and on one whose Cancel handler runs 10 s, repliesclosedtrue with noweb: the call ended the dialog itself. A reply withwebsays the page pressed its button, which it does only once the call has waited on it: the busy page, free 2 s past the press's deadline, then presses its Cancel (the test moves that request's deadline on and takes the button's handler off), and the stalling handler replies once it ends; the dialog then stays open.
- Closes report
- Persistence, tabs and the journal:
orca_plugins/config.jsonholds{"speed": <random>, "enabled": true}.- Go to tab shows
plugin.mcp_web_fixture.MCP web fixture page, both in the reply and inapp_state.tab. - The journal records the locators:
within,class: webviewandindex2.
Not checked:
- "the blocked note says to answer it with dialog_answer" runs only when the thread action replies
blocked_by_dialog. Otherwise it is dropped without a word: whether the plugin's thread raises its prompt before the call replies is a race in the fixture. - Loose matchers:
- "the page keeps no more than the last round's unanswered request" accepts 0 or 1.
- "a down the page answers too late has no outcome" accepts any error.
- "a wheel turn on a scroller scrolls it" accepts any scrollTop above 0.
- "the Home page is listed too" is a heuristic:
homepageappears and there are more than 20[drefs.
- The journal and the logs are not checked for the token.
- "a request with no deadline is given up after the tools' default" accepts any time from 10 s to the 30 s the read waits, so a default anywhere in that span passes. Its lower bound shows the request was held only while "Add note"'s own requests are pruned before 10 s, about 6 s after the request when the click starts at once; a click delayed past that by load would let a request never held pass.
- How long
dialog_answerlooks for a page button: the button shown half a second past its 3 s shows the call had stopped by then, and nothing shows it looked that long. - The
window_screenshotof a page element is used only for its journal entry; the image is never looked at. - The auto-answer to the fixture dialog (Submit) is judged by the dialog closing and the rule's use count. Nothing checks that the plugin received the submit.
- The speed is drawn from 89 values by the clock, so a saved configuration an earlier run left matches it once in 89 runs; after a run the file held the defaults, which no draw gives.
To settle in review:
- The dock panel's outcome on macOS and Linux. The code's comment says only that WebView2 is not held to the page's
policy;
webview_run_javascriptruns its code througheval, which a policy withoutunsafe-evalforbids where the port holds injected scripts to it. The proposal, refused naming the policy on WKWebView and WebKitGTK, is to confirm on each. - The request with no deadline is a
watch, which the page's agent relays outside its rounds (relaySend()inweb/mcp/page_agent.js). A snapshot would sit in its frame's round slot, which the next listing's or click's round gives up (relayRound()), so the "Add note" check, run during the wait, would pass the check whether or not the 10 s default held. The tools' default and the pruning are the samerelaySend()andprunePending()code for either kind of request. "Add note"'s own requests to the frame have its 5 s and are pruned a second after, before the watch is.
Strength: Strong — nearly every action is checked by an exact reply value and by the effect the page logged, with exact counts of press releases.