Docs menuScenario Lab

DocsGit and workflows

Scenario Lab

Test your local web app against empty data, errors, slow responses and more.

Real users hit empty lists, expired sessions, slow networks and missing permissions far more often than your test data does. Scenario Lab opens your local web app in an isolated browser, replaces chosen API responses with ones you write, and checks the page shows what it should. No AI or account needed.

Create a scenario

  1. Start your app's development server as usual.
  2. Open Scenario Lab from its icon in the activity bar, or View → Scenario Lab, and click New scenario.
  3. Enter your app's local URL, for example http://localhost:3000.
  4. Start from a template (empty data, insufficient permissions, expired session, delayed response or large dataset) and adapt it to your app's API paths and page.
  5. Click Save & run and confirm. A separate preview window opens and the checks run.

Fake API responses

Each mock answers one method and path:

Mock responses
[
  { "path": "/api/items", "method": "GET", "status": 200, "body": [], "delayMs": 0 }
]
  • The method and path must match exactly; query strings are ignored.
  • delayMs (up to 5 seconds) simulates a slow server.
  • A mock that's never requested fails the run, so you know it didn't apply.

Checks

Browser checks
[
  { "selector": "[data-testid=empty-state]", "contains": "No items" }
]

Each check finds an element by CSS selector and tests that its text contains the given string (case-sensitive). An empty contains just checks the element exists. With no checks, a run is a PREVIEW, never a pass.

Conditions

SettingUse it to test…
Viewport (320×240 to 2560×1440)Phone, tablet and desktop layouts
Language and localeTranslations, date and number formats
Time zoneDates near midnight and across zones
Offline after loadWhat happens when the connection drops
Delay before checksLoading states: make the mock slower than this delay

Results

A run ends PASSED, FAILED, CANCELLED or PREVIEW, with each check's result, how many requests were mocked or blocked, and timing. The preview window stays open so you can look around. Close it, or use Close preview / cancel run. Editing a scenario clears its old result.

Safety

  • Only localhost, 127.0.0.1 and [::1] addresses are allowed.
  • Each run uses a fresh, private browser session with no access to Lamied and no shared cookies. Requests to other sites, live WebSockets, and write requests (POST, PUT…) that you haven't mocked are blocked.
  • Your code, your server and your normal browser are never changed.

Limits

20 mocks and 20 checks per scenario, a 10-second maximum wait before checks, and 30 seconds per run. Runs use Chromium only. Save scenarios into a Task Workspace to share them.