Closed elainefy closed 2 years ago
@elainefy This works for on my computer. Could you please share a repro that we can run locally?
Hi @dgozman, please refer to the failed test demo at https://github.com/elainefy/playwright_screenshot. Command to execute the test -yarn pw
No screenshot found in the test report.
Test run log:
`Running 1 test using 1 worker
1) testing.test.ts:16:5 › Feature: Testing › Failed test screenshot testing ======================
Error: expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 10000ms
- waiting for selector "div#test"
17 |
18 | await page.goto('https://www.google.com/');
> 19 | await expect(page.locator('div#test')).toBeVisible();
| ^
20 | })
21 |
22 | });
at C:\Users\fyee\Documents\GitHub\playwright_screenshot\tests\testing.test.ts:19:48
attachment #1: trace (application/zip) ---------------------------------------------------------
test-results\testing-Feature-Testing-Failed-test-screenshot-testing\trace.zip
Usage:
npx playwright show-trace test-results\testing-Feature-Testing-Failed-test-screenshot-testing\trace.zip
------------------------------------------------------------------------------------------------
Slow test file: testing.test.ts (17s)
Consider splitting slow test files to speed up parallel execution
1 failed
testing.test.ts:16:5 › Feature: Testing › Failed test screenshot testing =======================`
@elainefy Thank you for the repro. This issue is similar to #14854, and should be already fixed in v1.24 release.
@dgozman Awesome! Thank you for the fixes :)
@dgozman Is their any way to take screenshot if any test cases failed in GitHub Action?
Context:
Code Snippet
playwright.config.ts
Describe the bug
When I set the screenshot config to 'only-on-failure', no screenshot is captured in test-results folder or displayed in html report.