jenkins angularjs e2e karma test with webdriver

Posted: October 15, 2014 in web

Jenkins settings:

Execute shell:

#npm install
#bower install –dev
grunt cibuild
node_modules/protractor/bin/webdriver-manager start > /dev/null 2>&1 &
while ! curl http://localhost:4444/wd/hub/status &>/dev/null; do :; done
grunt cie2e

Grunt.js

...
grunt.loadNpmTasks('grunt-protractor-runner');
...
        karma: {
            unit: {
                configFile: 'test/karma.conf.js',
                singleRun: true
            },
// Jenkins settings
            continuous: {
                configFile: 'test/karma.conf.js',
                singleRun: true,
                browsers: ['PhantomJS']
            }
        },
...
    grunt.registerTask('cibuild', [
        'karma:continuous',
        'build'
    ]);
    grunt.registerTask('cie2e', [
        'clean:server',
        'processhtml:e2e',
        'concurrent:server',
        'autoprefixer',
        'connect:livereload',
        'protractor:run'
    ]);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s