diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d21846a8..b8b7dea9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,7 +9,7 @@ on: - '*' env: - TESTING: 1 + HEADLESS: 1 jobs: test: diff --git a/tests/excmds.test.ts b/tests/excmds.test.ts index 86ce6a1f..be651cd5 100644 --- a/tests/excmds.test.ts +++ b/tests/excmds.test.ts @@ -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)