Chrome DevTools + Storybook Browser Tests
Use the project-0-spark-chrome-devtools MCP server to run browser-level tests and interactions against local Storybook stories. Storybook renders stories inside iframes on the docs pages, so you must always target the underlying iframe.html story URL to avoid unnecessary DOM exploration.
When to Use
- User asks for browser-based testing or visual checks of a Storybook component
- User mentions chrome devtools, CDP, DevTools MCP, or similar
- User provides a Storybook URL on
http://localhost:6006 (or another Storybook host)
- You need to interact with a specific story (click, type, focus, keyboard navigation, screenshots, etc.)
Storybook URL Rules
Storybook has two kinds of URLs:
- Docs pages (outer shell with iframes and MDX):
http://localhost:6006/?path=/docs/components-accordion--docs
- Story iframes (what you actually want to test):
http://localhost:6006/iframe.html?id=components-accordion--default&viewMode=story
Always navigate chrome-devtools to the iframe URL, not the docs page.
Converting docs/story URLs to iframe URLs
Docs page URL (?path=/docs/...):
- Example:
http://localhost:6006/?path=/docs/components-accordion--docs
- Extract the part after
/docs/ and before --docs → here: components-accordion
- Build the default story id by appending
--default:
id=components-accordion--default
- Final iframe URL:
http://localhost:6006/iframe.html?id=components-accordion--default&viewMode=story
Story page URL (?path=/story/...):
- Example:
http://localhost:6006/?path=/story/components-accordion--with-icon
- Extract everything after
/story/ → here: components-accordion--with-icon
- Use this as the
id directly:
id=components-accordion--with-icon
- Final iframe URL:
http://localhost:6006/iframe.html?id=components-accordion--with-icon&viewMode=story
Other query params:
- Always include
viewMode=story in the iframe URL.
- If the user provides
globals, args, or other query parameters, append them to the iframe URL as-is.
Examples
User URL: http://localhost:6006/?path=/docs/components-accordion--docs
→ Use with chrome-devtools:
http://localhost:6006/iframe.html?id=components-accordion--default&viewMode=story
User URL: http://localhost:6006/?path=/story/components-accordion--with-icon
→ Use with chrome-devtools:
http://localhost:6006/iframe.html?id=components-accordion--with-icon&viewMode=story
Using the chrome-devtools MCP
Resolve the correct Storybook URL
- If the user gives a docs or story URL (
?path=/docs/... or ?path=/story/...), first convert it to the corresponding iframe.html URL as described above.
- If the user already gives an
iframe.html URL with an id and viewMode, use it directly.
Navigate directly to the iframe URL
- In your MCP calls to
project-0-spark-chrome-devtools, never ask it to search inside the docs page for the story iframe.
- Instead, instruct it to open the computed
iframe.html URL directly. This avoids the extra layer of Storybook UI and speeds up tests.
Run interactions and checks
- Once on the iframe URL, interact with the component as if it were a standalone page:
- Find elements by role, text, or data attributes
- Perform clicks, keyboard navigation, focus/blur, etc.
- Take screenshots or inspect DOM/CSS as needed
Assumptions
- Storybook is running locally on
http://localhost:6006 unless the user specifies another base URL.
- Component IDs follow the standard Storybook pattern (
<group>-<component>--<storyName>).
- The
--default story name exists for docs pages when you derive it from ...--docs.
By always converting to the iframe.html URL first, the chrome-devtools MCP avoids wasting time exploring Storybook’s outer docs UI and directly loads the markup for the story under test.
Source: leboncoin/spark-web — distributed by TomeVault.
1---2name: chrome-devtools-storybook3description: Use the chrome-devtools MCP to run browser tests on local Storybook stories by navigating directly to `iframe.html` story URLs instead of the outer docs pages. Use when this capability is needed.4---56# Chrome DevTools + Storybook Browser Tests78Use the `project-0-spark-chrome-devtools` MCP server to run browser-level tests and interactions against local Storybook stories. Storybook renders stories inside iframes on the docs pages, so you must always target the underlying `iframe.html` story URL to avoid unnecessary DOM exploration.910## When to Use1112- User asks for **browser-based testing** or **visual checks** of a Storybook component13- User mentions **chrome devtools**, **CDP**, **DevTools MCP**, or similar14- User provides a **Storybook URL on `http://localhost:6006`** (or another Storybook host)15- You need to **interact with a specific story** (click, type, focus, keyboard navigation, screenshots, etc.)1617## Storybook URL Rules1819Storybook has two kinds of URLs:2021- **Docs pages** (outer shell with iframes and MDX): 22 `http://localhost:6006/?path=/docs/components-accordion--docs`23- **Story iframes** (what you actually want to test): 24 `http://localhost:6006/iframe.html?id=components-accordion--default&viewMode=story`2526**Always navigate chrome-devtools to the iframe URL**, not the docs page.2728### Converting docs/story URLs to iframe URLs29301. **Docs page URL** (`?path=/docs/...`):31 - Example: `http://localhost:6006/?path=/docs/components-accordion--docs`32 - Extract the part after `/docs/` and before `--docs` → here: `components-accordion`33 - Build the default story id by appending `--default`:34 - `id=components-accordion--default`35 - Final iframe URL:36 - `http://localhost:6006/iframe.html?id=components-accordion--default&viewMode=story`37382. **Story page URL** (`?path=/story/...`):39 - Example: `http://localhost:6006/?path=/story/components-accordion--with-icon`40 - Extract everything after `/story/` → here: `components-accordion--with-icon`41 - Use this as the `id` directly:42 - `id=components-accordion--with-icon`43 - Final iframe URL:44 - `http://localhost:6006/iframe.html?id=components-accordion--with-icon&viewMode=story`45463. **Other query params**:47 - Always include `viewMode=story` in the iframe URL.48 - If the user provides `globals`, `args`, or other query parameters, append them to the iframe URL as-is.4950### Examples5152- User URL: `http://localhost:6006/?path=/docs/components-accordion--docs` 53 → Use with chrome-devtools: 54 `http://localhost:6006/iframe.html?id=components-accordion--default&viewMode=story`5556- User URL: `http://localhost:6006/?path=/story/components-accordion--with-icon` 57 → Use with chrome-devtools: 58 `http://localhost:6006/iframe.html?id=components-accordion--with-icon&viewMode=story`5960## Using the chrome-devtools MCP61621. **Resolve the correct Storybook URL**63 - If the user gives a docs or story URL (`?path=/docs/...` or `?path=/story/...`), **first convert it** to the corresponding `iframe.html` URL as described above.64 - If the user already gives an `iframe.html` URL with an `id` and `viewMode`, use it directly.65662. **Navigate directly to the iframe URL**67 - In your MCP calls to `project-0-spark-chrome-devtools`, **never ask it to search inside the docs page for the story iframe**.68 - Instead, instruct it to open the computed `iframe.html` URL directly. This avoids the extra layer of Storybook UI and speeds up tests.69703. **Run interactions and checks**71 - Once on the iframe URL, interact with the component as if it were a standalone page:72 - Find elements by role, text, or data attributes73 - Perform clicks, keyboard navigation, focus/blur, etc.74 - Take screenshots or inspect DOM/CSS as needed75764. **Assumptions**77 - Storybook is running locally on `http://localhost:6006` unless the user specifies another base URL.78 - Component IDs follow the standard Storybook pattern (`<group>-<component>--<storyName>`).79 - The `--default` story name exists for docs pages when you derive it from `...--docs`.8081By always converting to the `iframe.html` URL first, the chrome-devtools MCP avoids wasting time exploring Storybook’s outer docs UI and directly loads the markup for the story under test.8283---84> Source: [leboncoin/spark-web](https://github.com/leboncoin/spark-web) — distributed by [TomeVault](https://tomevault.io).85<!-- tomevault:4.0:skill_md:2026-07-08 -->