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

Side by Side Diff: test/browsers/firefox.js

Issue 29891666: Noissue - Enable tests to run on other browser versions (Closed)
Patch Set: Created Sept. 25, 2018, 7:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« test/all.js ('K') | « test/browsers/chromium.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 FIREFOX_VERSION = "57.0";
21
22 const webdriver = require("selenium-webdriver"); 20 const webdriver = require("selenium-webdriver");
23 const firefox = require("selenium-webdriver/firefox"); 21 const firefox = require("selenium-webdriver/firefox");
24 const {Command} = require("selenium-webdriver/lib/command"); 22 const {Command} = require("selenium-webdriver/lib/command");
25 const {ensureFirefox} = require("../../adblockpluscore/test/runners/" + 23 const {ensureFirefox} = require("../../adblockpluscore/test/runners/" +
26 "firefox_download"); 24 "firefox_download");
27 25
28 exports.platform = "gecko"; 26 exports.platform = "gecko";
29 27 exports.oldestCompatibleVersion = "57.0";
30 exports.ensureBrowser = function() 28 exports.ensureBrowser = ensureFirefox;
31 {
32 return ensureFirefox(FIREFOX_VERSION);
33 };
34 29
35 exports.getDriver = function(browserBinary, devenvPath) 30 exports.getDriver = function(browserBinary, devenvPath)
36 { 31 {
37 let binary = new firefox.Binary(browserBinary); 32 let options = new firefox.Options();
38 binary.addArguments("-headless"); 33 options.setBinary(browserBinary);
34 options.headless();
39 35
40 let driver = new webdriver.Builder() 36 let driver = new webdriver.Builder()
41 .forBrowser("firefox") 37 .forBrowser("firefox")
42 .setFirefoxOptions(new firefox.Options().setBinary(binary)) 38 .setFirefoxOptions(options)
43 .build(); 39 .build();
44 40
45 let cmd = new Command("moz-install-web-ext") 41 let cmd = new Command("moz-install-web-ext")
46 .setParameter("path", devenvPath) 42 .setParameter("path", devenvPath)
47 .setParameter("temporary", true); 43 .setParameter("temporary", true);
48 44
49 driver.getExecutor().defineCommand( 45 driver.getExecutor().defineCommand(
50 cmd.getName(), "POST", 46 cmd.getName(), "POST",
51 "/session/:sessionId/moz/addon/install" 47 "/session/:sessionId/moz/addon/install"
52 ); 48 );
53 driver.schedule(cmd, `installWebExt(${devenvPath})`); 49 driver.schedule(cmd, `installWebExt(${devenvPath})`);
54 50
55 return driver; 51 return driver;
56 }; 52 };
OLDNEW
« test/all.js ('K') | « test/browsers/chromium.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld