protractor
protractor copied to clipboard
Protractor does not exit when test fails - Custom FW: CucumberJS
Hello!! I think there's an issue with Protractor and CucumberJS not sure which one is causing it, since when it fails, it would leave a browser opened consuming memory! can you please take a look?
Here are my configurations:
"cucumber": "^0.9.2",
"gulp": "~3.9.0",
"gulp-protractor": "^2.1.0",
"protractor": "3.0.0",
"protractor-cucumber-framework": "^0.3.2",
"selenium-standalone": "4.8.0",
$ node --version
v5.3.0
$ npm --version
3.5.2
And my protractor.config has:
exports.config = {
//seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumAddress: 'http://localhost:4444/wd/hub',
//seleniumAddress: 'http://selenium.servers.photorank.me:4444/wd/hub',
//directConnect: true,//To run test directly against Chrome/FFs
specs: [
'e2e/features/*.feature'
],
multiCapabilities: [
//{
// 'browserName': 'chrome',
// 'chromeOptions': {
// 'args': ['show-fps-counter=true','enable-logging','v=1','net-log-level=0']
// },
// 'specs':'features/**/*.feature'
//},
{
'browserName': 'firefox',
'specs':'features/**/*.feature'
},
// ,
// {
// 'browserName': 'safari'
// },
// {
// 'browserName': 'phantomjs',
// 'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs',
// 'phantomjs.cli.args':'--debug=true --loglevel=DEBUG --webdriver --webdriver-loglevel=DEBUG'
// }
],
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
cucumberOpts: {
require: 'features/step_definitions/**/*.js',
format: 'json',
tags: "@wip"
},
resultJsonOutputFile: 'report.json',
//count: 2,
//shardTestFiles: true,
//maxInstances:2,
onPrepare: function () {
browser.getCapabilities().then(function (capabilities) {
browser.capabilities = capabilities;
});
browser.driver.manage().window().maximize();
browser.ignoreSynchronization = true; //This is set for non-Angular apps
browser.manage().timeouts().implicitlyWait(20000);
}
//,
//onCleanUp: function(exitCode) {
// if (exitCode ==1){
// console.log("Getting out");
// browser.quit();
// };
//},
};
I'm also having problems "forcing" a browser quit, on my last step verification (which fails), I've placed:
this.Then(/^I see that the item has moved/, function (done) {
browser.sleep(500);
sliderWidgetPage.getImageAndAttribute(0,'data-url').then(function (attrVal) {
expect(attrAtX1Time).to.eventually.be.equal(attrVal);
});
browser.quit();
done();
});
and the browser.quit() does not close the session/browser.
is it possible that the command got broken?
Thanks!!
Closing as an individual support question, not a general bug report.