From 536ef17965278df2dc36b7bec69f09292daeb87a Mon Sep 17 00:00:00 2001 From: miccy <9729864+miccy@users.noreply.github.com> Date: Tue, 5 May 2026 05:11:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20fix:=20use=20testInfo.outputPath?= =?UTF-8?q?=20for=20playwright=20screenshots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces hardcoded fixed file paths for screenshots with testInfo.outputPath() in verify-search.spec.ts to prevent collisions during parallel test execution. --- apps/docs/tests/verify-search.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/docs/tests/verify-search.spec.ts b/apps/docs/tests/verify-search.spec.ts index fd4b45a..c54321a 100644 --- a/apps/docs/tests/verify-search.spec.ts +++ b/apps/docs/tests/verify-search.spec.ts @@ -1,7 +1,7 @@ import { expect, test } from '@playwright/test'; test.describe('Search Cancel Button Layout', () => { - test('should have flexible cancel button on mobile', async ({ page }) => { + test('should have flexible cancel button on mobile', async ({ page }, testInfo) => { await page.setViewportSize({ width: 375, height: 667 }); await page.goto('/'); @@ -30,10 +30,10 @@ test.describe('Search Cancel Button Layout', () => { expect(newBox!.width).toBeGreaterThan(originalBox?.width || 0); - await page.screenshot({ path: 'search-modal-mobile-long-cancel.png' }); + await page.screenshot({ path: testInfo.outputPath('search-modal-mobile-long-cancel.png') }); }); - test('should look correct on desktop', async ({ page }) => { + test('should look correct on desktop', async ({ page }, testInfo) => { await page.setViewportSize({ width: 1280, height: 800 }); await page.goto('/'); @@ -46,6 +46,6 @@ test.describe('Search Cancel Button Layout', () => { const cancelButton = page.locator('button[data-close-modal]'); await expect(cancelButton).toBeHidden(); // Hidden on desktop in original code (md:sl-hidden) - await page.screenshot({ path: 'search-modal-desktop.png' }); + await page.screenshot({ path: testInfo.outputPath('search-modal-desktop.png') }); }); });