playwright
playwright copied to clipboard
[BUG] Video not preserved when PW crashes on `Malformed value`
Context:
- Playwright Version: 1.22.1
- Operating System: Linux
- Node.js version: 16.13.2
- Browser: Chromium
Code Snippet
- Didn't test with this, but can provide a more thorough repro if needed.
const {chromium} = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
await page.setContent(`<input type="time">`);
await page.fill('1'); // Invalid value for "time"
})();
Describe the bug
It seems that when trying to set an invalid value to a "typed" <input>, like time above, PW won't capture video, but trace is captured. Didn't dig deep, but this is where the exception gets thrown: https://github.com/microsoft/playwright/blob/v1.22.1/packages/playwright-core/src/server/injected/injectedScript.ts#L627
So maybe the problem is how the exception is handled...
The error PW reports is: page.fill: Error: Malformed value
I'm left with a directory .playwright-artifacts-0 that contains 0 byte video.
Would be nice if the video was fully captured and preserved, I do have the video: 'on' set in playwright.config.ts.
.playwright-artifacts- is a temporary folder, which is not intended to be used to view the assets. I tried to reproduce it and for me it successfully generated a video file inside test-results directory and inside the playwright-report directory (html report).
Could you provide a repro for us?
Closing per-above as part of triage. Please re-file with a repro and file a new issue referencing this issue. (The repro should be in the form of GitHub repo we can clone, download, and run to observe the issue ourselves.)