2019-01-31 04:44:03 +07:00
|
|
|
import LoginAndRegisterTotp from "../../../helpers/LoginAndRegisterTotp";
|
|
|
|
import FullLogin from "../../../helpers/FullLogin";
|
2019-02-10 05:20:37 +07:00
|
|
|
import WithDriver from "../../../helpers/context/WithDriver";
|
|
|
|
import Logout from "../../../helpers/Logout";
|
2019-03-02 22:19:08 +07:00
|
|
|
import { composeFiles } from '../environment';
|
|
|
|
import DockerCompose from "../../../helpers/context/DockerCompose";
|
2019-01-31 04:44:03 +07:00
|
|
|
|
|
|
|
export default function() {
|
2019-04-25 04:52:08 +07:00
|
|
|
const dockerCompose = new DockerCompose(composeFiles);
|
2019-02-10 05:20:37 +07:00
|
|
|
|
|
|
|
WithDriver();
|
|
|
|
|
2019-01-31 04:44:03 +07:00
|
|
|
it("should be able to login after mongo restarts", async function() {
|
|
|
|
this.timeout(30000);
|
2019-02-05 05:23:59 +07:00
|
|
|
|
2019-02-22 16:27:54 +07:00
|
|
|
const secret = await LoginAndRegisterTotp(this.driver, "john", "password", true);
|
2019-03-02 22:19:08 +07:00
|
|
|
await dockerCompose.restart('mongo');
|
2019-04-25 04:52:08 +07:00
|
|
|
|
|
|
|
await Logout(this.driver);
|
2019-02-13 05:23:43 +07:00
|
|
|
await FullLogin(this.driver, "john", secret, "https://admin.example.com:8080/secret.html");
|
2019-04-25 04:52:08 +07:00
|
|
|
// TODO(clems4ever): logout here but right now visiting login.example.com redirects to home.example.com
|
|
|
|
// according to the configuration so it's not possible to click on Logout link.
|
|
|
|
});
|
2019-01-31 04:44:03 +07:00
|
|
|
}
|