No slash command · from story-flow
Executes BDD test scenarios from .feature files using browser automation via Playwright MCP tools. Runs background steps, scenario steps, and assertions, stopping on failure.
Ships in story-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
mcp__plugin_story-flow_playwright__* tools to manipulate browser to EXECUTE the BDD scenarios directly without generating any Playwright test file. A scenario with no browser or app step runs in the shell instead; see Command-line Scenarios.@purge-data)subagent_type="general-purpose" to run it in isolated context sequentially:
Load skills in this order using the Skill tool:
1. First: `story-flow:execute-bdd-scenario` (plugin - general BDD framework)
2. Then: `execute-bdd-scenario` if it exists (project-level - overrides/extends the plugin)
3. Confirm which skills are loaded before continuing with the execution.
Execute BDD scenario <SCENARIO-ID> in @path/to/file.feature [--record if recording mode is active].
End your reply with `RESULT: PASSED`, `RESULT: FAILED`, `RESULT: UNIT TESTED` or `RESULT: UNIT TEST GAP`.
IMPORTANT: Replace <SCENARIO-ID> with the individual scenario ID (e.g., ARMR-01), NOT "all". Each subagent executes exactly one scenario.
Recording Mode: When executing multiple scenarios with --record, pass the --record flag to each subagent prompt. Each subagent is responsible for generating/updating the .spec.js file after executing its scenario — do NOT defer spec file generation to the parent orchestrator.| Scenario | Title | Result |
|----------|-------|--------|
| SMG-01 | Display available languages | ✓ PASSED |
| SMG-02 | Search and filter strings | ✗ FAILED |
| SMG-03 | Inline edit a string value | ⊘ SKIPPED |
.feature files in the same folder as the stories.@screenshots tag, take one screenshot per assertion group — a maximal run of consecutive assertion steps with no action or wait step between them, since nothing re-renders in between — captured after the group's last UI assertion so every asserted condition has settled, and, in --record mode when VRT is configured, emit one visual regression tracking call per group (see Visual Regression Testing (VRT)). Command and polling assertion steps (S3/CLI/API checks) assert outside the viewport: they take no screenshot and do not break the group. Always scroll the group's asserted elements into view before the shot, because viewport sizes differ between runs. Pass browser_take_screenshot a filename explicitly prefixed with .playwright-mcp/ — e.g. .playwright-mcp/SMG-01-i-should-see-the-dashboard.png so it lands in the .playwright-mcp output folder — never an absolute path, which writes to the project root.@screenshots tag, do not take any screenshot.@purge-data tag, restore the seed data first (before the Background steps) by executing the make reseed command.@purge-data tag, do not restore the seed data before running the scenario.@timeout-* tag, extend the scenario and expect timeout to be longer. e.g. @timeout-600s means timeout for the scenario and every expect step is 600s(10m).@non-parallel has no effect on direct execution, which already runs scenarios sequentially (see Executing Multiple Scenarios). It only changes the recorded spec; see Non-parallel Scenarios.mcp__plugin_story-flow_playwright__browser_run_code_unsafe to set the browser offline.BASE_URL, falling back to use.baseURL in the project's @playwright.config.js. Never hardcode a host.A scenario is command-line when none of its steps, Background included, drives a UI: every step runs a command, calls an API, or reads a file or service. Decide from the steps. A project without package.json or playwright.config.js usually has only command-line scenarios, but a web app in another language still needs a browser.
mcp__plugin_story-flow_playwright__*, mcp__plugin_story-flow_appium__* or mcp__plugin_story-flow_chrome-devtools__* tools.BASE_URL, playwright.config.js, screenshots, @screenshots, VRT, locator discovery and the browser wait strategies don't apply..feature file, a report or a recorded test. Report "credentials found" without the value.@integration marks a command-line scenario that reaches real external services or needs real credentials. Execute a scenario without it as usual, but --record writes no test for it. Instead, search the project's unit tests for each of its Then assertions, and for each Examples row of an outline. A test that only calls the same function does not count; it must assert the same outcome.
apps/x/tests/test_settle.py::test_reporter_edit_restarts_wait.↳ UNIT TESTED or ⚠ UNIT TEST GAP. Neither counts as passed or failed, and a gap does not stop the run.--record for an @integration scenario in a project with no Node toolchain writes a test for the project's own runner, e.g. pytest, instead of a .spec.js. The recording rules carry over unchanged: tags first, Background as helpers, replace the test with the same ID and keep the rest. [RECORD_COMMAND] and [RECORD_POLL] become the language's subprocess call with an argument list rather than a shell string, asserting on exit code, stdout and stderr. A project-level execute-bdd-scenario skill names the file, test naming, tag mapping and the commands to run and lint it.| Variable | Description | Default |
|---|---|---|
APPIUM_DEVICE_NAME | Local device name or emulator | emulator-5554 (Android) |
APPIUM_UDID | Local iOS device or simulator UDID | - |
APPIUM_APP_PACKAGE | Local Android app package unique identifier | - |
APPIUM_APP_ACTIVITY | Local Android app launcher activity | .MainActivity |
APPIUM_BUNDLE_ID | Local iOS app bundle identifier | - |
BROWSERSTACK_USERNAME | BrowserStack username | - |
BROWSERSTACK_ACCESS_KEY | BrowserStack access key | - |
BROWSERSTACK_APP_ID | Uploaded app ID (bs://...) | - |
Mode detection: When all 3 BrowserStack variables are set, use BrowserStack. Otherwise, use local Appium.
Start Appium server: npx appium server --port 4723. Appium ships no drivers — install uiautomator2 for Android, xcuitest (with Xcode) for iOS.
A hybrid app's webview needs no extra driver: switch with driver.switchContext('WEBVIEW_...') and UiAutomator2 proxies to a Chromedriver it downloads to match the app's webview engine, while XCUITest drives Safari's remote debugger. Pin a mismatched build with appium:chromedriverExecutable rather than installing the standalone chromium driver, which automates desktop Chrome, not app webviews.
WebdriverIO options — Android:
{
hostname: "localhost",
port: 4723,
waitforTimeout: 30000,
waitforInterval: 500,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
capabilities: {
platformName: "Android",
"appium:deviceName": process.env.APPIUM_DEVICE_NAME || "emulator-5554",
"appium:automationName": "UiAutomator2",
"appium:appPackage": process.env.APPIUM_APP_PACKAGE,
"appium:appActivity": process.env.APPIUM_APP_ACTIVITY || ".MainActivity",
"appium:autoGrantPermissions": true,
"appium:noReset": true,
"appium:fullReset": false,
"appium:forceAppLaunch": true,
},
}
WebdriverIO options — iOS:
{
hostname: "localhost",
port: 4723,
waitforTimeout: 30000,
waitforInterval: 500,
// The first session builds WebDriverAgent, which exceeds the 30s Android uses
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
capabilities: {
platformName: "iOS",
"appium:udid": process.env.APPIUM_UDID,
"appium:automationName": "XCUITest",
"appium:bundleId": process.env.APPIUM_BUNDLE_ID,
"appium:noReset": true,
"appium:fullReset": false,
"appium:forceAppLaunch": true,
},
}
appium:noReset keeps the app's data — a signed-in session — between runs; appium:forceAppLaunch still relaunches it, so each scenario starts from a fresh launch as it does on BrowserStack, not wherever the last run left it.
appium:autoGrantPermissions and appium:appActivity are Android-only — never carry them into the iOS capabilities. Do not add appium:autoAcceptAlerts either: it swallows alerts a scenario asserts on.
When all 3 BrowserStack env vars are set, connect to BrowserStack cloud instead of local Appium. Start BrowserStackLocal binary before running tests. Stop BrowserStackLocal after tests complete. Use the WebDriver REST API directly by curl instead of Appium MCP or WebDriverIO library.
WebdriverIO options:
{
hostname: "hub-cloud.browserstack.com",
port: 443,
protocol: "https",
path: "/wd/hub",
waitforTimeout: 30000,
waitforInterval: 500,
connectionRetryTimeout: 60000,
connectionRetryCount: 3,
capabilities: {
"bstack:options": {
buildName: ${featureName},
sessionName: ${scenarioName},
deviceName: "Google Pixel 9",
osVersion: "16",
userName: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY,
},
platformName: "Android",
"appium:app": process.env.BROWSERSTACK_APP_ID,
"appium:automationName": "UiAutomator2",
},
}
mcp__plugin_story-flow_appium__* tools or WebDriver REST API directly by curl to manipulate mobile app to EXECUTE the BDD scenarios directly without generating any Playwright test file..appium-mcp folder using absolute paths (e.g., /path/to/project/.appium-mcp/screenshot.png). The Appium MCP tool does not support relative paths.appium_get_page_source or REST API) for:
waitForDisplayed, waitForEnabled, waitForExist, waitForClickable and waitUntil.
waitforTimeout from appiumOptions (default: 30000ms){ timeout: X } when an operation is known to take longer than the default (e.g., network fetches, large file operations)// CORRECT - uses default waitforTimeout (30s)
await element.waitForDisplayed();
// CORRECT - custom timeout for slow operation
await slowNetworkElement.waitForDisplayed({ timeout: 60000 });
// WRONG - redundant timeout same as default
await element.waitForDisplayed({ timeout: 30000 });
@screenshots tag — always scroll the asserted elements into view firstVisual regression compares each screenshot against an approved baseline in a self-hosted Visual Regression Tracker (VRT) instance, which provides a web UI for approve/reject. This is wired only into --record mode — the generated Playwright spec calls the VRT SDK natively. Direct (non-record) execution is unaffected: @screenshots captures the same per-assertion-group set, just untracked.
The spec imports @visual-regression-tracker/agent-playwright to track a browser page, and @visual-regression-tracker/sdk-js to track a mobile app screen — the mobile app is driven by WebdriverIO, which no VRT agent covers, and sdk-js (the base the Playwright agent wraps) tracks an image from any source.
Provisioning is out of scope for this plugin. Standing up the VRT stack (Docker, ports, creating the project and API key) and installing the SDK the generated spec imports are the consuming project's responsibility. The skill assumes VRT is reachable whenever the VRT_* env vars are set — the same way it assumes a BrowserStack account exists when BROWSERSTACK_* is set.
| Variable | Description | Default |
|---|---|---|
VRT_APIURL | VRT backend API URL | http://localhost:4200 |
VRT_PROJECT | VRT project name or ID | - |
VRT_APIKEY | VRT user API key | - |
VRT_BRANCHNAME | Baseline branch | Current git branch |
VRT_CIBUILDID | Groups every worker's start() into one VRT build | Current git SHA |
VRT_ENABLESOFTASSERT | true = collect diffs without throwing; review in UI | true |
Build scope: one build per commit, not per feature file. The VRT backend upserts a build on (project, ciBuildId), so defaulting VRT_CIBUILDID to the current git SHA makes every Playwright worker's start() resolve to the same build. Re-running the suite on the same commit appends to that commit's build — set VRT_CIBUILDID explicitly (e.g. a CI run id) when each re-run needs its own.
Mode detection: When running with --record and VRT_APIURL, VRT_APIKEY, and VRT_PROJECT are all set, the generated spec for a @screenshots scenario tracks each screenshot in VRT. Otherwise (no --record, or any of the three unset), @screenshots captures screenshots only. Both SDKs read the VRT_* variables natively, so generated specs carry no inline credentials.
Run-time detection: Record-time config controls whether VRT wiring is emitted; the env vars control whether it runs. The generated spec re-checks VRT_APIURL, VRT_APIKEY, VRT_PROJECT, and VRT_BRANCHNAME at run time via an isVrtEnabled flag (see VRT wiring), so a spec recorded with VRT configured degrades to screenshot-only on machines and CI jobs without those vars instead of failing the suite.
Soft-assert default: Default VRT_ENABLESOFTASSERT to true so diffs are collected for review rather than hard-failing the test — the safer default given a human approval step and unavoidable first-run "new image" states.
VRT_ENABLESOFTASSERT=true (default): diffs do not fail the test; a human approves/rejects in the UI. Covers first runs / baseline establishment cleanly.VRT_ENABLESOFTASSERT=false (opt-in strict mode): a new/unapproved/changed image fails the test, and the failure includes the VRT diff link.IMPORTANT: The VRT SDK's own native default for soft-assert is false. When VRT_ENABLESOFTASSERT is unset, the generated spec MUST set it explicitly to true — do not rely on the SDK default.
First run / approval flow: Images with no baseline appear as "new" in the VRT UI. Approving them creates the baseline, keyed by Project + Name + Branch + OS + Browser + Viewport + Device + Custom Tags — so name must be reproducible across recordings, otherwise a re-record orphans the approved baseline and shows up as a spurious "new" image. The key has no environment dimension, so give each environment its own VRT_PROJECT.
The Playwright agent fills OS, Browser and Viewport itself; the mobile helpers must supply them from the Appium capabilities (see VRT wiring). A local emulator and a BrowserStack device therefore hold separate baselines — both still report into the one VRT_CIBUILDID build.
Every tracked browser image is captured with animations: 'disabled'. The helpers apply it (see VRT wiring), so it is never spelled out per call.
IMPORTANT: The SDK forwards screenshotOptions to Playwright's page.screenshot(), not toHaveScreenshot(). page.screenshot() defaults to animations: 'allow'; only toHaveScreenshot() flips it to 'disabled'. Since VRT bypasses toHaveScreenshot, the comparison-safe default is not inherited and MUST be set explicitly — the same trap as VRT_ENABLESOFTASSERT above.
animations: 'disabled' does: finite CSS animations, CSS transitions, and Web Animations are fast-forwarded to their end state (so transitionend fires); infinite ones are cancelled to their initial state and resumed after the shot.<video>, animated GIF/APNG, canvas/WebGL, and JS animations driven by requestAnimationFrame/setTimeout rather than the Web Animations API. Exclude those regions with ignoreAreas.trackElementHandle takes the same options via elementHandle.screenshot(), so trackVisualElement gets the same default.Anything passed as screenshotOptions in a [RECORD_VISUAL] annotation merges over this default, so { fullPage: true } still captures with animations disabled. Only an explicit { animations: 'allow' } overrides it.
Mobile app shots have no equivalent — screenshotOptions is a Playwright option, so never record it for a driver or app element target. A device screenshot is stabilised only by when it is taken: after the assertion group's last waitForDisplayed/waitForEnabled has resolved. Content that is never pixel-identical between runs — a playing video, a Lottie or splash animation, a live clock, an auto-advancing carousel — has to be excluded with ignoreAreas instead; take each rectangle from the element's bounds in the page source XML.
When the --record flag is present in the input, generate a Playwright .spec.js file after executing every scenario by recording actions and expectations during execution.
When recording, capture both feature-level tags (above the Feature: line) and scenario-level tags. Output them BEFORE recording any other steps (including Background):
[RECORD_TAG]
scenario: "DAS-01: Finish onboarding"
featureTags: ["@e2e", "@auth"]
tags: ["@purge-data"]
[/RECORD_TAG]
Annotation fields:
scenario: The scenario ID and titlefeatureTags: Feature-level tags (above the Feature: line) — inherited by all scenarios in the file. Empty array [] when the feature has no tags.tags: Scenario-level tags applied only to this scenario.Example: Feature with @e2e @auth and scenario with @purge-data
Feature file:
@e2e @auth
Feature: App Settings
Background:
Given I extract appId from S3
And I set localStorage
@purge-data
Scenario: DAS-01: Finish onboarding
Given I am on the onboarding page
Recording output:
[RECORD_TAG]
scenario: "DAS-01: Finish onboarding"
featureTags: ["@e2e", "@auth"]
tags: ["@purge-data"]
[/RECORD_TAG]
Generated Playwright code (note: feature tags precede scenario tags in the test name; tag action comes BEFORE Background helper call):
test('DAS-01: Finish onboarding @e2e @auth @purge-data', async ({ page, context, baseURL }) => {
// @purge-data - Restore the seed data to initial state (runs FIRST)
execSync('make reseed', { stdio: 'inherit' });
// Background (runs SECOND)
await setupBackground(context, baseURL);
// Scenario steps (runs THIRD)
// Given I am on the onboarding page
await page.goto('/onboarding');
});
Background steps are converted to reusable helper functions at the top of the generated spec file. This eliminates code duplication and makes tests self-contained.
CRITICAL: When recording, you MUST:
[RECORD_HELPER] annotation[RECORD_HELPER] Annotation FormatWhen recording Background steps, output a helper function definition:
[RECORD_HELPER]
name: extractAppIdFromS3
params: []
returns: "string"
body: |
const output = execSync(
`aws --endpoint-url=${process.env.S3_ENDPOINT} s3 ls s3://apps/`,
{ encoding: "utf-8" }
);
return output.match(/PRE ([a-f0-9-]{36})\//)?.[1] ?? "";
[/RECORD_HELPER]
Annotation fields:
name: Function name (camelCase, descriptive)params: Array of typed parameters (e.g., ["context: BrowserContext", "appId: string"]) — the types are metadata; the generated JavaScript emits names only: async function setupBackground(context, appId)returns: Return type (e.g., "string", "Promise<void>", "Promise<string>") — not emitted either; it signals whether to await the call and capture its valuebody: The function implementation (multiline supported)Create composite helpers when multiple Background steps work together:
[RECORD_HELPER]
name: setupBackground
params: ["context: BrowserContext"]
returns: "Promise<string>"
body: |
const appId = extractAppIdFromS3();
await setLocalStorageAppId(context, appId);
await setCookies(context);
return appId;
[/RECORD_HELPER]
Guidelines:
extractAppIdFromS3, setCookies)setupBackground)appId), the composite helper should return itWhen a Background step extracts a value (e.g., appId from S3), create a helper that returns the value:
[RECORD_HELPER]
name: extractAppIdFromS3
params: []
returns: "string"
body: |
const output = execSync(
`aws --endpoint-url=${process.env.S3_ENDPOINT} s3 ls s3://apps/`,
{ encoding: "utf-8" }
);
return output.match(/PRE ([a-f0-9-]{36})\//)?.[1] ?? "";
[/RECORD_HELPER]
The value is then available in the test via the composite helper's return value:
test('DAS-02: Delete image', async ({ page, context }) => {
// Background (returns appId for use in scenario)
const appId = await setupBackground(context);
// Scenario steps can now use appId...
});
After each action step, output a structured annotation.
Before recording the locator field: Discover the element's scoped locator chain by evaluating its ancestors in the UI hierarchy (see Locator Strategies). No exceptions — even if you already know the element's data-testid, you must discover its full ancestor chain to build the scoped locator.
CRITICAL: After discovering the scoped locator chain, you MUST use ALL entries in the chain for the locator field. e.g. If the chain returns:
[{ testid: "ShareButton" }, { testid: "Container" }]
Then the locator MUST be:
page.getByTestId('Container').getByTestId('ShareButton')
NOT:
page.getByTestId('ShareButton')
[RECORD_ACTION]
step: "When I click the \"Cancel\" button in the dialog"
method: click
locator: page.getByRole('dialog').getByRole('button', { name: 'Cancel' })
[/RECORD_ACTION]
Annotation fields:
step: The exact Gherkin step text (becomes a comment in generated code)method: The Playwright action methodlocator: The Playwright locator used to find the elementvalue: For fill/type/evaluate actions (optional)extract: Variable name to store extracted value (for execSync)pattern: Regex pattern to extract value from output (for execSync)args: Array of arguments to pass to evaluate function (for evaluate with args)Handling Ordinal Qualifiers:
When BDD steps contain ordinal words (first, second, third, last), include the appropriate Playwright method directly in the locator field:
| Ordinal Word | Append to Locator |
|---|---|
| first | .first() |
| second | .nth(1) |
| third | .nth(2) |
| last | .last() |
Example - BDD step with "first":
And I click the close icon button on the first image
Recording output:
[RECORD_ACTION]
step: "And I click the close icon button on the first image"
method: click
locator: page.getByTestId('Images').getByTestId('DeleteButton').first()
[/RECORD_ACTION]
When a BDD step contains an ordinal qualifier, you MUST append the corresponding method to the locator to avoid strict mode violations.
Recording URLs:
Record goto, waitForURL and toHaveURL values as a path (/settings), never an absolute URL — they resolve against use.baseURL in the project's playwright.config.js, so one spec runs against any environment. Keep an absolute URL only when the step deliberately leaves the application's origin, e.g. an external identity provider.
Supported action methods:
| method | Generated Code |
|---|---|
goto | await page.goto(value) |
click | await locator.click() |
fill | await locator.fill(value) |
type | await locator.pressSequentially(value) |
selectOption | await locator.selectOption(value) |
check | await locator.check() |
uncheck | await locator.uncheck() |
evaluate | await page.evaluate(value) or await page.evaluate(value, ...args) |
execSync | const output = execSync(value, { encoding: 'utf-8' }); extract = output.match(pattern)?.[1] |
setInputFiles | await locator.setInputFiles(value) |
keyboardPress | await page.keyboard.press(value) |
keyboardDown | await page.keyboard.down(value) |
keyboardUp | await page.keyboard.up(value) |
scrollIntoView | await locator.scrollIntoViewIfNeeded() |
waitFor | await locator.waitFor() |
waitForURL | await page.waitForURL(value) |
waitForLoadState | await page.waitForLoadState(value) |
After verifying each assertion step, output a structured annotation.
Before recording the locator field: Discover the element's scoped locator chain by evaluating its ancestors in the UI hierarchy (see Locator Strategies). No exceptions — even if you already know the element's data-testid, you must discover its full ancestor chain to build the scoped locator.
CRITICAL: After discovering the scoped locator chain, you MUST use ALL entries in the chain for the locator field. e.g. If the chain returns:
[{ testid: "ShareButton" }, { testid: "Container" }]
Then the locator MUST be:
page.getByTestId('Container').getByTestId('ShareButton')
NOT:
page.getByTestId('ShareButton')
[RECORD_EXPECT]
step: "Then I should see 3 images in the product section"
locator: page.getByTestId('Products').getByTestId('Product').locator('img')
assertion: toHaveCount
value: 3
[/RECORD_EXPECT]
Annotation fields:
step: The exact Gherkin step text (becomes a comment)locator: The Playwright locator used to find the elementassertion: The Playwright assertion methodvalue: The expected value (optional, depends on assertion type)Supported assertions:
| assertion | Generated Code |
|---|---|
toBeVisible | await expect(locator).toBeVisible() |
toBeHidden | await expect(locator).toBeHidden() |
toHaveCount | await expect(locator).toHaveCount(value) |
toHaveText | await expect(locator).toHaveText(value) |
toContainText | await expect(locator).toContainText(value) |
toHaveValue | await expect(locator).toHaveValue(value) |
toBeEnabled | await expect(locator).toBeEnabled() |
toBeDisabled | await expect(locator).toBeDisabled() |
toHaveURL | await expect(page).toHaveURL(value) |
toHaveAttribute | await expect(locator).toHaveAttribute(name, value) |
evaluate | const ret = await locator.evaluate(func) |
Only applies when the scenario has the @screenshots tag AND VRT is configured at record time (see Visual Regression Testing (VRT)). The generated calls are additionally guarded at run time, so they no-op when the VRT_* env vars are absent. Output one [RECORD_VISUAL] annotation per assertion group per target — the same set direct execution captures — placed AFTER the group's last UI assertion's [RECORD_EXPECT] annotation so the tracking call lands once the whole group has settled. Always record the scroll as one [RECORD_ACTION] with method: scrollIntoView per asserted element in the group, immediately BEFORE the [RECORD_VISUAL] annotation — the scroll offset is part of the image, so it is part of what the baseline approves:
[RECORD_VISUAL]
step: "Then I should see the dashboard"
name: "SMG-01-i-should-see-the-dashboard"
target: page
options: { diffTollerancePercent: 1 }
[/RECORD_VISUAL]
Annotation fields:
step: The exact Gherkin step text (becomes a comment) — the group's last UI assertion step, the same step the shot is captured after, so the recorded name stays derivable from itname: Derived, never invented — see Deriving the VRT name belowtarget: the surface being captured — page or a scoped locator for a browser, driver or a discovered app element for a mobile app. Default to the whole surface (page / driver); scope to an element only when the assertion is scoped to one element and a whole-surface shot would be noisy. Discover the locator or selector per the Locator Strategies rules — no fabricated selectors. Element shots are not collapsed into the group's whole-surface shot: each distinct target is a different image, so a group containing element-scoped assertions emits one annotation per target, each recording its own step. An element target needs no recorded scroll — trackVisualElement and trackVisualAppElement scroll the element into view themselves; only a whole-surface page or driver target does.options: Optional VRT options object — diffTollerancePercent, ignoreAreas, screenshotOptions, agent. screenshotOptions is browser-only: it merges over the helpers' animations: 'disabled' default rather than replacing it, so only record it when a shot needs something extra (e.g. fullPage) — see Screenshot Options.Supported tracking calls:
| target | Generated Code |
|---|---|
page | await trackVisualPage(page, name, options) |
| locator | await trackVisualElement(locator, name, options) |
driver | await trackVisualAppScreen(driver, name, options) |
| app element | await trackVisualAppElement(driver, element, name, options) |
All four are run-time-guarded helpers defined at the top of the spec, not direct SDK calls — see VRT wiring. The browser and app helpers are named apart because one scenario can track both surfaces; the app element form takes driver first, since a WebdriverIO element cannot yield the device metadata on its own.
name is part of VRT's baseline key, so it MUST be reproducible: recording the same scenario twice has to produce byte-identical names, or the approved baseline is orphaned. Never coin a short label — derive it mechanically:
<scenario-id>[-<row-key>]-<step-slug>[-<n>]
<scenario-id> — verbatim from the feature file, keeping its original casing so it matches the generated test('SMG-01: …') name. Only the step text is lowercased.[-<row-key>] — present only for a Scenario Outline; see Scenario Outline rows below.<step-slug> — slugify the step value:
Given / When / Then / And / But).-, then trim leading and trailing -.- boundary. VRT imposes no length limit on name — this cap exists only to keep names readable in the VRT UI.[-<n>] — append -2, -3, … only when an identical name was already emitted within the same scenario (and, for an outline, the same row), numbered in emission order. Do not add a positional step index otherwise: it would shift whenever a step is inserted or reordered and orphan every downstream baseline.Each Examples: row renders a different image, so every row needs its own name — rows sharing one name collide on a single baseline and flip it back and forth on every run. VRT's customTags variant dimension is not reachable through @visual-regression-tracker/agent-playwright, so the row must be distinguished inside name:
Scenario Outline: title, in the order they appear there, and slugify that row's values for them. That is the row key. Placeholders appearing only in steps or only in Examples: are deliberately excluded — the title is the author's declaration of what distinguishes the rows.row-1, row-2, … in Examples: row order (header excluded). This fallback is positional — inserting or reordering rows orphans the affected baselines — so prefer putting the discriminating placeholder in the outline title.step records at execution time. If a step's text also contains the title's placeholder, the value simply appears twice in the name; that is harmless and not special-cased.Scenario Outline: SMG-01 Dashboard for <role>
Given I log in as "<role>" with locale "<locale>"
Then I should see the dashboard
Examples:
| role | locale | notes |
| admin | en-US | full access |
| guest | ja-JP | read only |
SMG-01-admin-i-should-see-the-dashboard
SMG-01-guest-i-should-see-the-dashboard
locale and notes are excluded because they do not appear in the title.
For steps that require command line verification (e.g., S3 state checks), output:
[RECORD_COMMAND]
step: "And the image should be deleted from S3 bucket"
command: aws --endpoint-url=${process.env.S3_ENDPOINT} s3 ls s3://apps/${appId}/assets/image.png
assertion: shouldFail
[/RECORD_COMMAND]
Annotation fields:
step: The exact Gherkin step textcommand: The shell command to executeassertion: Either shouldSucceed (command exits 0) or shouldFail (command exits non-zero)pattern: Optional regex pattern to match in outputSupported command assertions:
| assertion | Generated Code |
|---|---|
shouldSucceed | expect(() => execSync(command)).not.toThrow() |
shouldFail | expect(() => execSync(command)).toThrow() |
outputContains | expect(execSync(command, { encoding: "utf-8" })).toContain(pattern) |
outputMatches | expect(execSync(command, { encoding: "utf-8" })).toMatch(pattern) |
Shell Path Quoting:
When generating shell commands with file paths, always quote local file paths that may contain special shell characters (parentheses, spaces, $, etc.):
// WRONG - parentheses interpreted as subshell syntax
execSync(`aws s3 cp ${fixturePath}.png s3://bucket/...`);
// CORRECT - quoted path prevents shell interpretation
execSync(`aws s3 cp "${fixturePath}.png" s3://bucket/...`);
Common paths requiring quotes:
src/app/(app)/...src/My Documents/...src/feature[1]/...For mobile app scenarios that verify UI colors via screenshots, use [RECORD_COMMAND] with ImageMagick. The generated spec file uses WebdriverIO with Appium.
Recording annotation:
[RECORD_COMMAND]
step: "Then the \"Login\" button should have background in the primary color \"#9933FF\""
command: magick "${imagePath}" -crop 1x1+150+2110 txt:- | tail -1
assertion: outputContains
pattern: "#9933FF"
[/RECORD_COMMAND]
Generated imports and setup:
import { test, expect } from '@playwright/test';
import { remote } from 'webdriverio';
import { execSync } from 'child_process';
import path from 'path';
function getAppiumOptions() {
const { BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY, BROWSERSTACK_APP_ID } = process.env;
const useBrowserStack = BROWSERSTACK_USERNAME && BROWSERSTACK_ACCESS_KEY && BROWSERSTACK_APP_ID;
if (useBrowserStack) {
return {
// See "BrowserStack Configuration" section
};
}
return {
// See "Local Appium Configuration" section
};
}
Generated helper functions:
async function takeAppScreenshot(driver, filename) {
const imagePath = path.join(process.cwd(), '.appium-mcp', filename);
await driver.saveScreenshot(imagePath);
return imagePath;
}
function verifyColorAtPixel(imagePath, x, y, expectedColor) {
const output = execSync(
`magick '${imagePath}' -crop 1x1+${x}+${y} txt:- | tail -1`,
{ encoding: 'utf-8' }
);
if (!output.toUpperCase().includes(expectedColor.toUpperCase())) {
throw new Error(`Expected color ${expectedColor} at (${x},${y}), got: ${output.trim()}`);
}
}
Generated test code:
const driver = await remote(getAppiumOptions());
try {
// Take screenshot for color verification
const imagePath = await takeAppScreenshot(driver, "color-verification.png");
// Then the "Login" button should have background in the primary color "#9933FF"
verifyColorAtPixel(imagePath, 150, 2110, "#9933FF");
} finally {
await driver.deleteSession();
}
ImageMagick crop syntax: -crop 1x1+X+Y extracts a single pixel at coordinates (X, Y).
Finding pixel coordinates during execution:
appium_take_screenshotmagick identify image.pngmagick image.png -crop 1x1+X+Y txt:- | tail -1When the page needs to wait for async operations (e.g., after navigation, after platform change), output:
[RECORD_WAIT]
step: "Wait for page content to load"
method: waitForLoadState
value: "networkidle"
[/RECORD_WAIT]
Annotation fields:
step: Description of what is being waited formethod: The Playwright wait methodvalue: The wait condition or selectorSupported wait methods:
| method | Generated Code |
|---|---|
waitForLoadState | await page.waitForLoadState(value) |
waitForSelector | await page.waitForSelector(value) |
waitForFunction | await page.waitForFunction(value) |
When to record waits:
page.goto() when waiting for dynamic contentDO NOT use waitForTimeout - if you find yourself needing a hardcoded wait, use waitForLoadState('networkidle') or wait for a specific element/assertion instead.
For steps that require waiting for eventual consistency (S3 state, API responses), use Playwright's expect.poll():
When to use polling:
Recording annotation:
[RECORD_POLL]
step: "And I wait until \"name\" is \"John\" in S3"
command: aws --endpoint-url=${process.env.S3_ENDPOINT} s3 cp s3://apps/${appId}/user.json -
key: name
assertion: toBe
value: "John"
[/RECORD_POLL]
Annotation fields:
step: The exact Gherkin step textcommand: The shell command to execute (should return JSON)key: JSON property to check (supports dot notation, e.g., user.name)assertion: The Playwright assertion methodvalue: The expected valueGenerated Playwright code:
// Helper function (add to helpers section if not present)
function getS3User(appId) {
try {
const output = execSync(
`aws --endpoint-url=${process.env.S3_ENDPOINT} s3 cp s3://apps/${appId}/user.json - 2>/dev/null`,
{ encoding: "utf-8" }
);
return JSON.parse(output);
} catch {
return {};
}
}
// In test - check specific key
await expect.poll(() => getS3User(appId).name).toBe("John");
Supported polling assertions:
| assertion | Generated Code |
|---|---|
toBe | await expect.poll(() => getS3User(appId).key).toBe(value) |
toEqual | await expect.poll(() => getS3User(appId).key).toEqual(value) |
toContain | await expect.poll(() => getS3User(appId).key).toContain(value) |
toMatch | await expect.poll(() => getS3User(appId).key).toMatch(pattern) |
MUI Select/Combobox:
role="combobox" but are NOT actual <input> elementstoHaveValue() will fail on combobox elements with "Not an input element" errortoContainText() to verify the selected value:
// WRONG - will fail (combobox is not an <input>)
await expect(page.getByRole('combobox', { name: 'Country' })).toHaveValue('US');
// CORRECT - check displayed text
await expect(page.getByRole('combobox', { name: 'Country' })).toContainText('United States');
MUI DataGrid Column Index:
aria-colindex attribute (1-based index)data-colindex attribute (0-based index) and data-field attribute (field name)// Get column index by field name
const stateIndex = await page.locator('[data-field="state"]').first()
.getAttribute('data-colindex');
// Verify adjacent columns
const countryIdx = await page.locator('[data-field="country"]').first().getAttribute('data-colindex');
expect(parseInt(stateIndex)).toBe(parseInt(countryIdx) + 1);
Waiting for URL redirections:
waitForURL before the assertion:
// Wait for navigation to complete before asserting
await page.waitForURL(/\/landing/);
await expect(page).toHaveURL(/\/landing/);
[RECORD_ACTION]
step: "Verify redirect to landing page"
method: waitForURL
value: /\/landing/
[/RECORD_ACTION]
CRITICAL: Never use waitForTimeout() in generated code. Hardcoded waits are anti-patterns that make tests slow and flaky.
Instead, use these Playwright waiting strategies:
| Scenario | Solution | Example |
|---|---|---|
| Wait for page load | waitForLoadState | await page.waitForLoadState('networkidle') |
| Wait for element | Assertion with auto-retry | await expect(locator).toBeVisible() |
| Wait for dynamic content | waitForSelector | await page.waitForSelector('[alt^="image"]') |
| Wait after navigation | waitForURL + waitForLoadState | See below |
Pattern for page navigation with dynamic content:
// WRONG - hardcoded wait
await page.goto("/settings");
await page.waitForTimeout(2000);
// CORRECT - wait for network to settle
await page.goto("/settings");
await page.waitForLoadState("networkidle");
// BEST - wait for specific content you need
await page.goto("/settings");
await expect(page.locator('[alt^="image"]')).toHaveCount(3);
Pattern for actions that trigger async operations:
// WRONG
await page.getByRole("combobox", { name: "Country" }).click();
await page.getByRole("option", { name: "United States" }).click();
await page.waitForTimeout(2000);
// CORRECT - wait for the result of the action
await page.getByRole("combobox", { name: "Country" }).click();
await page.getByRole("option", { name: "United States" }).click();
await page.waitForLoadState("networkidle");
NEVER fabricate or assume selectors. Always discover actual selectors from the page snapshot or via JavaScript evaluation before recording.
Use Playwright's preferred locator strategies in order of preference:
page.getByTestId('OnboardingContainer').getByTestId('OnboardingPrimaryColor') - scoped by parent testids to avoid ambiguitypage.getByTestId('OnboardingPrimaryColor') - ALWAYS check for data-testid firstpage.locator('[data-slot="sidebar-overlay"]') - for other data attributespage.getByRole('button', { name: 'Submit' }) - for semantic elementspage.getByLabel('Name') - for form fieldspage.getByPlaceholder('Enter name') - for placeholder textpage.getByText('Error message') - for text contentpage.locator('.class-name') - fallback for CSS selectorsDiscovering testids via JavaScript evaluation:
Playwright's accessibility snapshot does NOT show data-testid attributes. Use JavaScript evaluation to discover testids for the specific element you're interacting with — this applies to both actions and expectations.
Find testid for a specific element using browser_evaluate with the element ref:
(element) => {
// Walk up DOM tree to find testid chain
let el = element;
const chain = [];
while (el && el !== document.body) {
const testid = el.getAttribute('data-testid');
if (testid) {
chain.push({ testid, tag: el.tagName.toLowerCase() });
}
el = el.parentElement;
}
return chain;
}
Use the testid chain to build scoped locators:
# Example: clicking delete button in product section
# Snapshot shows: [S42] button "delete"
# JavaScript returns: [
# { testid: "DeleteButton", tag: "button" },
# { testid: "Product", tag: "div" }
# ]
# Generated locator:
locator: page.getByTestId("Product").getByTestId("DeleteButton")
Use testids over DOM traversal:
// WRONG - fragile, breaks when DOM structure changes
locator: page.getByRole("heading", { name: "Product" }).locator("..").locator("..")
// CORRECT - stable, uses discovered testid chain
locator: page.getByTestId("Product").getByTestId("DeleteButton")
If no testid exists, use this fallback priority:
page.locator('[data-slot]') - for other data attributesgetByRole() with accessible namegetByLabel() for form fieldsgetByText() for unique text contentAnti-pattern (DO NOT): Feature file says: "click the delete button on image1" Recording assumes: data-testid="delete-image1" ← WRONG if not verified
Correct pattern: Feature file says: "click the delete button on image1" → Take snapshot → Find actual element: [S42] button "delete" (data-testid="DeleteButton") → Record: page.getByTestId("Product").getByTestId("DeleteButton")
The ~accessibilityId selector (e.g., driver.$('~Sign in')) is cross-platform but only works if the app sets accessibility attributes:
| Platform | Required Attribute |
|---|---|
| Android | content-description |
| iOS | accessibilityIdentifier or label |
Common issue: An element may have text="Sign in" but no content-description, causing ~Sign in to fail.
Cross-platform pattern:
const isAndroid = driver.isAndroid;
const element = isAndroid
? await driver.$('android=new UiSelector().text("Sign in")')
: await driver.$('-ios predicate string:label == "Sign in"');
Locator strategy priority:
~accessibilityId - if app has proper accessibility attributes (preferred, cross-platform)id=resource-id - Android resource IDs (e.g., id=com.app:id/buttonSubmit)android=UiSelector() / -ios predicate string: - platform-specific text/attribute matchingAfter executing all scenario steps, use the Write tool to create a .spec.js file alongside the .feature file with:
Test Naming Convention:
test('ID: Title @featureTag @scenarioTag', ...)--grep / --grep-invert filtering, e.g., --grep "@staging" to run one environment's set, --grep-invert "@purge-data" to skip destructive scenarios on a shared environment, or --grep-invert "@timeout-" to skip slow tests@staging and @prod have no execution behaviour — like @e2e and @auth they exist only to make the generated spec filterable. --grep matches the file name, describe title, test name and tags combined, so avoid tag names that collide with words appearing in thoseHandling Existing Spec Files:
.spec.js file already exists, read it first to preserve the file structuretest('DAS-01: ...'))Generated File Structure (unified for all scenarios):
import { expect, test } from '@playwright/test';
import { execSync } from 'child_process';
// ============================================================
// Helper Functions
// ============================================================
function extractAppIdFromS3() {
const output = execSync(
`aws --endpoint-url=${process.env.S3_ENDPOINT} s3 ls s3://apps/`,
{ encoding: 'utf-8' }
);
return output.match(/PRE ([a-f0-9-]{36})\//)?.[1] ?? '';
}
async function setLocalStorageAppId(context, appId) {
await context.addInitScript((id) => {
if (id) localStorage.setItem('app_id', JSON.stringify(id));
}, appId);
}
async function setCookies(context, baseURL) {
await context.addCookies([
{ name: 'x-tenant-id', value: process.env.TENANT_ID, url: baseURL },
{ name: 'x-app-id', value: process.env.APP_ID, url: baseURL },
]);
}
async function setupBackground(context, baseURL) {
const appId = extractAppIdFromS3();
await setLocalStorageAppId(context, appId);
await setCookies(context, baseURL);
return appId;
}
// ============================================================
// Test Suite
// ============================================================
test.describe('Feature: App Settings', () => {
test('DAS-01: Finish onboarding @e2e @auth @purge-data', async ({ page, context, baseURL }) => {
// @purge-data - Restore the seed data to initial state (tag action runs FIRST)
execSync('make reseed', { stdio: 'inherit' });
// Background (helper call runs SECOND)
await setupBackground(context, baseURL);
// Scenario steps (runs THIRD)
await page.goto('/onboarding');
// ... remaining scenario steps
});
test('DAS-02: Delete image @e2e @auth', async ({ page, context, baseURL }) => {
// Background (returns appId for use in scenario)
const appId = await setupBackground(context, baseURL);
// Scenario steps using appId
await page.goto('/settings');
// ... remaining scenario steps using appId
});
});
Key points:
setupBackground() for claritytest('DAS-01: Finish onboarding @e2e @auth @purge-data', ...)) to enable --grep / --grep-invert filtering. test.describe() stays tag-free.@purge-data adds execSync('make reseed') BEFORE the helper callappId), capture it from the helperuse.baseURL; hosts, endpoints and secrets come from process.env@non-parallel marks scenarios that write state only one of them can hold at a time — the same account, record or draft — so they must never run in parallel workers.
Record it as test.describe.configure({ mode: 'default' }), not 'serial': the scenarios are independent, so one failing must not skip the rest, and a retry re-runs only itself.
@non-parallel configures the feature's own describe.@non-parallel moves every tagged scenario in the file into one nested, tag-free describe that configures it. A group only orders the tests inside it, so tagged scenarios split across two groups still overlap.test.describe('Feature: Orders', () => {
test.describe('Non-parallel scenarios', () => {
// One draft per account - parallel workers would overwrite each other's.
test.describe.configure({ mode: 'default' });
test('ORD-01: Submit a draft @non-parallel', async ({ page }) => {
// ...
});
test('ORD-03: Discard a draft @non-parallel', async ({ page }) => {
// ...
});
});
test('ORD-02: View order history', async ({ page }) => {
// ...
});
});
VRT wiring (only when the scenario has @screenshots and VRT is configured at record time):
Add the tracker import and derive the env defaults at module scope (the SDK reads the VRT_* vars natively when constructed). Construct the tracker per worker in beforeAll, and only when the VRT backend is fully configured at run time — a recorded spec must still pass on a machine or CI job that has no VRT credentials. If VRT_ENABLESOFTASSERT is unset, set it to true explicitly — the SDK's own default is false.
Emit only the half the scenario drives: a browser scenario gets vrtWeb and its two helpers, a mobile app scenario gets vrtApp and its two, and a scenario touching both gets everything. The env defaults and isVrtEnabled are shared — one copy either way.
import { PlaywrightVisualRegressionTracker } from '@visual-regression-tracker/agent-playwright';
import { VisualRegressionTracker } from '@visual-regression-tracker/sdk-js';
const gitOutput = (command) => {
try {
return execSync(command, { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
} catch {
return '';
}
};
// One build per commit: every worker derives the same ciBuildId, and the VRT backend
// upserts a build on (project, ciBuildId), so all workers report into a single build
process.env.VRT_CIBUILDID ||= gitOutput('git rev-parse HEAD');
// The SDK throws "branchName is not specified" when this is unset — it has no default
process.env.VRT_BRANCHNAME ||= gitOutput('git rev-parse --abbrev-ref HEAD');
// Default soft-assert to true unless the project opted into strict mode
process.env.VRT_ENABLESOFTASSERT ??= 'true';
// Track only when the VRT backend is fully configured; otherwise the spec runs unchanged
const isVrtEnabled = Boolean(
process.env.VRT_APIURL &&
process.env.VRT_APIKEY &&
process.env.VRT_PROJECT &&
process.env.VRT_BRANCHNAME
);
// Assigned per worker in beforeAll — the browser tracker needs the running project's browser name
let vrtWeb = null;
let vrtApp = null;
// page.screenshot() defaults to animations: 'allow' — see "Screenshot Options"
const DEFAULT_SCREENSHOT_OPTIONS = { animations: 'disabled' };
function withScreenshotDefaults(options) {
return {
...options,
screenshotOptions: { ...DEFAULT_SCREENSHOT_OPTIONS, ...options?.screenshotOptions },
};
}
async function trackVisualPage(page, name, options) {
if (!vrtWeb) return;
await vrtWeb.trackPage(page, name, withScreenshotDefaults(options));
}
async function trackVisualElement(locator, name, options) {
if (!vrtWeb) return;
await vrtWeb.trackElementHandle(locator, name, withScreenshotDefaults(options));
}
// Baseline-key dimensions the Playwright agent fills in for itself. Read from the REQUESTED
// capabilities, not the session's returned ones, so the key is identical on every run
async function appImageMeta(driver) {
const capabilities = driver.requestedCapabilities ?? {};
const browserstack = capabilities['bstack:options'];
const { width, height } = await driver.getWindowSize();
return {
os: [
capabilities.platformName,
browserstack?.osVersion ?? capabilities['appium:platformVersion'],
]
.filter(Boolean)
.join(' '),
device:
browserstack?.deviceName ??
capabilities['appium:deviceName'] ??
capabilities['appium:udid'],
browser: capabilities['appium:automationName'],
viewport: `${width}x${height}`,
};
}
// Takes base64, so any screenshot source works — WebdriverIO, or a curl'd
// GET /session/:sessionId/screenshot when the run is driven through the REST API
async function trackVisualAppImage(driver, name, imageBase64, options) {
if (!vrtApp) return;
await vrtApp.track({ name, imageBase64, ...(await appImageMeta(driver)), ...options });
}
async function trackVisualAppScreen(driver, name, options) {
if (!vrtApp) return;
await trackVisualAppImage(driver, name, await driver.takeScreenshot(), options);
}
async function trackVisualAppElement(driver, element, name, options) {
if (!vrtApp) return;
await trackVisualAppImage(
driver,
name,
await driver.takeElementScreenshot(element.elementId),
options
);
}
Open and close the VRT build around the visual scenarios, then emit the [RECORD_VISUAL] tracking calls inside the test body via the helpers:
test.describe('Feature: App Settings', () => {
// browserName is a worker-scoped fixture, so it is available in beforeAll
test.beforeAll(async ({ browserName }) => {
if (!isVrtEnabled) return;
// Both read VRT_APIURL / VRT_PROJECT / VRT_APIKEY / VRT_BRANCHNAME / VRT_CIBUILDID / VRT_ENABLESOFTASSERT
vrtWeb = new PlaywrightVisualRegressionTracker(browserName);
await vrtWeb.start();
vrtApp = new VisualRegressionTracker();
await vrtApp.start();
});
test.afterAll(async () => {
if (vrtWeb) {
await vrtWeb.stop();
vrtWeb = null;
}
if (vrtApp) {
await vrtApp.stop();
vrtApp = null;
}
});
test('DAS-01: Finish onboarding @e2e @auth @screenshots', async ({ page, context, baseURL }) => {
await setupBackground(context, baseURL);
await page.goto('/onboarding');
// Then I should see the onboarding page
await expect(page.getByTestId('OnboardingPage')).toBeVisible();
// And I should see the welcome banner
await expect(page.getByTestId('WelcomeBanner')).toBeVisible();
// One shot for the whole assertion group, after the last assertion has settled
await trackVisualPage(
page,
'DAS-01-i-should-see-the-welcome-banner',
{ diffTollerancePercent: 1 }
);
});
});
A mobile app scenario keeps the same describe-level build; the driver is per test, so release it in finally — otherwise a failed assertion leaks the Appium (or BrowserStack) session:
test('DAS-03: Onboarding on device @e2e @screenshots', async () => {
const driver = await remote(getAppiumOptions());
try {
// Then I should see the welcome screen
await driver.$('~WelcomeScreen').waitForDisplayed();
await trackVisualAppScreen(
driver,
'DAS-03-i-should-see-the-welcome-screen',
{ diffTollerancePercent: 1 }
);
} finally {
await driver.deleteSession();
}
});
start()/stop() conditional on the tag at record time — specs without a @screenshots scenario are unchanged.isVrtEnabled is the run-time switch layered on top. When it is false the spec still passes: no build is opened, no tracking call fires, and every non-visual assertion in the scenario runs exactly as before. Never call vrtWeb.trackPage / vrtWeb.trackElementHandle / vrtApp.track directly from a test body — always go through the four trackVisual* helpers so the guard cannot be bypassed.browserName worker fixture. Browser is part of the baseline key, so each Playwright project gets its own baseline to approve, while all of them still report into the one VRT_CIBUILDID build.vrtWeb and vrtApp are separate trackers because a scenario can drive a browser and a mobile app in the same test. They share VRT_CIBUILDID, and the backend upserts a build on (project, ciBuildId), so both still report into one build.appImageMeta reads driver.requestedCapabilities, not driver.capabilities: the returned session capabilities carry values that drift between runs (UDIDs, patch versions) and would orphan the approved baseline. browser carries automationName — a native app has no browser, and this keeps the Android and iOS keys apart.process.env defaults MUST stay at module scope, which runs before beforeAll constructs the tracker — the SDK reads them at construction. Use ||= (not ??=) for the git-derived ones so an empty env var still falls back. There is deliberately no main fallback for VRT_BRANCHNAME: outside a git checkout it stays empty and isVrtEnabled turns VRT off, rather than silently comparing against the wrong baseline branch.withScreenshotDefaults is why [RECORD_VISUAL] annotations never need to spell out animations: 'disabled' — the choke point applies it. A recorded screenshotOptions merges on top; see Screenshot Options.Feature step:
When I enter "John" in the "Name" field
And I click the "CREATE" button
Then a confirmation dialog should appear
Claude's output during execution:
Filling "Name" field with "John"...
[RECORD_ACTION]
step: "When I enter \"John\" in the \"Name\" field"
method: fill
locator: page.getByLabel('Name')
value: "John"
[/RECORD_ACTION]
Clicking CREATE button...
[RECORD_ACTION]
step: "And I click the \"CREATE\" button"
method: click
locator: page.getByRole('button', { name: 'CREATE' })
[/RECORD_ACTION]
Taking snapshot to verify dialog...
Dialog found at ref [S1].
[RECORD_EXPECT]
step: "Then a confirmation dialog should appear"
locator: page.getByRole('dialog')
assertion: toBeVisible
[/RECORD_EXPECT]
Generated Playwright code:
// When I enter "John" in the "Name" field
await page.getByLabel('Name').fill('John');
// And I click the "CREATE" button
await page.getByRole('button', { name: 'CREATE' }).click();
// Then a confirmation dialog should appear
await expect(page.getByRole('dialog')).toBeVisible();
Feature step:
And the image should be deleted from S3 bucket "apps" at "{appId}/assets/image1.png"
Claude's output during execution:
Verifying S3 deletion via AWS CLI...
[RECORD_COMMAND]
step: "And the image should be deleted from S3 bucket"
command: aws --endpoint-url=${process.env.S3_ENDPOINT} s3 ls s3://apps/0bec779c-db96-4c0e-b78f-800888d4fe20/assets/image1.png
assertion: shouldFail
[/RECORD_COMMAND]
Generated Playwright code:
// And the image should be deleted from S3 bucket
expect(() => execSync(
`aws --endpoint-url=${process.env.S3_ENDPOINT} s3 ls s3://apps/${appId}/assets/image1.png`,
{ stdio: "pipe" }
)).toThrow();
What SKILL.md sets; muted values are Claude Code's defaults
mediumThree short reads, in order
npx claudepluginhub intai/story-flow --plugin story-flow7 skills in this plugin
/analyze-task-dependenciesAnalyze task dependencies for parallel executionParse story markdown to identify task dependencies and parallel execution opportunities./draft-story-markdownDraft a story markdown from a story tracker or feature descriptionGenerate a draft story markdown by analyzing a story tracker or feature description, Figma designs, and the codebase./implement-story-markdownImplement a story according to the requirements and tasksOther plugins' skills for the same job