I've tried to set up Protractor with Grunt via grunt-protractor-runner. The problem is that I want to be able to run all that automatically and:
webdriver start to be run manuallywebdriver is ready.This creates a problem as my grunt testE2E command has to start webdriver somehow to be able to run Protractor tests. webdriver start cannot be run in a synchronous mode since it blocks but it also cannot be run in the background as then Protractor doesn't wait until it's fully initialized.
Is there any way around that? I want to test in both Firefox & Chrome so I need the Seleniun server for that.
EDIT: I assume there is no Firefox driver available that would allow one to skip Selenium for this browser as well? (i.e. it's not only an issue of implementing support in Protractor but that needed software is missing?)
I think this question should best fit within the grunt-protractor-runner repo.
You should probably look option seleniumServerJar at https://github.com/teerapap/grunt-protractor-runner#optionsargs
Anyway, you should have selenium running all the time.
Before you start hacking simple open a new terminal and run
webdriver-manager start
If you are running a CI, perhaps with Jenkins, there is a Selenium plugin that will help set you up.
Why is having Selenium running all the time preferred? It's only needed during testing after all.
This is also not only a question for Jenkins-related stuff, a lot of coworkers will need to sometimes run tests locally and any additional thing they need to remember is a potential source of problems (especially that the error is quite cryptic).
Currently if they want to run tests locally, all they have to do is run grunt test. Ideally, that would be all that's needed.
Protractor would start a selenium-webdriver server automatically if you
omit the seleniumAddress config option ;) so all is needed is a config
file and to run protractor e2e.conf.js that's it.
@elgalu You're right, thanks. :) I'm closing it then.
I'm glad it worked! :)
Nice!
Most helpful comment
Protractor would start a selenium-webdriver server automatically if you
omit the
seleniumAddressconfig option ;) so all is needed is a configfile and to run
protractor e2e.conf.jsthat's it.