1
0
mirror of https://github.com/0rangebananaspy/authelia.git synced 2024-09-14 22:47:21 +07:00
authelia/test/helpers/behaviors/RegisterAndLoginTwoFactor.ts
2019-03-03 11:39:40 +01:00

17 lines
573 B
TypeScript

import { WebDriver } from "selenium-webdriver";
import LoginAndRegisterTotp from "../LoginAndRegisterTotp";
import FullLogin from "../FullLogin";
import VerifyUrlIs from "../assertions/VerifyUrlIs";
export default async function(
driver: WebDriver,
username: string,
password: string,
email: boolean = false,
targetUrl: string = "https://login.example.com:8080/") {
const secret = await LoginAndRegisterTotp(driver, username, password, email);
await FullLogin(driver, username, secret, targetUrl);
await VerifyUrlIs(driver, targetUrl);
return secret;
};