-
Notifications
You must be signed in to change notification settings - Fork 1
/
manual_test.js
49 lines (38 loc) · 1.53 KB
/
manual_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* eslint-env node */
/* This file is a helper script that will install the extension from the .xpi
* file and setup useful preferences for debugging. This is the same setup
* that the automated Selenium-Webdriver/Mocha tests run, except in this case
* we can manually interact with the browser.
* NOTE: If changes are made, they will not be reflected in the browser upon
* reloading, as the .xpi file has not been recreated.
*/
console.log("Starting up firefox");
const utils = require("./test/utils");
const firefox = require("selenium-webdriver/firefox");
const Context = firefox.Context;
(async() => {
try {
const driver = await utils.promiseSetupDriver();
console.log("Starting up firefox");
//* // add the share-button to the toolbar
//* await utils.addShareButton(driver);
//* // set the treatment
//* await driver.executeAsyncScript((typeArg, callback) => {
//* Components.utils.import("resource://gre/modules/Preferences.jsm");
//* if (typeArg !== null) {
//* Preferences.set("extensions.sharebuttonstudy.treatment", typeArg);
//* }
//* callback();
//* }, "doorhangerAskToAdd");
// install the addon
await utils.installAddon(driver);
console.log("Load temporary addon.");
// navigate to a regular page
//* driver.setContext(Context.CONTENT);
//* await driver.get("http://github.com/mozilla");
// driver.setContext(Context.CHROME);
//* await utils.copyUrlBar(driver);
} catch (e) {
console.error(e); // eslint-disable-line no-console
}
})();