0 votes
1 view
in DevOps and Agile by (19.8k points)

I am writing automation test scripts using Protractor and now I need to set up the CI for this using Jenkins.

Tasks it needs to perform are:

  1. Starting the selenium standalone server.
  2. Starting the test using the conf.js file.
  3. Stopping the selenium standalone server.

Can anyone help in this regard?

1 Answer

0 votes
by (63.4k points)

I created a script, as follows:

# start selenium

./node_modules/protractor/bin/webdriver-manager start > /dev/null 2>&1 &

# wait until selenium is up

while ! curl http://localhost:4444/wd/hub/status &>/dev/null; do :; done

# run the build

grunt cibuild --force

# stop selenium

curl -s -L http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer > /dev/null 2>&1

Welcome to Intellipaat Community. Get your technical queries answered by top developers !