2019-01-30 15:47:03 +00:00
|
|
|
import SeleniumWebdriver, { WebDriver } from "selenium-webdriver";
|
|
|
|
|
2019-03-03 22:51:52 +00:00
|
|
|
export default async function(driver: WebDriver, linkText: string, timeout: number = 5000) {
|
2019-01-30 15:47:03 +00:00
|
|
|
const element = await driver.wait(
|
|
|
|
SeleniumWebdriver.until.elementLocated(
|
2019-04-24 21:52:08 +00:00
|
|
|
SeleniumWebdriver.By.linkText(linkText)), timeout);
|
2019-01-30 15:47:03 +00:00
|
|
|
await element.click();
|
|
|
|
};
|