-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Description
Context:
- GOOD Playwright Version: [1.37.1]
- BAD Playwright Version: [1.40.0]
- Operating System: [Windows/Mac]
- Node: [18.16.0/20.4.0]
Steps to reproduce:
- Create new playwright project https://playwright.dev/docs/intro
- Update to the latest:
npm install -D @playwright/test@latest
npx playwright install
npm install - make sure you have these
“devDependencies”: {
“@playwright/test”: “^1.40.0”,
“@types/node”: “^20.9.4”
}
in package.json
5. Enable trace: "on" in playwright.config.ts in the export default defineConfig({use:}) section
6. Run the below test
import { test } from "@playwright/test";
import * as fs from "fs";
test("Test Trace", async ({ browser }) => {
const auth = "storages/storageState.json";
if (!fs.existsSync(auth)) {
fs.writeFileSync(auth, "{}");
}
const context = await browser.newContext({ storageState: auth });
const page = await context.newPage();
await page.goto("https://demo.playwright.dev/todomvc");
await page.context().storageState({ path: auth });
});
- Run
npx playwright show-reportand check the attached trace in the report - Verify the traces are displayed and functional. Note: if the trace works on the first attempt - try to reload the page
Expected result: Traces should be visible and functional.
Actual result: Traces are corrupted. Error is displayed: "Could not load trace from http://localhost:9323/data/6a329ada265b653d117eeb16a2ba7b231cc78086.zip. Make sure a valid Playwright Trace is accessible over this url."
Other details:
When comment out this line:
await page.context().storageState({ path: auth });
the traces is generated as expected.
Reactions are currently unavailable
