create_app_scenario
Create a reusable GUI test scenario stored on OpenFactory.
Tests any URL the tester VM can reach — a local dev server, a deployed app, or a public site — on a vanilla Ubuntu+Firefox tester VM. No build and no image are required. Define the flow once in plain language; run it later (and repeatedly) with run_app_scenario. The first run hardens it (caches where each element is) so re-runs are fast and self-healing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"app_name": "<app_name>",
"scenario": "<scenario>",
"steps": "<steps>"
},
"name": "create_app_scenario"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | JSON array of semantic steps, run in order. Each step: {"action": "open_url"|"click"|"type"|"key"|"assert_text"|"assert_no_error"|"wait"|"email_otp"|"assert_visual"|"drag"|"assert_stable"|"assert_progress"|"network"|"login"|"goal", "target"?: str, "value"?: str, "expect"?: str, "visual_threshold"?: int, "monitor_duration_secs"?: int, "monitor_region"?: [x,y,w,h], "sample_interval_ms"?: int, "stability_threshold"?: int, "min_changes"?: int, "min_stream_secs"?: int}. Use plain language for `target` (e.g. "Sign In button", "email field") — it is matched on screen by OmniParser (verbose descriptions are fine; they resolve to the on-screen label). `value` is the URL (open_url), the text to type (type), the key to press (key, e.g. "Return"), or seconds (wait). `drag` drag-and-drops `target`: `value` is either a pixel delta "dx,dy" (e.g. "120,-40" to move it right 120 / up 40) or "to:<other target>" to drop it onto another element — e.g. reorder a list, move a graph node, drag a slider. `expect` optionally asserts text is visible after the step. An `assert_text` step requires a non-empty `expect` (legacy `value` is also accepted); `target` does not supply the assertion text. `assert_no_error` is a NEGATIVE assertion — it FAILS if an error bubble/toast is on screen (built-in phrases like 'Something went wrong', 'Internal server error', 'Failed to load', 'Rate limit'); add custom phrases via `expect` (comma/newline-separated, e.g. "Payment declined, Card expired"). Place it after a submit/send to assert no failure popped up. NOTE: by default the runner ALSO sweeps every step for these error bubbles and fails the run automatically, so you only need an explicit `assert_no_error` for CUSTOM error text or a specific checkpoint. `assert_visual` is a visual-regression check: the first run captures a perceptual-hash baseline of the full page; later runs FAIL if the page drifts beyond `visual_threshold` (perceptual-hash Hamming distance 0-64, default 8) — catches layout/render regressions that text checks miss. `assert_stable` is a TEMPORAL/SOAK check: it watches a screen region over time and FAILS on visual INSTABILITY — flicker (an element repeatedly appears/disappears) or disappearance (present at the start, gone by the end). Fields: `monitor_duration_secs` (1-120, default 15), `monitor_region` [x,y,w,h] in screen pixels (omit = full screen), `sample_interval_ms` (200-2000, default 500), `stability_threshold` (phash distance 0-64, default 6), and optional `target` = an element (by label) that must REMAIN present the whole time. Catches 'after a while the UI flickers/vanishes' bugs that point-in-time checks miss, e.g. {"action":"assert_stable","target":"VM node","monitor_region":[260,140,760,520],"monitor_duration_secs":20,"description":"VM nodes stay stable for 20s"}. `assert_progress` is the INVERSE temporal check — for STREAMING UIs (a chat reply, a build-log tail). It FAILS if a region stops changing too early: NO_OUTPUT (never rendered) or FROZE (last change before `min_stream_secs`, or fewer than `min_changes` changing samples) — i.e. the reply 'stops after a second'. Same monitor fields as assert_stable plus `min_changes` (default 3) and `min_stream_secs` (default 4); scope `monitor_region` to the reply text area so a spinner can't read as progress. E.g. {"action":"assert_progress","monitor_region":[480,180,760,520],"monitor_duration_secs":20,"min_stream_secs":4,"description":"reply keeps streaming, does not stall"}. `network` is FAULT INJECTION — drop/restore the tester VM's connection to reproduce a mid-stream disconnect and test recovery: `value` = "down" | "up" | "drop:<secs>" (drop cuts the connection, holds ≤ secs, then ALWAYS restores). With `expect` it asserts that text (e.g. a 'connection dropped' recovery toast) appears on the OFFLINE screen. E.g. {"action":"network","value":"drop:12","expect":"connection dropped","description":"cut the connection mid-stream; the recovery toast must appear"}. Reference variables as ${VAR}. Enter a TOTP 2FA code with ${totp:VAR} (VAR holds a base32 secret). For an EMAILED code, use the `email_otp` action: `target` is the code input field, optional `value` filters the email (e.g. "from:no-reply@app.com" or "subject:verification"); it reads the scenario owner's Composio-connected Gmail and fills the code (the owner must have an ACTIVE Composio Gmail connection). It does NOT submit the verification form; follow it with an explicit `click` on Continue/Verify or a `key` Return step, then assert content inside the product. Example login with an emailed 2FA code: [{"action":"open_url","value":"${APP_URL}"},{"action":"type","target":"email field","value":"${EMAIL}"},{"action":"type","target":"password field","value":"${PASSWORD}"},{"action":"click","target":"Sign In button"},{"action":"email_otp","target":"verification code field","value":"subject:verification"},{"action":"click","target":"Verify","expect":"Dashboard"}] | |
| api_key | No | MCP API key | |
| app_url | No | App base URL as the VM reaches it — a dev server, a deployed app, or any public URL. No build/deploy is required; the vanilla tester VM just opens this URL. | |
| secrets | No | JSON object of SECRET values the steps reference via ${VAR}/${totp:VAR} — password, base32 TOTP seed, etc., e.g. {"PASSWORD":"hunter2","OTP_SECRET":"JBSWY3DPEHPK3PXP"}. Saved (encrypted) in your key store, scoped per app, so the scenario can be re-run later — including bulk re-runs that can't prompt for input. Every ${VAR} a step uses must resolve on re-run: put NON-SECRET values in `variables` and SECRET ones here (or have them already stored for this app), otherwise the create is rejected. | |
| app_name | Yes | Stable app key, e.g. 'knostra' — groups history | |
| build_id | No | Optional EXISTING variant/build id to associate (metadata only — reuses a build already present, never triggers a new build). Requires project_id. | |
| scenario | Yes | Stable scenario name, e.g. 'smoke-login' | |
| variables | No | Optional JSON object of NON-SECRET default variables for ${VAR} substitution, e.g. {"APP_URL":"http://10.0.2.2:3000","EMAIL":"a@b.com"}. Put passwords / TOTP seeds in `secrets` (they're saved to your key store), not here. | |
| project_id | No | Project to file this scenario under (proj-… id from your projects). Makes it show up under that project in the cto-gui graphs / right test panel. Must be a project you own. If omitted, the scenario is filed under your auto-created default 'App Tests' project (every test belongs to a project). | |
| description | No | ALWAYS provide this: a concise, human 'what this test verifies' sentence describing the test's GOAL — not a list of steps. Shown at the top of the test panel when the test is opened. E.g. 'Signs in and verifies the Usherpa integration's tool catalog loads.' or 'Sends a long prompt and confirms the reply streams without freezing.' If omitted, a readable summary is auto-generated from the step semantics, but an authored one is better. | |
| browser_auth | No | Run this test SIGNED IN: restores the owner's prepared, encrypted browser profile (stored once per app origin + Composio account) before the first open_url — no login steps or password secrets needed. Shape: {provider:'composio', connection_id:str}. Requires app_url. Prepare the profile once in the dashboard (the test's Sign-in section, or a Walk's 'With login' — same store); creating without a prepared profile fails with browser_profile_not_ready. Mutually exclusive with incognito steps. Re-calling create_app_scenario for an existing test (upsert) attaches it. | |
| session_token | No | Session token | |
| fail_on_error_toast | No | Default True: automatically FAIL the run if a known error bubble/toast appears on any step. Set False only for apps that legitimately render error-like copy. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||