Reputation: 1061
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?
Upvotes: 5
Views: 3428
Reputation: 11275
A fully working example of such configuration can be found on angular-seed project. https://github.com/angular/angular-seed
I have managed to successfully use this example to use protractor
tests in my GitHub project: https://github.com/atais/angular-eonasdan-datetimepicker
So you may use either to help you out.
Basically the easiest way is to:
http-server
as daemonpackage.json
)Full code is avaialable here: https://stackoverflow.com/a/41983565/1549135
Upvotes: 0
Reputation: 473873
You need to do this in multiple steps/tasks with the help of gulp
:
gulp-webserver
(you were missing this step)Upvotes: 6