mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
13 lines
484 B
TypeScript
13 lines
484 B
TypeScript
import SeleniumWebDriver, { WebDriver } from "selenium-webdriver";
|
|
import Util from "util";
|
|
|
|
export default async function(driver: WebDriver, header: string, timeout: number = 5000) {
|
|
const el = await driver.wait(SeleniumWebDriver.until.elementLocated(
|
|
SeleniumWebDriver.By.tagName("body")), timeout);
|
|
const text = await el.getText();
|
|
|
|
const expectedLine = Util.format("\"%s\": ", header);
|
|
if (text.indexOf(expectedLine) >= 0) {
|
|
throw new Error("Header found.");
|
|
}
|
|
} |