NickTomlin / protractor-flake

Rerun potentially flakey protractor tests before failing.
MIT License
80 stars 51 forks source link

protractor-flake seems to rerun ALL tests and not only the failed test #59

Closed anuvratashu closed 7 years ago

anuvratashu commented 7 years ago

I am using "protractor-flake@2.5.1" version and running my test. In my test few of test are failing but its running all the test again. Attached is the log file and the config file. Below is the command i have used to run.

protractor-flake --max-attempts=2 --color=magenta -- config.js

config.txt logs.txt

NickTomlin commented 7 years ago

The log output seems to indicate that it is finding the failing spec file TrajectorySpec.js and re-running it (it only appears to run two specs Validation of Selecting Deselecting the columns and Selecting Deselecting the columns).

Is that not the behavior you are seeing? Or are you expecting it to re-run only the failed specs within the same file?

anuvratashu commented 7 years ago

Yes, I am expecting to re run only the failed specs in the same file and not all the spec of one file.

wswebcreation commented 7 years ago

@anuvratashu

protractor-flake can only determine which files hold failed specs, it can't only run the failed tests in 1 file. So for example:

failing.example.spec.js
 |_ 2 failing tests
 |_ 5 passed tests

passed.example.spec.js
|_15 passed tests

In this case protractor-flake will read the console log and will see that failing.example.spec.js is failing. It will then collect the path in which the spec is stored and offers it again to Protractor. It can't offer only the 2 failing tests in failing.example.specs.js (you can't also do this manual unless you adjust the spec-file)

I hope you understand how protractor-flake is working and I'm gonna close this issue for now. If you have any other issues please create a new issue

grtz

wswebcreation