$ cnpm install cypress-expect
Cypress CLI wrapper where you can specify the total number of expected tests. Read Wrap Cypress Using NPM Module API
Assuming cypress
has been installed already
npm i -D cypress-expect # or yarn add -D cypress-expect
# instead of "cypress run ..."
npx cypress-expect run --passing <N> ...
Where N
is the number of total tests expected to pass.
The rest of the arguments is parsed using Cypress CLI method and executed via cypress.run
. Thus the execution should match the regular cypress run ...
command.
Note: when running in parallel mode where the tests are split, this module would not work, since only a subset of specs will execute on the current machine.
--passing <N>
checks if the total number of passing tests is <N>
--min-passing <N>
checks if the total number of passing tests is >= <N>
--failing <N>
checks if the total number of failing tests is <N>
--pending <N>
checks if the total number of pending tests is <N>
Run this script with environment variable DEBUG=cypress-expect
to see verbose logs
Copyright 2014 - 2016 © taobao.org |