5

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?

alecxe
  • 414,977
  • 106
  • 935
  • 1,083
Sergey Teplyakov
  • 593
  • 6
  • 17

1 Answers1

3

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
    }
};
alecxe
  • 414,977
  • 106
  • 935
  • 1,083
  • niceeee, I really have not thought about browserstack... We have already had an account here actually, but for some manual testing purposes, it could really work. I hope base automate subscription will be enough for 5 browser versions... it says 2 parallel tests – Sergey Teplyakov Nov 21 '14 at 20:47
  • @user2174981 yeah, I think we are using the cheapest plan there with 2 parallel tests, for us it's enough but we are having automated tests running there only for a single internal project, we'll though use bs more extensively - will see if it would be enough. Glad it helped, happy testing. – alecxe Nov 22 '14 at 05:21