-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protractor-flake does not retry failed specs if the expectation is in a promise #44
Comments
This is because the stack trace for exceptions thrown in webdriver promises does not include the line of the file. Protractor flake takes a very simple approach to scrapping through the stacktraces and if this information isn't found it treats it as a re-run. There isn't a great solve for this at the moment; I'd more than welcome a PR to make this better. Two questions
|
Output:
Strange thing is ... I do see a filename to parse here. Command line options:
Maybe a quick fix would be that all the tests are being retried when the number of tests to retry don't match with the number of failed tests. I don't care if the tests have to take a while because they are all being retried, but failed tests not being retried while in the end the entire test suite is seen as 'green' is a bit dangerous ... |
Ah interesting; this output is from a different reporter than I am used to; unfortunately it still doesn't pass the criteria that the standard parser looks for. Looking for passed files would be great but I don't know of a generic way to get which files passed and which did not (protractor doesn't provide this as far as I know). A custom reporter might solve this. Again, would love any ideas or a PR here. I am going to work on writing the ability to make custom parsers for cases like this (since it seems like the spec file should always be the 1st |
Sounds like a good idea. |
I have a pull request for custom parsers #45; I'd appreciate it if you'd take a look! |
Custom parsers have been released 9791183. I'm going to go ahead and close this for now. Feel free to reopen another issue if there is still a problem. |
It seems that when you place an expectation in a promise in your test, the failed spec is not registered by protractor-flake as a spec it should retry.
Example:
When value is not 'something', the test fails and counts as a failed test in the amount of failed tests at the end of the test run. But it is not being retried.
Example of a console log of such a situation (3 tests have expectations in promises):
It seems that when it is the only test that fails, all files are being retried, because it somehow notices there was a failure but does not have a list of failed tests. When another test fails (like the 'supplyPageSpec' above), only the supplyPageSpec is being retried and it 'forgets' about the other 3.
I solved this by moving the promises to a page object so I didn't have to place an expectation in a promise, but it seems to be a bug that the test is not being retried, am I right?
The text was updated successfully, but these errors were encountered: