From b1dd31bffd50c7c826c1fea869aa6782ab333ffa Mon Sep 17 00:00:00 2001 From: Nigel Heron Date: Fri, 9 Mar 2018 16:54:06 -0500 Subject: [PATCH] Edge, IE and Safari e2e support --- Gruntfile.js | 45 ++++++++++++++++++++++++++++--- tests/protractor.config.edge.js | 26 ++++++++++++++++++ tests/protractor.config.ie.js | 26 ++++++++++++++++++ tests/protractor.config.safari.js | 27 +++++++++++++++++++ 4 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 tests/protractor.config.edge.js create mode 100644 tests/protractor.config.ie.js create mode 100644 tests/protractor.config.safari.js diff --git a/Gruntfile.js b/Gruntfile.js index bbb0d3715..434d62112 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -30,7 +30,7 @@ var TEST_RESULTS_PATH = path.join("tests", "results"); var TEST_DEBUG_PORT = 4002; var TEST_URL_BASE = grunt.option("test-url") || "http://" + boomerangE2ETestDomain + ":4002"; -var SELENIUM_ADDRESS = "http://" + boomerangE2ETestDomain + ":4444/wd/hub"; +var SELENIUM_ADDRESS = grunt.option("selenium-address") || "http://" + boomerangE2ETestDomain + ":4444/wd/hub"; var E2E_BASE_URL = "http://" + boomerangE2ETestDomain + ":4002/"; var DEFAULT_BROWSER = grunt.option("browser") || "ChromeHeadless"; @@ -561,7 +561,8 @@ module.exports = function() { "IE", "Opera", "PhantomJS", - "Safari" + "Safari", + "Edge" ] }, allHeadless: { @@ -665,6 +666,36 @@ module.exports = function() { } } }, + Edge: { + options: { + configFile: "tests/protractor.config.edge.js", + args: { + seleniumAddress: SELENIUM_ADDRESS, + specs: ["tests/e2e/e2e.js"], + baseUrl: E2E_BASE_URL + } + } + }, + IE: { + options: { + configFile: "tests/protractor.config.ie.js", + args: { + seleniumAddress: SELENIUM_ADDRESS, + specs: ["tests/e2e/e2e.js"], + baseUrl: E2E_BASE_URL + } + } + }, + Safari: { + options: { + configFile: "tests/protractor.config.safari.js", + args: { + seleniumAddress: SELENIUM_ADDRESS, + specs: ["tests/e2e/e2e.js"], + baseUrl: E2E_BASE_URL + } + } + }, debug: { options: { configFile: "tests/protractor.config.debug.js", @@ -899,13 +930,16 @@ module.exports = function() { // End-to-End tests "test:e2e": ["test:e2e:" + DEFAULT_BROWSER], - "test:e2e:browser": ["test:build", "build", "express:dev", "express:secondary", "protractor_webdriver"], + "test:e2e:browser": ["test:build", "build", "express:dev", "express:secondary"], "test:e2e:debug": ["test:e2e:browser", "protractor:debug"], "test:e2e:PhantomJS": ["test:e2e:browser", "protractor:PhantomJS"], "test:e2e:Chrome": ["test:e2e:browser", "protractor:Chrome"], "test:e2e:ChromeHeadless": ["test:e2e:browser", "protractor:ChromeHeadless"], "test:e2e:Firefox": ["test:e2e:browser", "protractor:Firefox"], "test:e2e:FirefoxHeadless": ["test:e2e:browser", "protractor:FirefoxHeadless"], + "test:e2e:Edge": ["test:e2e:browser", "protractor:Edge"], + "test:e2e:IE": ["test:e2e:browser", "protractor:IE"], + "test:e2e:Safari": ["test:e2e:browser", "protractor:Safari"], // Documentation "test:doc": ["clean", "jsdoc", "express:doc", "watch:doc"], @@ -918,6 +952,11 @@ module.exports = function() { "test:matrix:unit:debug": ["saucelabs-mocha:unit-debug"] }; + // launch selenium if another address wasn't provided + if (!grunt.option("selenium-address")) { + aliases["test:e2e:browser"].push("protractor_webdriver"); + } + function isAlias(task) { return aliases[task] ? true : false; } diff --git a/tests/protractor.config.edge.js b/tests/protractor.config.edge.js new file mode 100644 index 000000000..1e00652e1 --- /dev/null +++ b/tests/protractor.config.edge.js @@ -0,0 +1,26 @@ +/*eslint-env node*/ +/*global jasmine*/ + +exports.config = { + onPrepare: function() { + var reporters = require("jasmine-reporters"); + + jasmine.getEnv().addReporter(new jasmine.ConsoleReporter({ + print: console.log, + showColors: true + })); + + jasmine.getEnv().addReporter(new reporters.JUnitXmlReporter({ + savePath: "tests/results", + consolidate: true, + consolidateAll: true, + useDotNotation: true, + filePrefix: "e2e" + })); + }, + // needs to be specified here (instead of in Gruntfile.js) - grunt-protractor-runner seems + // to have an issue passing in args + capabilities: { + browserName: "MicrosoftEdge" + } +}; diff --git a/tests/protractor.config.ie.js b/tests/protractor.config.ie.js new file mode 100644 index 000000000..0fff4d2f4 --- /dev/null +++ b/tests/protractor.config.ie.js @@ -0,0 +1,26 @@ +/*eslint-env node*/ +/*global jasmine*/ + +exports.config = { + onPrepare: function() { + var reporters = require("jasmine-reporters"); + + jasmine.getEnv().addReporter(new jasmine.ConsoleReporter({ + print: console.log, + showColors: true + })); + + jasmine.getEnv().addReporter(new reporters.JUnitXmlReporter({ + savePath: "tests/results", + consolidate: true, + consolidateAll: true, + useDotNotation: true, + filePrefix: "e2e" + })); + }, + // needs to be specified here (instead of in Gruntfile.js) - grunt-protractor-runner seems + // to have an issue passing in args + capabilities: { + browserName: "internet explorer" + } +}; diff --git a/tests/protractor.config.safari.js b/tests/protractor.config.safari.js new file mode 100644 index 000000000..e0ed49f19 --- /dev/null +++ b/tests/protractor.config.safari.js @@ -0,0 +1,27 @@ +/*eslint-env node*/ +/*global jasmine*/ + +exports.config = { + onPrepare: function() { + var reporters = require("jasmine-reporters"); + + jasmine.getEnv().addReporter(new jasmine.ConsoleReporter({ + print: console.log, + showColors: true + })); + + jasmine.getEnv().addReporter(new reporters.JUnitXmlReporter({ + savePath: "tests/results", + consolidate: true, + consolidateAll: true, + useDotNotation: true, + filePrefix: "e2e" + })); + }, + // needs to be specified here (instead of in Gruntfile.js) - grunt-protractor-runner seems + // to have an issue passing in args + capabilities: { + // technologyPreview: true, // uncomment to use Safari Technology Preview + browserName: "safari" + } +};