Description
Hi everyone,
[tl;dr] I need a way to catch failed assertions in order to take a screenshot with Selenium.
I'm trying out ava as a test runner for e2e tests with Selenium. No arguments are passed to ava and I'm using test.serial, with each file having its own webdriver instance (so different browser per file).
One of the requirements I need to fulfill is to take a screenshot whenever an assertion fails, then call driver.quit() (file's instance, async) to close the browser. This has to happen before process.quit() is called (if at all).
My understanding is that ava provides no way of checking an assertion status as it completes.
It might be worth noting that I also tried Tape, and could get assertion status with the help of createStream method and pipe'ing the stream to both stdout and a tap parser. Maybe the same can be applied to ava when --tap flag is used?
Thanks a lot.