microsoft / playwright-test

Build a cross-browser end-to-end test suite with Playwright.
https://playwright.dev
Apache License 2.0
777 stars 34 forks source link

Take "screenshot on failure" if fixture fails #165

Closed arjunattam closed 4 years ago

arjunattam commented 4 years ago

When fixtures involve browser interaction steps, these steps can fail. In such cases, debug artifacts like screenshots on failure are useful to debug the issue. These artifacts are not guaranteed to be available today.

To repro

pavelfeldman commented 4 years ago

Unfortunately, this is a folio limitation:

Screenshot on failure is implemented as a test fixture, this fixture is only set up after the worker fixtures it depends upon are set up. loggedInState is a worker fixture, so when it fails, test fixtures don't run, test does not run, nothings runs. loggedInState author is responsible for try/catching it all, handling timeouts an capturing the screenshots.