Using Testacular with Jenkins for AngularJS e2e Testing

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. It's likely dead, dying, or wildly inaccurate.


  • AngularJS in your code ✓
  • Jenkins ✓
  • Node.js is installed on the Jenkins server? ✓
  • Testacular is installed on the Jenkins server ✓* PhantomJS is installed on the Jenkins server ✓

If that’s what you’re using, this is how I set up testing on the Jenkins server.

  1. Create a new job in Jenkins
  2. Pull from Git (or whatever), Trigger how you want too. That’s not germane to this article.
  3. Inject some environment variables (may need to install a plugin for this) Env Vars
  4. Start a web server on the Jenkins server for Testacular to use and call the target in the build.xml script (see below) Web Server
  5. Generate the report (test_out/e2e.xml is configured in testacular-e2e.conf.js) xunit


<?xml version="1.0" encoding="UTF-8"?>
<project name="My Project" default="build" basedir=".">
    <target name="testacular-e2e" description="Testacular AngularJS e2e Tests">
        <echo message="Running the tests ..." />
        <exec executable="testacular" output="test_out/output.txt" failonerror="true">
            <arg value="start" />
            <arg value="./config/testacular-e2e.conf.js" />
        <echo message="Tests done" />


basePath = '../';

files = [

autoWatch = false;

browsers = ['PhantomJS'];

reporters = ['dots', 'junit'];
singleRun = true;

proxies = {
  '/': 'http://localhost:8000/'

junitReporter = {
  outputFile: 'test_out/e2e.xml',
  suite: 'e2e'

Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. [email protected]