During my work at a large bank in the Netherlands I encountered that our test environment wasn’t that stable as we wanted. Sometimes
- services had a hick-up
- app installs didn’t finish in the expected time
- testdata wasn’t correctly loaded
- and some other stuff..
To eliminate those dependencies I needed something to retry a testcase / testsuite. Because we worked with Protractor it was very hard to find a good solution, until I found protractor-flake of Nick Tomlin.
protractor-flake is a wrapper around Protractor that will read the exit code of all tests. If some tests fail, protractor-flake will read the log and retry the failed tests-files before they actually fail.
At the time I tried protractor-flake it didn’t match our needs because protractor-flake supported Jasmine / Mocha and we were using CucumberJS in combination with Protractor. But then the advantage of Open Source Software kicks in. I’ve created a feature request and the pull request was merged. Since september 2016 CucumberJS is supported by protractor-flake, hurray!
How to use
protractor-flake is easy to use. First use it as a (dev)-dependency in your project
npm install protractor-flake --save-dev
Then run it with this command from the root of you project
protractor-flake --protractor-path=/path/to/protractor --parser cucumberMulti --node-bin node --max-attempts=3 -- path/to/protractor.conf.js
See the documentation of protractor-flake for more information about how to use CucumberJS in combination with protractor-flake.
Credits go to Nick Tomlin for creating this wonderful module!
- Image created and Designed by Freepik