0

I am using cypress and mochawesome to generate reports for testing. I want to be alerted only when there is a failure. Is it possible to have the number of failing tests without parsing the json file?

goodvibes
  • 3
  • 2

1 Answers1

1

The exit code of the cypress process will give you the number of failed tests:

npm run cypress
# ... cypress runs...
echo $? # print number of failed tests

Or for Windows cmd prompt: print exit code in cmd in windows os

kuceb
  • 16,573
  • 7
  • 42
  • 56
  • thank you for your answer. I use CMD not linux terminal and I try to get the number of failed tests to try to send an email only if there is a failure – goodvibes Mar 07 '19 at 08:33