Reputation: 1362
I'm using protractor
(with grunt-protractor-runner
to run my E2E Angular tests), but I can't get PhantomJS to start automatically.
My protractor config looks like this:
exports.config = {
//seleniumAddress: "http://localhost:9515",
specs: [
'static_src/test/spec/*.js'
],
capabilities: {
'browserName': 'phantomjs',
'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs',
'phantomjs.cli.args':['--logfile=phantom.log', '--loglevel=DEBUG']
}
}
My understanding is that with that configuration protractor
will automatically spin up a PhantomJS instance (found on phantomjs.binary.path
), run the tests against it, communicating directly using the WebDriver protocol (so no need for a Selenium server), and then spin down the PhantomJS instance.
Given that,
Upvotes: 4
Views: 3726
Reputation: 751
Protractor always needs a Selenium standalone server. You can start it using the webdriver-manager and referring to the address in your protract.conf.js
or you can specify the location of the jar
and Protractor will start it for you.
Refer the jar
in your configuration, e.g.:
seleniumServerJar:
'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.38.0.jar'
Using this method, you don't have to worry about the selenium server starting up, but it is a little slower. So if you need to rerun your tests often it is faster to start the it as standalone, independent from Protractor.
Upvotes: 1