Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/all.js

Issue 29959561: Issue 6930 - Add support for Microsoft Edge to WebDriver-based test automation
Patch Set: Created Dec. 5, 2018, 1:09 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/all.js
diff --git a/test/all.js b/test/all.js
index f6cca8fd31f4d3ee28fcb3a144f27f5a075aac17..d6cf77318cb118045c9587e91f9a07ee70247513 100644
--- a/test/all.js
+++ b/test/all.js
@@ -19,11 +19,16 @@
const glob = require("glob");
const path = require("path");
+const os = require("os");
const {exec} = require("child_process");
function getBrowserBinaries(module, browser)
{
let spec = process.env[`${browser.toUpperCase()}_BINARY`];
+
+ if (browser == "edge")
Sebastian Noack 2018/12/06 03:47:31 Nit: This can go at the very top of the function.
+ return [{version: "installed", getPath: () => Promise.resolve(null)}];
Sebastian Noack 2018/12/06 03:47:31 Nit: The version property only exists to distingui
+
if (spec)
{
if (spec == "installed")
@@ -55,10 +60,13 @@ for (let backend of glob.sync("./test/browsers/*.js"))
for (let binary of getBrowserBinaries(module, browser))
{
let description = browser.replace(/./, c => c.toUpperCase());
+ let describeTest = module.platform == "edge" && os.platform() != "win32" ?
+ describe.skip : describe;
Sebastian Noack 2018/12/06 03:47:31 Is this sufficient? I suppose the before() hook wo
+
if (binary.version)
description += ` (${binary.version})`;
- describe(description, function()
+ describeTest(description, function()
{
this.timeout(0);
@@ -84,6 +92,21 @@ for (let backend of glob.sync("./test/browsers/*.js"))
return Promise.all([binary.getPath(), devenvCreated]).then(
([browserBinary]) =>
{
+ if (module.platform == "edge" && os.platform() == "win32")
+ {
+ return module
+ .sideloadExtension(`devenv.${module.platform}`)
+ .then(extensionPath =>
+ {
+ this.driver = module.getDriver(extensionPath);
+
+ return this.driver.sleep(3000)
Sebastian Noack 2018/12/06 03:47:30 Is this really necessary? Or is there any promise
+ .then(() => this.driver.wait(() =>
+ this.driver.getAllWindowHandles()
+ .then(handles => handles[1])));
+ });
+ }
+
this.driver = module.getDriver(
browserBinary,
path.resolve(`./devenv.${module.platform}`)

Powered by Google App Engine
This is Rietveld