Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor and Selenium in Gulp and Jenkins

I'm super confused about how to tell Protractor and Selenium from where to serve my application for the integration tests (running Gulp on Jenkins).

This is my protractor configuration:

exports.config = {
    seleniumServerJar: '../node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar',

    multiCapabilities: [{
        browserName: 'chrome'
    }],

    baseUrl: 'http://127.0.0.1:9000/',

    rootElement: 'html',

    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    }
};

But here's the problem: http://127.0.0.1:9000 doesn't exist. Should I deploy first and then do the integration tests or can it be done before deploying? Because if deploy needs to be done first, then it doesn't make any sense to me as to where to put it into the build system. Because then this is not and cannot be a part of a build system. So where does CI come in?

like image 502
Alex Avatar asked Dec 12 '14 13:12

Alex


1 Answers

You need to do this in multiple steps/tasks with the help of gulp:

  • start a selenium server (if you are using a local selenium server)
  • start a web server, see gulp-webserver (you were missing this step)
  • run protractor tests
  • shutdown a web server
  • shutdown a selenium server
like image 129
alecxe Avatar answered Sep 22 '22 06:09

alecxe