e2e tests: decapitate firefox

This commit is contained in:
glacambre 2020-05-27 18:26:43 +02:00
parent 42f3d287ea
commit 53b2746108
2 changed files with 10 additions and 4 deletions

View file

@ -9,7 +9,7 @@ on:
- '*'
env:
TESTING: 1
HEADLESS: 1
jobs:
test:

View file

@ -1,5 +1,7 @@
import "geckodriver"
import * as process from "process"
const env = process.env
import * as fs from "fs"
import * as os from "os"
import * as path from "path"
@ -99,11 +101,15 @@ describe("webdriver", () => {
const dir = "web-ext-artifacts"
const extensionName = "tridactyl.xpi"
const extensionPath = dir + "/" + extensionName
const options = (new Options())
.setPreference("xpinstall.signatures.required", false)
.addExtensions(extensionPath)
if (env["HEADLESS"]) {
options.headless();
}
const driver = new webdriver.Builder()
.forBrowser("firefox")
.setFirefoxOptions((new Options())
.setPreference("xpinstall.signatures.required", false)
.addExtensions(extensionPath))
.setFirefoxOptions(options)
.build()
// Wait until addon is loaded and :tutor is displayed
await iframeLoaded(driver)