I would like to add to our CI build process some e2e tests. I have already added them against chrome + firefox (as the simplest ones). But I really want to do it for several IE versions. How is it possible to inject it in build process on linux/mac?
I found such article: http://elgalu.github.io/2014/run-protractor-against-internet-explorer-vm/
But looks like it is not 100% what I need. Could some one provide a simple configuration sample?
Protractor make use of Selenium Grid to initialize, control and run browser instance. Can easily integrate with jasmine, mocha and cucumber framework to write your test.
To install and start the standalone Selenium Server manually, use the webdriver-manager command line tool, which comes with Protractor. Run the update command: webdriver-manager update This will install the server and ChromeDriver. Run the start command: webdriver-manager start This will start the server.
You would need a selenium server, either your own, or at browserstack
/SauceLabs
. If you are planning to do it on your own, in short, you would need to setup a selenium grid and register nodes, one of the nodes should be a windows machine where you would run tests against IE.
Personally, I've been successfully running protractor e2e tests on multiple browsers including different Chrome
, Firefox
and IE
versions on browserstack. Here's the configuration I use (it also includes jasmine junit reporter
, needed this for the CI):
'use strict';
var browserstackUser = 'user';
var browserstackKey = 'key';
exports.config = {
multiCapabilities: [
{
'browserstack.user': browserstackUser,
'browserstack.key': browserstackKey,
'browserstack.local': 'true',
'browserstack.debug': 'true',
'browserName': 'Chrome',
'os': 'Windows',
'os_version': '8',
'resolution': '1024x768',
specs: [
'*.spec.js'
],
exclude: [
'footer.disabledCookies.spec.js'
]
},
{
'browserstack.user': browserstackUser,
'browserstack.key': browserstackKey,
'browserstack.local': 'true',
'browserstack.debug': 'true',
'browser': 'Internet Explorer',
'browser_version': '8.0',
'os': 'Windows',
'os_version': '7',
'resolution': '1024x768',
specs: [
'*.spec.js'
]
},
{
'browserstack.user': browserstackUser,
'browserstack.key': browserstackKey,
'browserstack.local': 'true',
'browserstack.debug': 'true',
'browserName': 'Internet Explorer',
'browser_version': '9.0',
'os': 'Windows',
'os_version': '7',
'resolution': '1024x768',
specs: [
'*.spec.js'
],
exclude: [
'footer.disabledCookies.spec.js'
]
}
],
// Browserstack's selenium server address
seleniumAddress: 'http://hub.browserstack.com/wd/hub',
framework: 'jasmine',
allScriptsTimeout: 300000,
baseUrl: 'http://localhost:9001',
onPrepare: function () {
require('jasmine-reporters');
var capsPromise = browser.getCapabilities();
capsPromise.then(function (caps) {
var browserName = caps.caps_.browserName.toUpperCase();
var browserVersion = caps.caps_.version;
var prePendStr = browserName + "-" + browserVersion + "-";
jasmine.getEnv().addReporter(new
jasmine.JUnitXmlReporter("test-results", true, true, prePendStr));
});
},
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
includeStackTrace: true,
defaultTimeoutInterval: 3600000
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With