1
votes

I'm trying to get some protractor tests going on Teamcity with Grunt.

I am uncertain how to set up the runner. I've tried using command line runner, but with no success.

I am able to call protractor with Grunt, but the issue is with 'webdriver-manager start'.

I am able to start the Selenium server but the server does not terminate, so build sits there and TC doesn't know when to start protractor tests...

What is the best approach for setting up Protractor tests with Teamcity? Is it common to let Selenium run all the time on the agent?

Thanks in advance

3

3 Answers

2
votes

You can write Ant Script that will run your test, with it can launch different apps, like Selenium server with some parameters. I use Ant to run my Selenium WebDriver Tests on Team City (URL: http://joxi.ru/uploads/prod/2013/12/09/c35/2e7/c0400edc3ee4e58b13a2fc113112526414dfa211.jpg?v=2.4.0) enter image description here

  <target name="run-test" failonerror="true">
        <exec executable="dir\file.exe">
            <arg value="-t target"/>
            <arg line="some line" />
        </exec>
  </target>

If it returns exit code 0 then your test ran succeful

2
votes

I'm working on this now and have something mostly working. Assuming you're using the grunt protractor runner, try removing seleniumAddress from your protractor.conf.js file. If it's not supplied, grunt (or protractor or something) will launch it for you and shut it down afterward.

0
votes

If you don't want to run the selenium-Server the you can add the below code in the conf.js directConnect:True