2019-03-03 22:51:52 +00:00
|
|
|
import { StartDriver, StopDriver } from "../context/WithDriver";
|
|
|
|
import RegisterAndLoginTwoFactor from "../behaviors/RegisterAndLoginTwoFactor";
|
|
|
|
import VerifyUrlIs from "../assertions/VerifyUrlIs";
|
2019-10-30 07:14:18 +00:00
|
|
|
import Logout from "../Logout";
|
2019-03-03 22:51:52 +00:00
|
|
|
|
|
|
|
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();
|
2019-11-03 12:07:02 +00:00
|
|
|
await RegisterAndLoginTwoFactor(
|
|
|
|
this.driver,
|
|
|
|
'john', "password", true,
|
|
|
|
'https://admin.example.com:8080/secret.html',
|
|
|
|
timeout);
|
2019-03-03 22:51:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
after(async function() {
|
2019-10-30 07:14:18 +00:00
|
|
|
await Logout(this.driver);
|
2019-03-03 22:51:52 +00:00
|
|
|
await StopDriver(this.driver);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should redirect the user', async function() {
|
2019-11-03 12:07:02 +00:00
|
|
|
await VerifyUrlIs(
|
|
|
|
this.driver,
|
|
|
|
'https://admin.example.com:8080/secret.html',
|
|
|
|
timeout);
|
2019-03-03 22:51:52 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|