playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] Video not preserved when PW crashes on `Malformed value`

Open leotg130 opened this issue 3 years ago • 1 comments

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.

leotg130 avatar Aug 05 '22 13:08 leotg130

.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?

mxschmitt avatar Aug 08 '22 10:08 mxschmitt

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.)

rwoll avatar Aug 11 '22 20:08 rwoll