LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 14 matching lines...) Expand all Loading... |
25 const firefox = require("selenium-webdriver/firefox"); | 25 const firefox = require("selenium-webdriver/firefox"); |
26 const {Command} = require("selenium-webdriver/lib/command"); | 26 const {Command} = require("selenium-webdriver/lib/command"); |
27 const {ensureFirefox} = require("../adblockpluscore/test/runners/" + | 27 const {ensureFirefox} = require("../adblockpluscore/test/runners/" + |
28 "firefox_download"); | 28 "firefox_download"); |
29 | 29 |
30 function reportElements(test, driver, success) | 30 function reportElements(test, driver, success) |
31 { | 31 { |
32 return driver.findElements( | 32 return driver.findElements( |
33 By.css(`#qunit-tests ${success ? ".pass" : ".fail"} .test-name`) | 33 By.css(`#qunit-tests ${success ? ".pass" : ".fail"} .test-name`) |
34 ).then(elements => Promise.all(elements.map(elem => | 34 ).then(elements => Promise.all(elements.map(elem => |
35 elem.getAttribute("innerHTML").then(data => test.ok(success, data)) | 35 elem.getAttribute("innerHTML").then(data => test.ok(success, data)) |
36 ))); | 36 ))); |
37 } | 37 } |
38 | 38 |
39 exports.runFirefox = function(test) | 39 exports.runFirefox = function(test) |
40 { | 40 { |
41 // https://stackoverflow.com/a/45045036 | 41 // https://stackoverflow.com/a/45045036 |
42 function installWebExt(driver, extension) | 42 function installWebExt(driver, extension) |
43 { | 43 { |
44 let cmd = new Command("moz-install-web-ext") | 44 let cmd = new Command("moz-install-web-ext") |
45 .setParameter("path", path.resolve(extension)) | 45 .setParameter("path", path.resolve(extension)) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 driver.quit(); | 99 driver.quit(); |
100 test.done(); | 100 test.done(); |
101 }, err => | 101 }, err => |
102 driver.quit().then(() => | 102 driver.quit().then(() => |
103 { | 103 { |
104 throw err; | 104 throw err; |
105 }) | 105 }) |
106 ); | 106 ); |
107 }); | 107 }); |
108 }; | 108 }; |
LEFT | RIGHT |