Skip to content

Catch failed assertions #1560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
doronnac opened this issue Oct 22, 2017 · 1 comment
Closed

Catch failed assertions #1560

doronnac opened this issue Oct 22, 2017 · 1 comment

Comments

@doronnac
Copy link

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.

@novemberborn
Copy link
Member

My understanding is that ava provides no way of checking an assertion status as it completes.

I'd love to support that. Please see the discussion at #1485.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants