1
0
mirror of https://github.com/0rangebananaspy/authelia.git synced 2024-09-14 22:47:21 +07:00
authelia/test/helpers/fill-login-page-and-click.ts
2018-08-10 00:12:04 +02:00

17 lines
620 B
TypeScript

import SeleniumWebdriver = require("selenium-webdriver");
export default function(driver: any, username: string, password: string) {
return driver.wait(SeleniumWebdriver.until.elementLocated(SeleniumWebdriver.By.id("username")), 5000)
.then(function () {
return driver.findElement(SeleniumWebdriver.By.id("username"))
.sendKeys(username);
})
.then(function () {
return driver.findElement(SeleniumWebdriver.By.id("password"))
.sendKeys(password);
})
.then(function () {
return driver.findElement(SeleniumWebdriver.By.tagName("button"))
.click();
});
};