Fix tests

This commit is contained in:
Denis Revunov 2022-11-10 00:44:34 +03:00
parent 80aad263df
commit 0b29a79131
2 changed files with 4 additions and 7 deletions

View file

@ -8,7 +8,7 @@ import * as path from "path"
import * as webdriver from "selenium-webdriver"
import * as Until from "selenium-webdriver/lib/until"
const {By} = webdriver
import {Options} from "selenium-webdriver/firefox"
import {Options, Driver} from "selenium-webdriver/firefox"
import { getNewestFileIn, sendKeys } from "./utils";
@ -32,14 +32,11 @@ describe("webdriver", () => {
const options = (new Options())
.setPreference("xpinstall.signatures.required", false)
.addExtensions(extensionPath)
if (env["HEADLESS"]) {
options.headless();
}
const driver = new webdriver.Builder()
.forBrowser("firefox")
.setFirefoxOptions(options)
.build()
const driver = Driver.createSession(options)
await driver.installAddon(extensionPath, /*temporary*/true)
// Wait until addon is loaded and :tutor is displayed
await iframeLoaded(driver)
// And wait a bit more otherwise Tridactyl won't be happy

View file

@ -80,7 +80,7 @@ export function sendKeys (driver, keys) {
})
.then(() => driver.sleep(delay))
}
keys = keys.replace(":", "<S-;>")
let result = Promise.resolve()
const regexp = /<[^>-]+-?[^>]*>/g
const specialKeys = keys.match(regexp)