authelia/test/helpers/assertions/VerifyElementExists.ts
Clement Michaud a717b965c1 Display only available 2FA methods.
For instance Duo Push Notification method is not displayed if the API
is not configured.
2019-03-24 22:23:25 +01:00

13 lines
402 B
TypeScript

import SeleniumWebDriver, { WebDriver } from "selenium-webdriver";
/**
*
* @param driver The selenium web driver.
* @param locator The locator of the element to find in the DOM.
*/
export default async function(driver: WebDriver, locator: SeleniumWebDriver.Locator) {
const els = await driver.findElements(locator);
if (els.length == 0) {
throw new Error("Element does not exist.");
}
}