authelia/test/helpers/assertions/VerifyNotificationDisplayed.ts

10 lines
487 B
TypeScript
Raw Normal View History

2019-02-14 05:04:57 +07:00
import SeleniumWebdriver, { WebDriver } from "selenium-webdriver";
import Assert = require("assert");
export default async function(driver: WebDriver, message: string, timeout: number = 5000) {
await driver.wait(SeleniumWebdriver.until.elementLocated(
SeleniumWebdriver.By.className("notification")), timeout)
2019-02-14 05:04:57 +07:00
const notificationEl = driver.findElement(SeleniumWebdriver.By.className("notification"));
const txt = await notificationEl.getText();
Assert.equal(message, txt);
}