I'm trying to get e2e testing going with on my angular project using Gulp.
I'm able to get it working, but only if I manually launch a standalone selenium server using webdriver-manager start
in a seperate terminal window.
Ideally I would like my gulp task to manage starting and stopping the server so as to not add more overhead for my team to run these tests.
I got set up following the instructions here:
https://github.com/mllrsohn/gulp-protractor
They describe 2 options for starting the selenium server. One is to set up a gulp task which appears to do the same thing as webdriver-manager start
:
gulp.task('webdriver_standalone', require("gulp-protractor").webdriver_standalone);
This works, but not when I have my e2eTest task invoke it as a dependency. I have to run gulp webdriver_standalone
in a seperate terminal window.
I cannot understand the other suggested option.
point to the selenium jar in the protractor config file
These instructions require a path to the selenium-server-standalone jar, in protractor
s node_modules
(./node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar
), but my node_modules/protractor/
directory does not have such a jar (or a selenium
sub-directory at all)
The instructions for Running Protractor without a plugin seem to have the same problem of having to run the selenium server in another terminal window.
Is there a way to get this set up so that a single gulp task starts the standalone server, runs the tests, and shuts it down with no other intervention?
When you run Protractor you have several options regarding Selenium WebDriver (remember that WebDriver is web-service written in Java):
In your case simply run:
./node_modules/protractor/bin/webdriver-manager update
It will download Selenium. Then point config to the right jar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With