2019-03-24 21:19:43 +00:00
|
|
|
import SeleniumWebDriver, { WebDriver } from "selenium-webdriver";
|
|
|
|
import VerifyElementDoesNotExist from "./VerifyElementDoesNotExist";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Verify that an element does not exist.
|
|
|
|
*
|
|
|
|
* @param driver The selenium driver
|
|
|
|
* @param content The content of the button to select.
|
|
|
|
*/
|
|
|
|
export default async function(driver: WebDriver, content: string) {
|
2019-03-24 22:29:46 +00:00
|
|
|
try {
|
|
|
|
await VerifyElementDoesNotExist(driver, SeleniumWebDriver.By.xpath("//button[text()='" + content + "']"));
|
|
|
|
} catch (err) {
|
|
|
|
throw new Error(`Button with content "${content}" should not exist.`);
|
|
|
|
}
|
2019-03-24 21:19:43 +00:00
|
|
|
}
|