Codester demo · Scripts & Code → Python
Deterministic desktop test loop for coding agents: YAML steps, a named-app allowlist, pass/fail reports.
DeskCheck tests are data, never code — a small YAML file. This is examples/demo-pass.yaml from the package, exactly as shipped. It runs against DeskCheck's mock driver, so the whole loop is proven with no real desktop involved.
# Passing MockDriver demo: launch, act, screenshot, assert.
# Run: deskcheck run examples/demo-pass.yaml --config examples/config.yaml \
# --driver mock --mock-windows demo-app
version: 1
name: demo-pass
app: demo-app
steps:
- type: launch
app: demo-app
- type: wait
ms: 10
- type: click
x: 100
y: 200
- type: type
text: "hello"
- type: key
key: Enter
- type: screenshot
name: main
- type: assert
kind: window-visible
window: demo-app
- type: assert
kind: screenshot-saved
screenshot: main
# deskcheck allowlist config. Default deny: anything not listed here
# is refused at launch AND at every input step.
apps:
demo-app:
command: demo-app
category: app
# A browser is ONLY allowed with a fresh throwaway profile:
# throwaway-browser:
# command: chromium --user-data-dir=/tmp/deskcheck-profile
# category: browser
# throwaway_profile: true
# These categories are denied even if listed (see docs/SECURITY.md):
# secret-vault: {category: password-manager}
# keychain: {category: credential-store}
# settings: {category: system-settings}
The command, its result, and the report the run wrote (examples/runs/demo-pass/report.md), reproduced from the real run.
$ python3 -m deskcheck run examples/demo-pass.yaml --config examples/config.yaml --driver mock --mock-windows demo-app deskcheck: pass (demo-pass) — report: examples/runs/demo-pass/report.md exit code: 0
PASS App: demo-app · Steps logged: 8
| # | Type | Target | Outcome | Screenshot |
|---|---|---|---|---|
| 0 | launch | demo-app | ok | |
| 1 | wait | 10ms | ok | |
| 2 | click | 100,200 | ok | |
| 3 | type | hello | ok | |
| 4 | key | Enter | ok | |
| 5 | screenshot | main | ok | main.png |
| 6 | assert | demo-app | ok | |
| 7 | assert | main | ok | main.png |
The run also writes an HTML report and a JSONL action log next to the Markdown report.
DeskCheck's headline feature: only apps you name may be launched or touched. examples/denied-app.yaml asks for an app that is not on the allowlist — here is the actual run.
# Negative test: this app is NOT on the allowlist, so the run must
# fail with a clear permission error (default deny) and log the denial.
version: 1
name: denied-app
app: secret-vault
steps:
- type: launch
app: secret-vault
- type: screenshot
name: should-never-happen
$ python3 -m deskcheck run examples/denied-app.yaml --config examples/config.yaml --driver mock --mock-windows demo-app deskcheck: launch denied: app 'secret-vault' is not on the allowlist (default deny — add it to the config to allow it) deskcheck: fail (denied-app) — report: /tmp/runs/deskcheck/examples/runs/denied-app/report.md exit code: 1
Whole categories — password managers, credential stores, system settings, browsers carrying real profiles — are refused outright, and the check runs at launch and again at every input step.
Screenshots shipped inside the Codester package.
