Tomacco

Docs Operation reference preview operations

preview operations#

16 operations. Generated from assets/operations.json; all areas.

On this page (16)

preview.sessions#

Preview sessions

Find running Qt preview sessions owned by this OS user.

Annotations: read-only, idempotent, open world.

Takes no arguments.

tomaccoctl call preview.sessions

preview.state#

Preview status

Read current device, viewport, page, loading status and rendering engine.

Annotations: read-only, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.state

preview.navigate#

Open URL

Navigate the running preview to an HTTP(S) URL or tomacco://demo.

Annotations: writes, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
urlstringyes
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.navigate '{"url":"<url>"}'

preview.configure#

Configure preview

Set profile, orientation, fold state, insets, guides, zoom, the page's color scheme and reduced-motion preference, and network throttling, without reloading the page.

Annotations: writes, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
devicestring
orientationstringone of portrait, landscape
unfoldedboolean
safe_areaboolean
guidesboolean
status_barboolean
chrome_themestringone of auto, light, dark
zoomnumber0 to 3
color_schemestringone of system, light, dark; prefers-color-scheme the page sees; system follows the desktop
reduced_motionstringone of system, reduce, no-preference; prefers-reduced-motion the page sees; system follows the desktop
networkobjectThrottle the page's requests or take it offline, through Chromium's DevTools network emulation. A preset sets every field; fields given with it override the preset. All zero and offline false turns throttling off.
network.presetstringone of none, fast-3g, slow-3g, offline; Chromium DevTools' presets: fast-3g 562.5 ms, 1440/675 kbit/s; slow-3g 2000 ms, 400/400 kbit/s
network.offlineboolean
network.latency_msnumber0 to 60000; Added round-trip latency in milliseconds
network.download_kbpsnumber0 to 10000000; Download limit in kbit/s; 0 is unlimited
network.upload_kbpsnumber0 to 10000000; Upload limit in kbit/s; 0 is unlimited
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
ios_guestobjectThe virtual iOS guest display shown by the desktop for a running interactive guest job.
ios_guest.detachedbooleanShow the guest display as its own phone-shaped window, or dock it back into the dialog. A request to detach made while no interactive guest is running is kept for up to 10 minutes and applied when the guest starts; until then the returned state reports workspace.ios_research.guest.detach_pending as true.
nativeobject
native.platformstringone of android, ios
native.apple_targetstringone of device, simulator
native.setupboolean
native.devicestringnon-empty, up to 200 characters; Select a native device by serial/UDID and attach its existing runtime session.
native.connectbooleanWith device: if no runtime session exists yet, the app waits for the device and starts one with its own settings (sound, iPhone runner, Mac). Its window shows the device frame and a startup screen until the stream is live; other sessions are not attached meanwhile. An existing session is shown as it is and never reconfigured.
native.framebooleanShow the matching native device frame. Never changes the guest hardware or screen geometry.
native.detachedbooleanShow the live device as its own frameless, device-shaped window instead of inside the workspace. The same display item moves; no second stream is opened.
native.pending_avdstringup to 200 characters; Name of an Android virtual device that is starting. The device view shows its frame and a startup screen and attaches the real stream once Android has booted. An empty string clears it.
native.profile_idstringup to 200 characters; Device profile for the startup frame of pending_avd or connect.
native.solobooleanWith detached and a device window that is shown or on its way: hide the main window so the device window is the whole app. Closing that window stops its runtime session and ends the app; the device itself keeps running. With unsaved source edits, or once two minutes pass without any device window, the main window returns instead. desktop.open without device_only also brings it back.
tomaccoctl call preview.configure

preview.evaluate#

Run JavaScript

Evaluate JavaScript in the web page, returning a JSON-compatible result.

Annotations: writes, not idempotent, open world.

ArgumentTypeRequiredDefaultDetails
scriptstringyes
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.evaluate '{"script":"<script>"}'

preview.capture#

Capture preview

Capture the device or display as a PNG artifact.

Annotations: writes, not idempotent, open world.

ArgumentTypeRequiredDefaultDetails
pathstringyesnon-empty; Absolute local filesystem path
frameboolean
scalenumber1 to 3
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
windowbooleanfalseCapture the full desktop window including workspace panels
tomaccoctl call preview.capture '{"path":"<path>"}'

preview.inspect#

Inspect DOM

Read page title, text, links, inputs and actionable DOM elements.

Annotations: read-only, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.inspect

preview.console#

Browser console

Read the last 200 browser console messages.

Annotations: read-only, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.console

preview.errors#

Page errors

Report the current page load's errors as structured results: console errors, uncaught exceptions, unhandled promise rejections and failed requests (network errors and HTTP status 400 and above from fetch, XMLHttpRequest, elements, style sheets, fonts and the document), with clean true when there are none. reload:true reloads first and waits for the page, so the report covers exactly one load.

Annotations: writes, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
reloadbooleanfalseReload the page and wait until it is ready before reporting
timeoutinteger301 to 60; Seconds to wait for the reloaded page
wait_forstring""JavaScript expression that becomes true when application content is ready, after a reload
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.errors

preview.click#

Click element

Click a CSS selector in the preview page.

Annotations: writes, not idempotent, open world.

ArgumentTypeRequiredDefaultDetails
selectorstringyes
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.click '{"selector":"<selector>"}'

preview.fill#

Fill in form

Fill an input/textarea and emit input/change events.

Annotations: writes, not idempotent, open world.

ArgumentTypeRequiredDefaultDetails
selectorstringyes
textstringyes
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.fill '{"selector":"<selector>","text":"<text>"}'

preview.reload#

Reload page

Reload the active page.

Annotations: writes, not idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.reload

preview.catalog_reload#

Reload catalog

Refresh the desktop catalogue after import/remove.

Annotations: writes, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstringmatching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.catalog_reload

preview.audit#

Check layout

Check overflow of the page and its elements, text under the camera cutout or system bars, accessible names, input labels and target sizes (24 px, and 44 pt on iOS or 48 dp on Android), with a unique selector per finding; returns evidence, not a compliance certification.

Annotations: read-only, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstring"main"matching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
tomaccoctl call preview.audit

preview.ready#

Wait for rendering

Wait for document/fonts and Flutter's first frame, optionally a JavaScript readiness predicate.

Annotations: read-only, idempotent, open world.

ArgumentTypeRequiredDefaultDetails
sessionstring"main"matching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
timeoutinteger301 to 60
wait_forstring""JavaScript expression that becomes true when application content is ready
tomaccoctl call preview.ready

preview.matrix#

Capture device matrix

Capture and audit a page across multiple profiles and orientations, saving PNGs, a labelled contact sheet of all captures and a JSON report.

Annotations: writes, not idempotent, open world.

ArgumentTypeRequiredDefaultDetails
device_idsarray of stringyes1 to 30 items
directorystringyesnon-empty; Absolute local filesystem path
urlstring""
orientationsarray of stringitems one of portrait, landscape; 1 to 2 items
sessionstring"main"matching [A-Za-z0-9_-]{1,40}; Running preview session name; defaults to main
wait_forstring""
folded_viewsbooleantrue
contact_sheetbooleantrueAlso write contact-sheet.png: every capture side by side at one scale, labelled with model and orientation
tomaccoctl call preview.matrix '{"device_ids":["<device_id>"],"directory":"<directory>"}'

View this page as Markdown on GitHub