yahoo / protractor-retry

Use protractor features to automatically re-run failed tests with a specific configurable number of attempts.
MIT License
28 stars 32 forks source link

Exit with Error Code 100 when using protractor-retry #11

Open AvaJay opened 6 years ago

AvaJay commented 6 years ago

Hi. I was so happy to come across your module the other day as this is a problem tht is killing confidence in our e2e tests at the moment!

We usually run our tests using npm run protractor which goes off and run various scripts before it runs protractor test/e2e/protractor.conf.js. I get the following error when I run with protractor-retry setup using npm run protractor ->

Re-running tests , attempt : 1 Re-running the following test files : /Users/Ava/Automation/test/e2e/ui/test/PageNavTests.ui.js

Closing report [21:16:32] E/launcher - Process exited with error code 100

npm ERR! Darwin 16.7.0 npm ERR! argv "/Users/Ava/.nvm/versions/node/v6.11.0/bin/node" "/Users/Ava/.nvm/versions/node/v6.11.0/bin/npm" "run" "protractor" npm ERR! node v6.11.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! mySA@0.0.0 protractor: protractor test/e2e/protractor.conf.js npm ERR! Exit status 100 npm ERR! npm ERR! Failed at the mySA@0.0.0 protractor script 'protractor test/e2e/protractor.conf.js'.

Is there any chance that this will be supported in the future?

Aside from that, if I run the tests using protractor test/e2e/protractor.conf.js I also get an error

[chrome #11] 3 specs, 1 failure [chrome #11] Finished in 159.876 seconds [chrome #11] [11:39:23] I/local - Shutting down selenium standalone server.

[11:39:23] I/testLogger -

[11:39:23] I/launcher - 0 instance(s) of WebDriver still running [11:39:23] I/launcher - chrome #11 failed 1 test(s) [11:39:23] I/launcher - overall: 1 failed spec(s) and 1 process(es) failed to complete

Re-running tests , attempt : 1 Re-running the following test files : /Users/Ava/Automation/test/e2e/ui/test/PageNavTests.ui.js

Closing report [11:39:23] E/launcher - Process exited with error code 100

We are using: jasmine 2.6.0 protractor 5.2.0 selenium-webdriver 3.6.0 chromedriver 2.33.2

Any help to get this working would be greatly appreciated. Thanks.

amrot17 commented 6 years ago

Hi ,

it would be awesome if you can provide some information to help me debug the issue for you.

Thanks

AvaJay commented 6 years ago

Hi Amro, Thanks for getting back so fast. I have provided the info you asked for in the following gist Link to Gist Thanks.

amrot17 commented 6 years ago

Hi I've created a new config with the below packages jasmine 2.6.0 protractor 5.2.0 selenium-webdriver 3.6.0 chromedriver 2.33.2

and after adding your onPrepare() , the retry is working with me , however one thing you might test from your side is to modify your reporter settings in the onPrepare to return the promise and so protractor will wait for the promise to resolve before going on to running the tests

This is working fine with me

    onPrepare: function () {
        retry.onPrepare();
        require('jasmine-expect');
        var jasmineReporters = require('jasmine-reporters');
        browser.ignoreSynchronization = true;
        return browser.getProcessedConfig().then(function(config) {
            var browserName = config.capabilities.browserName;
            var junitReporter = new jasmineReporters.JUnitXmlReporter({
                consolidateAll: true,
                savePath: 'junitReport/e2e',
                takeScreenshotsOnlyOnFailures: true,
                showColors: true,
                filePrefix: browserName + '-' + new RegExp('[^/]+$').exec(config.specs[0])[0] + '-e2eTestsJunitReport',
                modifySuiteName: function(generatedSuiteName) {
                    return browserName + '.' + generatedSuiteName;
                }
            });
            jasmine.getEnv().addReporter(junitReporter);
        });

Please try this and lemme know Thanks

AvaJay commented 6 years ago

Unfortunately I cant get it to work, I have stripped the onPrepare back to the bare minimum but still it is not rerunning my failed tests

onPrepare: function() { retry.onPrepare(); return testUtils.prereqSetup(testConfig.baseUrl); },

Apologies, I omitted

return testUtils.prereqSetup(testConfig.baseUrl);

from the initial onPrepare that I sent to you.

The error is still the same

Re-running tests , attempt : 1 Re-running the following test files : /Users/Ava/Automation/test/e2e/ui/test/PageNavTests.ui.js

 Closing report
 [21:18:46] E/launcher - Process exited with error code 100

And debug output is also the same. Any other ideas? Thanks!

amrot17 commented 6 years ago

can you please try without

return testUtils.prereqSetup(testConfig.baseUrl);

wanna see if the retry module is conflicting with other modules or not

AvaJay commented 6 years ago

If run it without this line all of the tests are failing because the server url is incomplete, it gets set the testUtils.prereqSetup depending on what env we are running against. After the 3 tests fail I am getting the same error as above, re-running tests, attempt : 1 ... closing report...

amrot17 commented 5 years ago

@AvaJay we did some fixes in the newer version , please use the latest and check if this fixed your issue

MartinIvison commented 5 years ago

As a note, E/launcher - Process exited with error code 100 also shows up when you are trying to exercise capabilities not covered by your Browserstack plan (e.g. Mobile).