mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 09:01:39 -05:00
Fix tests
This commit is contained in:
parent
80aad263df
commit
0b29a79131
2 changed files with 4 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue