Closed mastacheata closed 1 year ago
I would guess that the problem is with the screenshot: option - the trace entry for it is generated, but the screenshot is not actually taken because the page is not a page, but a pdf viewer plugin. Could you confirm that removing screenshot:
helps?
Ohh, interesting.
Yes, screenshot and trace are mutually exclusive for the headless test.
Disabling either yields the exepected results for the other.
Only when enabling both at once it crashes.
System info
Config file
Test file (self-contained)
Steps
on
)Expected
Actual
The test fails, complaining it can't find screenshot #2
Error: ENOENT: no such file or directory, open '/home/benedikt/develop/empto/test-results/general-emptoInternalDownloads-Try-valid-users-6acb2-ads-visible-for-mp-makler-premium-dashboard-epd-empto/test-finished-2.png'
If I turn off the trace-recording and only save a video and screenshots the test runs fine
If I run the test in headed mode trace-recording works just fine as well. This leads me to believe the problem is with taking a screenshot of a Download (headless mode) vs taking a screenshot of the PDF-Viewer Tab that chrome opens in headed mode instead.
I can't share the site the test is running against (proprietary code, not hosted on GitHub) - If absolutely necessary to reproduce, I can try and whip up a minimal sample site.
The testcase explicitly has separate paths for headless and headed mode because Playwright has no way to turn on/off browser features (here: the PDF-Viewer) in either headless or headed mode. (AFAIK there is no way to enable the PDF viewer in chromium headless)
I'm aware this isn't a great solution, but it's one that works (well, except for the trace-recorder, which seems to have problems here)