authelia/test/helpers/scenarii/TwoFactorAuthentication.ts
Clement Michaud b9fea361c9 Create suite for testing the docker image.
Running this suite is the first advice given by the
bootstrap script to help the user move forward.

This commit also updates the documentation to reflect
changes introduced by the Go rewrite.
2019-11-03 16:53:47 +01:00

31 lines
988 B
TypeScript

import { StartDriver, StopDriver } from "../context/WithDriver";
import RegisterAndLoginTwoFactor from "../behaviors/RegisterAndLoginTwoFactor";
import VerifyUrlIs from "../assertions/VerifyUrlIs";
import Logout from "../Logout";
export default function (timeout: number = 5000) {
return function() {
describe('The user is redirected to target url upon successful authentication', function() {
before(async function() {
this.driver = await StartDriver();
await RegisterAndLoginTwoFactor(
this.driver,
'john', "password", true,
'https://admin.example.com:8080/secret.html',
timeout);
});
after(async function() {
await Logout(this.driver);
await StopDriver(this.driver);
});
it('should redirect the user', async function() {
await VerifyUrlIs(
this.driver,
'https://admin.example.com:8080/secret.html',
timeout);
});
});
}
}