module default {
name: 'rerun',
parse (protractorTestOutput) {
let failedSpecs = new Set()
// ... analyze protractor test output
// ... and add to specFiles
failedSpecs.add('specfile')
// specFiles to be re-run by protractor-flake
// if an empty array is returned, all specs will be re-run
return [...failedSpecs]
}
}
because what should happen is the following
Your setup:
A test in file test-1.e2e.ts
and test-2.e2e.ts
fail. The generate a loggin which tells that the files failed
Protractor-flake should read that logging and see that 2 files files, he should provide them again to protractor to do the rerun
test-3.e2e.ts
should not be ran
if (rerunAttempt == 3){
// do something here
}