I have a login screen and when I press the Login button goes to the dashboard page. However, I often miss my timeout. Is there any possibility that when the button is pressed wait for the page to load?
my method in app.po.ts
login() {
element(by.name('username')).sendKeys(browser.params[0].UserName);
element(by.name('password')).sendKeys(browser.params[0].Password);
element(by.partialButtonText('SignIn')).click();
browser.sleep(5000);
}
Test is done here app.e2e-spec.ts
it('should be able to login', () => {
page.navigateToHome();
page.login();
page.browserSleep();
});