Index: test/runners/edge_process.js |
diff --git a/lib/filterNotifier.js b/test/runners/edge_process.js |
similarity index 52% |
copy from lib/filterNotifier.js |
copy to test/runners/edge_process.js |
index f10be3ef2e3dfd05affaea0fce8b83cdd99abf83..c9630d4c8b08c27326cfe1905d127e358be9cca0 100644 |
--- a/lib/filterNotifier.js |
+++ b/test/runners/edge_process.js |
@@ -17,17 +17,29 @@ |
"use strict"; |
-/** |
- * @fileOverview This component manages listeners and calls them to distribute |
- * messages about filter changes. |
- */ |
+const edge = require("selenium-webdriver/edge"); |
Sebastian Noack
2018/11/09 19:13:43
Nit: The blank line here seems superfluous.
geo
2018/11/09 19:45:09
Done.
|
-const {EventEmitter} = require("./events"); |
+const {executeScript} = require("./webdriver"); |
-/** |
- * This object allows registering and triggering listeners for filter events. |
- * @type {EventEmitter} |
- */ |
-let filterNotifier = new EventEmitter(); |
+function runScript(script, scriptName, scriptArgs) |
+{ |
+ let service = new edge.ServiceBuilder() |
+ .addArguments("--jwp") |
Sebastian Noack
2018/11/09 19:13:43
Mind adding a comment why that is necessary, and t
geo
2018/11/09 19:45:09
Done.
|
+ .build(); |
+ let options = new edge.Options(); |
+ |
+ let driver = edge.Driver.createSession(options, service); |
+ |
+ return executeScript(driver, "Microsoft Edge (WebDriver)", |
+ script, scriptName, scriptArgs); |
+} |
-exports.filterNotifier = filterNotifier; |
+module.exports = function(script, scriptName, ...scriptArgs) |
+{ |
+ return runScript(script, scriptName, scriptArgs) |
+ .then(result => result) |
+ .catch(error => |
+ { |
+ throw error; |
+ }); |
Sebastian Noack
2018/11/09 19:13:43
What is the purpose of the then() and catch() call
geo
2018/11/09 19:45:09
Done.
|
+}; |