OLD | NEW |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 "use strict"; | 18 "use strict"; |
19 | 19 |
20 const webdriver = require("selenium-webdriver"); | 20 const webdriver = require("selenium-webdriver"); |
21 const firefox = require("selenium-webdriver/firefox"); | 21 const firefox = require("selenium-webdriver/firefox"); |
22 const {Command} = require("selenium-webdriver/lib/command"); | 22 const {Command} = require("selenium-webdriver/lib/command"); |
23 const {ensureFirefox} = require("../../adblockpluscore/test/runners/" + | 23 const {ensureFirefox} = require("../../adblockpluscore/test/runners/" + |
24 "firefox_download"); | 24 "firefox_download"); |
| 25 require("geckodriver"); |
25 | 26 |
26 exports.platform = "gecko"; | 27 exports.platform = "gecko"; |
27 exports.oldestCompatibleVersion = "57.0"; | 28 exports.oldestCompatibleVersion = "57.0"; |
28 exports.ensureBrowser = ensureFirefox; | 29 exports.ensureBrowser = ensureFirefox; |
29 | 30 |
30 exports.getDriver = function(browserBinary, devenvPath) | 31 exports.getDriver = function(browserBinary, devenvPath) |
31 { | 32 { |
32 let options = new firefox.Options(); | 33 let options = new firefox.Options(); |
33 options.setBinary(browserBinary); | 34 options.setBinary(browserBinary); |
34 options.headless(); | 35 options.headless(); |
35 | 36 |
36 let driver = new webdriver.Builder() | 37 let driver = new webdriver.Builder() |
37 .forBrowser("firefox") | 38 .forBrowser("firefox") |
38 .setFirefoxOptions(options) | 39 .setFirefoxOptions(options) |
39 .build(); | 40 .build(); |
40 | 41 |
41 let cmd = new Command("moz-install-web-ext") | 42 let cmd = new Command("moz-install-web-ext") |
42 .setParameter("path", devenvPath) | 43 .setParameter("path", devenvPath) |
43 .setParameter("temporary", true); | 44 .setParameter("temporary", true); |
44 | 45 |
45 driver.getExecutor().defineCommand( | 46 driver.getExecutor().defineCommand( |
46 cmd.getName(), "POST", | 47 cmd.getName(), "POST", |
47 "/session/:sessionId/moz/addon/install" | 48 "/session/:sessionId/moz/addon/install" |
48 ); | 49 ); |
49 driver.schedule(cmd, `installWebExt(${devenvPath})`); | 50 driver.schedule(cmd, `installWebExt(${devenvPath})`); |
50 | 51 |
51 return driver; | 52 return driver; |
52 }; | 53 }; |
OLD | NEW |