SDODS
Getting started

A hybrid scenario

Seed state through the API and verify it in the browser within one scenario.

What you'll learn

Why SDODS uses one merged fixture set, how a scenario chains API responses into UI steps, and how a leased user starts the browser already logged in.

Why one fixture set matters

Frameworks that keep separate test objects for UI and API cannot mix them in one scenario. SDODS has a single test with API, page, data, user, screenshot and heal fixtures, so a scenario can prepare state over HTTP and assert in the browser without glue code.

The feature

projects/demo-shop/features/hybrid/seed-then-verify.feature:

@hybrid @regression
Feature: Seed a post and see it in the UI
  Scenario: API seeds, UI verifies
    Given I use a leased user with role "standard"
    When I seed via POST "/posts" with body:
      """json
      { "title": "SDODS {{username}}", "userId": 1 }
      """
    And I save the response JSON path "title" as "title"
    And I mock "**/inventory.html" with HTML:
      """
      <main><h1>{{title}}</h1><p>rendered from the seeded API response</p></main>
      """
    And I navigate to the "inventory" page
    Then the UI should show the text from JSON path "title"

What happens:

  1. I use a leased user takes an account of role standard from the pool for this worker and applies its cached storage state to the browser context.
  2. I seed via POST uses the API client bound to envs/staging.yaml.
  3. Variables captured from the response flow into later steps through {{title}}.
  4. The mock step answers the UI request with the seeded value so the demo works against a public sandbox; against your own application you would skip the mock and assert on real data.

Run it here — watch the title the API returns arrive in the browser panel, and note that the browser starts on the products page because the leased user brought its own storage state:

@hybridWhat the API stores is what the page shows

A merchandiser renames a listing and the storefront keeps showing the old title for an hour. Nadia wants a scenario that creates a listing over HTTP and then proves the page renders that exact title — no clicking through a form to get there.

Done means

  • The scenario starts already signed in, using an account leased from the pool.
  • The listing is created over HTTP, in one step, not through the UI.
  • The page is asserted against the value the API returned, not a hard-coded string.
The scenario

@hybrid@regression· lint clean · 7 steps

https://www.saucedemo.com/chromium

Swag Labs

Login

Accepted usernames: standard_user, problem_user, performance_glitch_user, locked_out_user. Password: secret_sauce.

MaxiThis is the one frameworks usually cannot do: one scenario, one set of fixtures, an HTTP call and a browser assertion that share their variables. Watch the value travel.
  1. not run: Given I use a leased user with role "standard"
  2. not run: When I seed via POST "/posts" with body:
  3. not run: Then the response status should be 201
  4. not run: When I save the response JSON path "title" as "title"
  5. not run: And I mock "**/inventory.html" with HTML:
  6. not run: And I navigate to the "inventory" page
  7. not run: Then the UI should show the text from JSON path "title"

Run the same scenario on your machine:

sdods run -p demo-shop -e staging -l hybrid -b chromium

Run it

bun run sdods run -p demo-shop -e staging -l hybrid -b chromium

Hybrid scenarios take screenshots for UI steps and attach request and response JSON for API steps, so the run viewer shows the whole story.

Next steps

Using an AI coding agent? Install SDODS:

Install the SDODS plugin in Claude Code: skills, subagents, commands and the MCP server.

  1. /plugin marketplace add YarlisAISolutions/sdods-skills
  2. /plugin install sdods@sdods
Learn more about using SDODS with AI tools

On this page