I have a mocha test that I am trying to run but it keeps on giving me the following error
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called
it('should login into account', (done) => {
let user_login = require("../../data/login.json");
mongoManager.insertDocuments("user", user_login.content, () => {
loginPage.setUserName('demodgsdg');
loginPage.setPassword('123');
loginPage.submit();
browser.waitForAngularEnabled(true);
Assert.equal(element(by.id('navbar')).isDisplayed(), true, "login page is not loaded");
setTimeout(done(), 50000);
done();
});
});
Whats the best way to run an asynchronous test in mocha so that it doesnt exceed its alotted time? Or should I set the timeout on the test function