Skip to content

Commit

Permalink
Edge, IE and Safari e2e support
Browse files Browse the repository at this point in the history
  • Loading branch information
querymetrics authored and nicjansma committed Apr 4, 2018
1 parent 745792b commit b1dd31b
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 3 deletions.
45 changes: 42 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -561,7 +561,8 @@ module.exports = function() {
"IE",
"Opera",
"PhantomJS",
"Safari"
"Safari",
"Edge"
]
},
allHeadless: {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"],
Expand All @@ -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;
}
Expand Down
26 changes: 26 additions & 0 deletions tests/protractor.config.edge.js
Original file line number Diff line number Diff line change
@@ -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"
}
};
26 changes: 26 additions & 0 deletions tests/protractor.config.ie.js
Original file line number Diff line number Diff line change
@@ -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"
}
};
27 changes: 27 additions & 0 deletions tests/protractor.config.safari.js
Original file line number Diff line number Diff line change
@@ -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"
}
};

0 comments on commit b1dd31b

Please sign in to comment.