I'am running an E2E test for an angular app. I did edit the protractor.conf.js
in order to use SeleniumStandalone. It looks good, and I can run the test using: ng e2e
.
protractor.conf.js
:
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
// location of the Selenium JAR file and chromedriver, use these if you installed protractor locally
seleniumServerJar: './node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.1.jar',
chromeDriver: './node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34',
seleniumPort: '4444',
allScriptsTimeout: 11000,
capabilities: {
browserName: 'chrome',
name: 'Unnamed Job',
specs: ['./e2e/**/*.e2e-spec.ts']
},
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
My issue is that selenium server get shut down automatically and immediately after the test is done. How to prevent this behavior? Is there an option to add in protractor.conf.js
to fix this?
Here is the output in terminal after I run: ng e2e
:
webpack: Compiled successfully.
[16:10:36] I/update - chromedriver: file exists /Users/kvincent/PROJECT - DECEMBER/UserApp/19_12-t-04_16/consumer-app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34.zip
[16:10:36] I/update - chromedriver: unzipping chromedriver_2.34.zip
[16:10:36] I/update - chromedriver: setting permissions to 0755 for /Users/kvincent/PROJECT - DECEMBER/UserApp/19_12-t-04_16/consumer-app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34
[16:10:36] I/update - chromedriver: chromedriver_2.34 up to date
[16:10:36] I/launcher - Running 1 instances of WebDriver
[16:10:36] I/local - Starting selenium standalone server...
[16:10:37] I/local - Selenium standalone server started at http://192.168.0.4:4444/wd/hub
Jasmine started
Executed 0 of 0 specs SUCCESS in 0.003 sec.
[16:10:38] I/local - Shutting down selenium standalone server.
[16:10:38] I/launcher - 0 instance(s) of WebDriver still running
[16:10:38] I/launcher - chrome #01 passed
[email protected]:~/PROJECT - DECEMBER/UserApp/19_12-t-04_16/consumer-app$
As you can see in the following line: [16:10:38] I/local - Shutting down selenium standalone server.
the selenium-standalone is being shut down and it looks like it's a normal behavior.