Skip to content

[harness eval #34617] fix: handle existing query params in preview iframe URL#37

Open
valentinpalkovic wants to merge 2 commits into
nextfrom
try-pr-34617
Open

[harness eval #34617] fix: handle existing query params in preview iframe URL#37
valentinpalkovic wants to merge 2 commits into
nextfrom
try-pr-34617

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Owner

Synthetic fork PR for agentic harness eval against storybookjs#34617.

@valentinpalkovic valentinpalkovic added the ci:verify Trigger PR Verification Harness label May 14, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","build","dependencies"]

🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫 PR title must be in the format of "Area: Summary", With both Area and Summary starting with a capital letter Good examples: - "Docs: Describe Canvas Doc Block" - "Svelte: Support Svelte v4" Bad examples: - "add new api docs" - "fix: Svelte 4 support" - "Vue: improve docs"

Generated by 🚫 dangerJS against f89fe6c

github-actions Bot pushed a commit that referenced this pull request May 14, 2026
@github-actions github-actions Bot added the verified-by-harness Verified by PR Verify Harness label May 14, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

Evidence (vision-check, claude-haiku-4-5-20251001): missing

Vision reasoning

Recipe produced no screenshots — cannot verify visible evidence.

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-14T13-57-04.096Z/pr-37-preview-iframe-URL-p-d1078-sting-query-params-and-hash-chromium/manager.png

2026-05-14T13-57-04.096Z/pr-37-preview-iframe-URL-p-d1078-sting-query-params-and-hash-chromium/manager.png

2026-05-14T13-57-04.096Z/pr-37-preview-iframe-URL-p-d1078-sting-query-params-and-hash-chromium/test-finished-1.png

2026-05-14T13-57-04.096Z/pr-37-preview-iframe-URL-p-d1078-sting-query-params-and-hash-chromium/test-finished-1.png

@valentinpalkovic valentinpalkovic force-pushed the next branch 3 times, most recently from fe2f521 to e537022 Compare May 14, 2026 14:09
@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed ci:verify Trigger PR Verification Harness labels May 14, 2026
github-actions Bot pushed a commit that referenced this pull request May 14, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

Evidence (vision-check, claude-haiku-4-5-20251001): undetermined

Vision reasoning

The diff primarily modifies internal URL construction logic in manager-api (query/hash handling), CI/GitHub workflow files, and script utilities. The Playwright recipe validates this logic via page.evaluate() assertions on string construction, not visual UI changes. The screenshots show a standard Storybook interface with a Button component, but there are no user-visible changes expected—the fix ensures query params and hash fragments are preserved programmatically when constructing preview URLs, which is not observable in static screenshots of the UI.

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-14T14-25-09.372Z/pr-37-manager-api-getUrlSt-cdadb-e-query-hash-in-previewHref-chromium/manager.png

2026-05-14T14-25-09.372Z/pr-37-manager-api-getUrlSt-cdadb-e-query-hash-in-previewHref-chromium/manager.png

2026-05-14T14-25-09.372Z/pr-37-manager-api-getUrlSt-cdadb-e-query-hash-in-previewHref-chromium/test-finished-1.png

2026-05-14T14-25-09.372Z/pr-37-manager-api-getUrlSt-cdadb-e-query-hash-in-previewHref-chromium/test-finished-1.png

@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed ci:verify Trigger PR Verification Harness labels May 14, 2026
github-actions Bot pushed a commit that referenced this pull request May 14, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

Evidence (vision-check, claude-haiku-4-5-20251001): undetermined

Vision reasoning

The diff primarily consists of non-user-visible changes: removal of complex path-resolution logic in CI workflows and scripts, refactoring of URL construction in manager-api, and removal of a CLI flag. The one user-visible change is in code/core/src/manager-api/modules/url.ts which now properly handles query strings and hash fragments in previewBase URLs. The Playwright test validates this logic programmatically via page.evaluate() and inspects iframe src attributes, which are visible in the screenshots, but the screenshots show a normal Storybook UI without obvious indicators of the URL handl

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-14T14-40-26.489Z/pr-37-manager-api-getUrlSt-79005-ery-and-hash-in-previewBase-chromium/preview-iframe-with-built-url.png

2026-05-14T14-40-26.489Z/pr-37-manager-api-getUrlSt-79005-ery-and-hash-in-previewBase-chromium/preview-iframe-with-built-url.png

2026-05-14T14-40-26.489Z/pr-37-manager-api-getUrlSt-79005-ery-and-hash-in-previewBase-chromium/test-finished-1.png

2026-05-14T14-40-26.489Z/pr-37-manager-api-getUrlSt-79005-ery-and-hash-in-previewBase-chromium/test-finished-1.png

@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed ci:verify Trigger PR Verification Harness labels May 15, 2026
@valentinpalkovic valentinpalkovic force-pushed the next branch 2 times, most recently from 80ccd7d to 745162d Compare May 15, 2026 16:58
github-actions Bot pushed a commit that referenced this pull request May 15, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

Evidence (vision-check, claude-haiku-4-5-20251001): undetermined

Vision reasoning

The diff contains two categories of changes: (1) infrastructure/CI changes to GitHub Actions workflows and scripts (removing outdated path/directory logic), and (2) a functional fix in code/core/src/manager-api/modules/url.ts to properly handle existing query parameters and hash fragments in preview URLs. The recipe tests the second change by verifying that getUrlState() produces a well-formed previewHref without duplicate ? characters, which the recipe's assertions confirm passes. However, the screenshots show only a Button story in the preview iframe—they don't visibly demonstrate th

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-15T16-56-44.567Z/pr-37-manager-api-getUrlSt-16e23-ting-previewBase-query-hash-chromium/preview-iframe.png

2026-05-15T16-56-44.567Z/pr-37-manager-api-getUrlSt-16e23-ting-previewBase-query-hash-chromium/preview-iframe.png

2026-05-15T16-56-44.567Z/pr-37-manager-api-getUrlSt-16e23-ting-previewBase-query-hash-chromium/test-finished-1.png

2026-05-15T16-56-44.567Z/pr-37-manager-api-getUrlSt-16e23-ting-previewBase-query-hash-chromium/test-finished-1.png

@valentinpalkovic valentinpalkovic force-pushed the next branch 3 times, most recently from a11176d to 9de9d5b Compare May 15, 2026 17:25
@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed ci:verify Trigger PR Verification Harness labels May 15, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

No verdict produced — the workflow failed before the harness ran (likely recipe-author dispatch, deny-regex, or lint). See run log for details.

@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed ci:verify Trigger PR Verification Harness labels May 15, 2026
github-actions Bot pushed a commit that referenced this pull request May 15, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

Evidence (vision-check, claude-haiku-4-5-20251001): undetermined

Vision reasoning

The diff is primarily composed of non-user-visible changes: CI/workflow configuration, package version downgrades, test file deletions, and removal of minimum-release-age handling logic. The only potentially user-visible changes mentioned in the recipe comments (URL params handling, status icon rendering, icon swap) are internal logic fixes that may not produce observable visual differences in the Storybook UI itself. The screenshots show the sidebar and story rendering working correctly, but the diff's changes are largely invisible to end users.

PR-added unit tests: ✅ passed — 6712 passed, 0 failed across 2118 suite(s)

Files: code/addons/vitest/src/vitest-plugin/agent-telemetry-reporter.test.ts, code/core/src/common/js-package-manager/NPMProxy.test.ts, code/core/src/common/js-package-manager/PNPMProxy.test.ts, code/core/src/common/js-package-manager/Yarn1Proxy.test.ts, code/core/src/common/js-package-manager/Yarn2Proxy.test.ts, code/core/src/core-server/server-channel/ai-setup-channel.test.ts, code/core/src/core-server/server-channel/ghost-stories-channel.test.ts, code/core/src/core-server/utils/checklist.test.ts, code/core/src/core-server/utils/ghost-stories/parse-vitest-report.test.ts, code/core/src/core-server/withTelemetry.test.ts, code/core/src/shared/utils/ai-checklist-flags.test.ts, code/core/src/shared/utils/analyze-test-results.test.ts, code/lib/create-storybook/src/commands/DependencyInstallationCommand.test.ts, code/lib/create-storybook/src/commands/PreflightCheckCommand.test.ts, code/lib/create-storybook/src/commands/ProjectDetectionCommand.test.ts, code/lib/create-storybook/src/commands/UserPreferencesCommand.test.ts, code/lib/create-storybook/src/generators/REACT_NATIVE/index.test.ts, code/lib/create-storybook/src/initiate.test.ts, code/lib/create-storybook/src/services/FrameworkDetectionService.test.ts, code/lib/create-storybook/src/services/ProjectTypeService.test.ts, code/lib/create-storybook/src/services/TelemetryService.test.ts

How Playwright validated this
test('preview iframe URL handles existing query params; sidebar tree renders', async ({ page }, testInfo) => {
  const pageErrors: string[] = [];
  const consoleErrors: string[] = [];

  page.on('pageerror', (err) => {
    pageErrors.push(err.stack ?? err.message ?? String(err));
  });
  page.on('console', (msg) => {
    if (msg.type() === 'error') consoleErrors.push(msg.text());
  });

  const baseURL =
    process.env.STORYBOOK_URL ?? testInfo.project.use.baseURL ?? 'http://localhost:6006';

  try {
    await page.goto(`${baseURL}/?path=/story/example-button--primary`);

    const recipe = new RecipePage(page, expect);
    await recipe.waitUntilLoaded();

    const iframe = page.locator('#storybook-preview-iframe');
    await expect(iframe).toBeVisible();
    const src = await iframe.getAttribute('src');
    expect(src).toBeTruthy();
    expect(src).toContain('id=example-button--primary');
    expect(src).toContain('viewMode=story');
    expect(src!).not.toMatch(/\?\?/);
    expect(src!).not.toMatch(/\?&/);

    const sidebar = page.locator('.sidebar-container');
    await expect(sidebar).toBeVisible();
    const selectedLeaf = page.locator('[data-item-id="example-button--primary"]');
    await expect(selectedLeaf).toBeVisible();
    await expect(selectedLeaf).toHaveAttribute('data-selected', 'true');

    await expect(page.locator('#sb-errordisplay')).toBeHidden();
    const previewIframe = recipe.previewIframe();
    const previewRoot = previewIframe.locator('#storybook-root, #root');
    await expect(previewRoot).toBeVisible();

    await sidebar.screenshot({
      path: testInfo.outputPath('sidebar-tree.png'),
    });
    await previewIframe.locator('body').screenshot({
      path: testInfo.outputPath('preview.png'),
    });
  } finally {
    await testInfo.attach('pageErrors', {
      body: JSON.stringify(pageErrors),
      contentType: 'application/json',
    });
    await testInfo.attach('consoleErrors', {
      body: JSON.stringify(consoleErrors),
      co

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-15T18-46-37.471Z/pr-37-manager-api-getUrlSt-9d435-ams-and-hash-in-previewBase-chromium/sidebar.png

2026-05-15T18-46-37.471Z/pr-37-manager-api-getUrlSt-9d435-ams-and-hash-in-previewBase-chromium/sidebar.png

2026-05-15T18-46-37.471Z/pr-37-manager-api-getUrlSt-9d435-ams-and-hash-in-previewBase-chromium/test-finished-1.png

2026-05-15T18-46-37.471Z/pr-37-manager-api-getUrlSt-9d435-ams-and-hash-in-previewBase-chromium/test-finished-1.png

@valentinpalkovic valentinpalkovic force-pushed the next branch 2 times, most recently from ad75ba9 to 099b6f7 Compare May 15, 2026 19:48
@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed verified-by-harness Verified by PR Verify Harness ci:verify Trigger PR Verification Harness labels May 15, 2026
github-actions Bot pushed a commit that referenced this pull request May 15, 2026
@github-actions github-actions Bot added the verified-by-harness Verified by PR Verify Harness label May 15, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

Evidence (vision-check, claude-haiku-4-5-20251001): undetermined

Vision reasoning

The diff is primarily a version bump and removal of changelog entries, along with refactoring of internal CI/security configurations and test file changes. These are not user-visible UI changes. The Playwright recipe tests manager-api URL handling and sidebar status icons, but the diff shows no modifications to the actual UI components that would produce observable changes in the screenshots.

PR-added unit tests: ✅ passed — 6712 passed, 0 failed across 2118 suite(s)

Files: code/addons/vitest/src/vitest-plugin/agent-telemetry-reporter.test.ts, code/core/src/common/js-package-manager/NPMProxy.test.ts, code/core/src/common/js-package-manager/PNPMProxy.test.ts, code/core/src/common/js-package-manager/Yarn1Proxy.test.ts, code/core/src/common/js-package-manager/Yarn2Proxy.test.ts, code/core/src/core-server/server-channel/ai-setup-channel.test.ts, code/core/src/core-server/server-channel/ghost-stories-channel.test.ts, code/core/src/core-server/utils/checklist.test.ts, code/core/src/core-server/utils/ghost-stories/parse-vitest-report.test.ts, code/core/src/core-server/withTelemetry.test.ts, code/core/src/shared/utils/ai-checklist-flags.test.ts, code/core/src/shared/utils/analyze-test-results.test.ts, code/lib/create-storybook/src/commands/DependencyInstallationCommand.test.ts, code/lib/create-storybook/src/commands/PreflightCheckCommand.test.ts, code/lib/create-storybook/src/commands/ProjectDetectionCommand.test.ts, code/lib/create-storybook/src/commands/UserPreferencesCommand.test.ts, code/lib/create-storybook/src/generators/REACT_NATIVE/index.test.ts, code/lib/create-storybook/src/initiate.test.ts, code/lib/create-storybook/src/services/FrameworkDetectionService.test.ts, code/lib/create-storybook/src/services/ProjectTypeService.test.ts, code/lib/create-storybook/src/services/TelemetryService.test.ts

How Playwright validated this
test('sidebar review-changes Clear button shows SweepIcon', async ({ page }, testInfo) => {
  const pageErrors: string[] = [];
  const consoleErrors: string[] = [];

  page.on('pageerror', (err) => {
    pageErrors.push(err.stack ?? err.message ?? String(err));
  });
  page.on('console', (msg) => {
    if (msg.type() === 'error') consoleErrors.push(msg.text());
  });

  const baseURL =
    process.env.STORYBOOK_URL ?? testInfo.project.use.baseURL ?? 'http://localhost:6006';

  try {
    await page.goto(`${baseURL}/?path=/story/example-button--primary`);
    const recipe = new RecipePage(page, expect);
    await recipe.waitUntilLoaded();

    await expect(page.locator('#sb-errordisplay')).toBeHidden();

    const controlsTab = page.getByRole('tab', { name: /controls/i });
    await controlsTab.click();
    const labelInput = page.locator('input[name="label"], textarea[name="label"]').first();
    await expect(labelInput).toBeVisible({ timeout: 10000 });
    await labelInput.fill('Verify harness MOD');

    const saveButton = page.getByRole('button', {
      name: /save changes to story|update story/i,
    });
    await expect(saveButton).toBeVisible({ timeout: 10000 });
    await saveButton.click();

    const reviewToggle = page.getByRole('switch', { name: /review.+stories/i });
    await expect(reviewToggle).toBeVisible({ timeout: 15000 });

    await reviewToggle.click();
    const clearButton = page.getByRole('button', { name: /^clear$/i });
    await expect(clearButton).toBeVisible({ timeout: 10000 });

    const iconSvgHtml = await clearButton.locator('svg').first().innerHTML();
    expect(iconSvgHtml.length).toBeGreaterThan(0);

    await page.locator('.sidebar-container').screenshot({
      path: testInfo.outputPath('sidebar-clear-button-sweepicon.png'),
    });
    await clearButton.screenshot({
      path: testInfo.outputPath('clear-button-closeup.png'),
    });
  } finally {
    await testInfo.attach('pageErrors', {
      body: JSON.stringify(pageErrors),

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-15T20-57-06.183Z/pr-37-sidebar-status-icons-b8840-erves-existing-query-params-chromium/sidebar.png

2026-05-15T20-57-06.183Z/pr-37-sidebar-status-icons-b8840-erves-existing-query-params-chromium/sidebar.png

2026-05-15T20-57-06.183Z/pr-37-sidebar-status-icons-b8840-erves-existing-query-params-chromium/test-finished-1.png

2026-05-15T20-57-06.183Z/pr-37-sidebar-status-icons-b8840-erves-existing-query-params-chromium/test-finished-1.png

github-actions Bot pushed a commit that referenced this pull request May 18, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

How Playwright validated this
test('preview iframe URL composer preserves existing query params and hash', async ({
  page,
}, testInfo) => {
  const pageErrors: string[] = [];
  const consoleErrors: string[] = [];

  page.on('pageerror', (err) => {
    pageErrors.push(err.stack ?? err.message ?? String(err));
  });
  page.on('console', (msg) => {
    if (msg.type() === 'error') consoleErrors.push(msg.text());
  });

  const baseURL =
    process.env.STORYBOOK_URL ?? testInfo.project.use.baseURL ?? 'http://localhost:6006';

  try {
    await page.goto(`${baseURL}/?path=/story/example-button--primary`);
    const sb = new RecipePage(page, expect);
    await sb.waitUntilLoaded();

    const errorDisplay = page.locator('#sb-errordisplay');
    await expect(errorDisplay).toBeHidden();

    const previewIframe = page.frameLocator('#storybook-preview-iframe');
    const previewRoot = previewIframe.locator('#storybook-root, #root');
    await expect(previewRoot).toBeVisible();

    await page.goto(`${baseURL}/?path=/story/example-button--secondary`);
    await sb.waitUntilLoaded();
    await expect(errorDisplay).toBeHidden();
    await expect(previewRoot).toBeVisible();

    const cases = await page.evaluate(() => {
      const buildPreviewHref = (
        previewBase: string,
        storyId: string,
        viewMode: string
      ): string => {
        const hashIndex = previewBase.indexOf('#');
        const previewBaseWithoutHash =
          hashIndex === -1 ? previewBase : previewBase.slice(0, hashIndex);
        const previewHash = hashIndex === -1 ? '' : previewBase.slice(hashIndex);
        const separator = previewBaseWithoutHash.includes('?') ? '&' : '?';
        return `${previewBaseWithoutHash}${separator}id=${storyId}&viewMode=${viewMode}${previewHash}`;
      };
      return {
        plain: buildPreviewHref('/iframe.html', 'example-button--primary', 'story'),
        withQuery: buildPreviewHref(
          '/iframe.html?foo=bar',
          'example-button--primary',
          'story'
    

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-18T06-17-11.287Z/pr-37-preview-iframe-URL-c-7bb32-sting-query-params-and-hash-chromium/test-finished-1.png

2026-05-18T06-17-11.287Z/pr-37-preview-iframe-URL-c-7bb32-sting-query-params-and-hash-chromium/test-finished-1.png

@valentinpalkovic valentinpalkovic added ci:verify Trigger PR Verification Harness and removed verified-by-harness Verified by PR Verify Harness ci:verify Trigger PR Verification Harness labels May 18, 2026
github-actions Bot pushed a commit that referenced this pull request May 18, 2026
@github-actions github-actions Bot added the verified-by-harness Verified by PR Verify Harness label May 18, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: verified (target internal-ui)

How Playwright validated this
test('preview iframe URL preserves existing query params and hash', async ({ page }, testInfo) => {
  const pageErrors: string[] = [];
  const consoleErrors: string[] = [];

  page.on('pageerror', (err) => {
    pageErrors.push(err.stack ?? err.message ?? String(err));
  });
  page.on('console', (msg) => {
    if (msg.type() === 'error') consoleErrors.push(msg.text());
  });

  const baseURL =
    process.env.STORYBOOK_URL ?? testInfo.project.use.baseURL ?? 'http://localhost:6006';

  try {
    await page.goto(`${baseURL}/?path=/story/example-button--primary`);
    const sb = new RecipePage(page, expect);
    await sb.waitUntilLoaded();

    const iframeSrc = await page.locator('#storybook-preview-iframe').getAttribute('src');
    expect(iframeSrc).toBeTruthy();
    expect(iframeSrc).toContain('id=example-button--primary');
    expect(iframeSrc).toContain('viewMode=story');
    expect(iframeSrc).not.toMatch(/\?\?/);
    const idMatches = iframeSrc!.match(/[?&]id=/g) ?? [];
    expect(idMatches.length).toBe(1);

    const results = await page.evaluate(() => {
      const build = (previewBase: string, storyId: string, viewMode: string) => {
        const hashIndex = previewBase.indexOf('#');
        const previewBaseWithoutHash =
          hashIndex === -1 ? previewBase : previewBase.slice(0, hashIndex);
        const previewHash = hashIndex === -1 ? '' : previewBase.slice(hashIndex);
        const separator = previewBaseWithoutHash.includes('?') ? '&' : '?';
        return `${previewBaseWithoutHash}${separator}id=${storyId}&viewMode=${viewMode}${previewHash}`;
      };
      return {
        noParams: build('/iframe.html', 'a--b', 'story'),
        withParams: build('/iframe.html?foo=bar', 'a--b', 'story'),
        withHash: build('/iframe.html#frag', 'a--b', 'story'),
        withBoth: build('/iframe.html?foo=bar#frag', 'a--b', 'story'),
      };
    });

    expect(results.noParams).toBe('/iframe.html?id=a--b&viewMode=story');
    expect(results.withParams).toBe('/

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-18T06-41-25.063Z/pr-37-preview-iframe-URL-p-d1078-sting-query-params-and-hash-chromium/test-finished-1.png

2026-05-18T06-41-25.063Z/pr-37-preview-iframe-URL-p-d1078-sting-query-params-and-hash-chromium/test-finished-1.png

github-actions Bot pushed a commit that referenced this pull request May 19, 2026
@github-actions
Copy link
Copy Markdown

Verify Harness

Verdict: regression (target internal-ui)

Reason: Playwright assertion failed in: ? — Test timeout of 60000ms exceeded.

How Playwright validated this
test('manager builds preview iframe URL with id/viewMode params (handles existing query/hash)', async ({ page }, testInfo) => {
  const pageErrors: string[] = [];
  const consoleErrors: string[] = [];

  page.on('pageerror', (err) => {
    pageErrors.push(err.stack ?? err.message ?? String(err));
  });
  page.on('console', (msg) => {
    if (msg.type() === 'error') consoleErrors.push(msg.text());
  });

  const baseURL =
    process.env.STORYBOOK_URL ?? testInfo.project.use.baseURL ?? 'http://localhost:6006';

  try {
    await page.goto(`${baseURL}/?path=/story/example-button--primary`);
    const sb = new RecipePage(page, expect);
    await sb.waitUntilLoaded();

    await expect(page.locator('#sb-errordisplay')).toBeHidden();
    const previewIframe = page.frameLocator('#storybook-preview-iframe');
    const previewRoot = previewIframe.locator('#storybook-root, #root');
    await expect(previewRoot).toBeVisible();

    const iframeSrc = await page.locator('#storybook-preview-iframe').getAttribute('src');
    expect(iframeSrc, 'preview iframe must have a src').toBeTruthy();
    const src = iframeSrc as string;

    expect(src).toContain('id=example-button--primary');
    expect(src).toContain('viewMode=story');

    const parsed = new URL(src, baseURL);
    expect(parsed.searchParams.get('id')).toBe('example-button--primary');
    expect(parsed.searchParams.get('viewMode')).toBe('story');

    const questionMarks = (src.match(/\?/g) ?? []).length;
    expect(questionMarks).toBe(1);

    await page.goto(`${baseURL}/?path=/docs/example-button--docs`);
    await sb.waitUntilLoaded();
    const docsSrc = await page.locator('#storybook-preview-iframe').getAttribute('src');
    expect(docsSrc, 'preview iframe must have a src on docs route').toBeTruthy();
    expect(docsSrc as string).toContain('viewMode=docs');
    const docsParsed = new URL(docsSrc as string, baseURL);
    expect(docsParsed.searchParams.get('viewMode')).toBe('docs');
    const docsQuestionMarks = ((doc

Replay: npx playwright show-trace on the trace.zip listed under "Artifacts" on the run summary page.

Screenshots

2026-05-19T13-50-57.992Z/pr-37-manager-builds-previ-c7f64-URL-with-id-viewMode-params-chromium/test-failed-1.png

2026-05-19T13-50-57.992Z/pr-37-manager-builds-previ-c7f64-URL-with-id-viewMode-params-chromium/test-failed-1.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:verify Trigger PR Verification Harness verified-by-harness Verified by PR Verify Harness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants