2018-08-19 21:51:36 +07:00
|
|
|
import WithDriver from '../helpers/with-driver';
|
2018-10-27 23:18:25 +07:00
|
|
|
import fullLogin from '../helpers/full-login';
|
|
|
|
import loginAndRegisterTotp from '../helpers/login-and-register-totp';
|
2018-08-19 21:51:36 +07:00
|
|
|
|
2018-10-27 23:18:25 +07:00
|
|
|
describe("Connection retry when mongo fails or restarts", function() {
|
|
|
|
this.timeout(30000);
|
2018-08-19 21:51:36 +07:00
|
|
|
WithDriver();
|
|
|
|
|
2018-10-27 23:18:25 +07:00
|
|
|
it("should be able to login after mongo restarts", function() {
|
2018-08-19 21:51:36 +07:00
|
|
|
const that = this;
|
2018-10-27 23:18:25 +07:00
|
|
|
let secret;
|
|
|
|
return loginAndRegisterTotp(that.driver, "john", true)
|
|
|
|
.then(_secret => secret = _secret)
|
|
|
|
.then(() => that.environment.restart_service("mongo", 1000))
|
|
|
|
.then(() => fullLogin(that.driver, "https://admin.example.com:8080/secret.html", "john", secret));
|
2018-08-19 21:51:36 +07:00
|
|
|
})
|
|
|
|
});
|