2019-01-31 04:44:03 +07:00
|
|
|
import LoginAndRegisterTotp from "../../../helpers/LoginAndRegisterTotp";
|
|
|
|
import FullLogin from "../../../helpers/FullLogin";
|
|
|
|
import child_process from 'child_process';
|
2019-02-10 05:20:37 +07:00
|
|
|
import WithDriver from "../../../helpers/context/WithDriver";
|
|
|
|
import Logout from "../../../helpers/Logout";
|
2019-01-31 04:44:03 +07:00
|
|
|
|
|
|
|
export default function() {
|
2019-02-10 05:20:37 +07:00
|
|
|
after(async function() {
|
|
|
|
await Logout(this.driver);
|
|
|
|
})
|
|
|
|
|
|
|
|
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-01-31 04:44:03 +07:00
|
|
|
child_process.execSync("./scripts/dc-dev.sh restart mongo");
|
2019-02-13 05:23:43 +07:00
|
|
|
await FullLogin(this.driver, "john", secret, "https://admin.example.com:8080/secret.html");
|
2019-01-31 04:44:03 +07:00
|
|
|
});
|
|
|
|
}
|