Open Navneetsoni860 opened 5 years ago
Hi @Navneetsoni860
Do u have logs / traces of your issue?
It is not showing any error....If any of the spec failed then It's runing all specs 2 time.I want to rerun only failed specs .
please try to run your command line with DEBUG=* to get more logs on your side. without logs, debugging is hard.
If, as suggested on Readme, use
retry.onCleanUp(results);
Then later on files
will be undefined on this line
function onCleanUp(results,files) {
if (results) {
writeToFile(files);
}
}
Which will provoke to run all the specs again
It is related to this PR
So, what is missing is:
Example code on onCleanUp
about passing the failed spec file paths to retry.onCleanUp(results, files);
@dreuxl I've debugged until the method onCleanUp
is being called and some tests already failed. We are missing the list of files that failed on the method onCleanUp
Let me know if you need anything else or something is not clear. Thanks
[
'test/ui/e2e/specs/messagePage/*.js',
'test/ui/e2e/specs/paymentPage/*.js',
]
I have these tests. Each folder has 1 file in it. I intentionally make the test fail under paymentPage. I reran the test under messagePage as well :|
We have over 50 tests but just to see the issue I used the above example. I have this under onCleanUp
onCleanUp(results) {
retry.onCleanUp(results);
},
@dreuxl : Let me eleborate issue,
exports.config = Object.assign({
specs: [
"**/spec1.e2e-spec.ts",
"**/spec2.e2e-spec.ts",
],
framework: "jasmine",
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 900000,
print: function () { }
},
onPrepare() {
retry.onPrepare();
},
onCleanUp: function (results, files) {
retry.onCleanUp(results, files);
},
afterLaunch: function () {
return retry.afterLaunch(3);
}
}
In this config if there is any single test failure in spec1.e2e-spec.ts. then all test cases of spec1.e2e-spec.ts & spec2.e2e-spec.ts are executed in rerun on next retry which is the issue.
Hi guys, any luck on solving this one or workaround? I am having the same issue.
No matter how I twist the onPrepare, onCleanup and afterLaunch in config file, I always have the whole list of test cases written in a the file that will be re-ran by protractor-retry library. as following:
`<?xml version="1.0" encoding="UTF-8"?>
Seems to be a known issue as described in README, https://github.com/yahoo/protractor-retry#known-caveat
Will this issue get resolved?
Will this issue get resolved?
@ashishgoel88 You could give it a try on https://github.com/yuezk/protractor-jasmine-retry if you are using Jasmine as the test framework. As I remember, it resolved this issue.
Can someone help me on this..... My conf file : var retry = require('../lib/retry');
exports.config = { framework: 'jasmine2', specs: ['./jasmine/*.spec.js'], jasmineNodeOpts: { // If true, print colors to the terminal. showColors: true, // Default time to wait in ms before a test fails. defaultTimeoutInterval: 30000 }, capabilities: { shardTestFiles: true, maxInstances: 4, browserName: 'chrome', }, onCleanUp: function (results) { retry.onCleanUp(results); }, onPrepare: function () { retry.onPrepare(); require('jasmine-expect'); browser.ignoreSynchronization = true; }, afterLaunch: function() { return retry.afterLaunch(2); // number of retries ( default is 2 ) } };