I have a really basic playwright (v1.18.1) test on Windows (11):
import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('http://whatsmyuseragent.org/');
//await page.screenshot({ path: `./tests/tmp/screenshots/whats.my.ua.${project:name}.png` });
await page.screenshot();
});
And when I run this - it says it worked
Running : cd C:\playwright\tests && npx playwright test whats_my_user_agent.spec.ts --reporter=list
Running 5 tests using 3 workers
ok [webkit] › whats_my_user_agent.spec.ts:3:1 › test (3s)
ok [firefox] › whats_my_user_agent.spec.ts:3:1 › test (4s)
ok [chromium] › whats_my_user_agent.spec.ts:3:1 › test (5s)
ok [Mobile Chrome] › whats_my_user_agent.spec.ts:3:1 › test (2s)
ok [Mobile Safari] › whats_my_user_agent.spec.ts:3:1 › test (2s)
5 passed (8s)
but I can find no sign of the screenshot file - where are they [there is no feedback giving any hints]. Also - is there a way to control the saved filename (including the project name so that I don't save 5 png files over each other).