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

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

Issue 29866577: Issue 6887 - add Chrome to "npm test" (Closed)
Patch Set: Created Aug. 29, 2018, 9:15 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
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/>.
16 */
17
18 "use strict";
19
20 const FIREFOX_VERSION = "57.0";
21
22 const webdriver = require("selenium-webdriver");
23 const firefox = require("selenium-webdriver/firefox");
24 const {Command} = require("selenium-webdriver/lib/command");
25 const {ensureFirefox} = require("../../adblockpluscore/test/runners/" +
26 "firefox_download");
27
28 exports.platform = "gecko";
29
30 exports.getDriver = function(devenvPathAbsolute)
31 {
32 return ensureFirefox(FIREFOX_VERSION).then(firefoxPath =>
33 {
34 let binary = new firefox.Binary(firefoxPath);
35 binary.addArguments("-headless");
36
37 let driver = new webdriver.Builder()
38 .forBrowser("firefox")
39 .setFirefoxOptions(new firefox.Options().setBinary(binary))
40 .build();
41
42 let cmd = new Command("moz-install-web-ext")
43 .setParameter("path", devenvPathAbsolute)
44 .setParameter("temporary", true);
45
46 driver.getExecutor().defineCommand(
47 cmd.getName(), "POST",
48 "/session/:sessionId/moz/addon/install"
49 );
50 driver.schedule(cmd, `installWebExt(${devenvPathAbsolute})`);
51 return driver;
Sebastian Noack 2018/08/29 15:22:12 Nit: I think it reads a little better with a blank
tlucas 2018/09/01 09:38:31 Done.
52 });
53 };
OLDNEW
« test/all.js ('K') | « test/browsers/chromium.js ('k') | test/firefox.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld