Currently I am having an issue on this e2e Automation tool (protractor) I tried to set a wait element option but I am still getting the following error on it.
Failed: Timed out waiting for asynchronous Angular tasks to finish after 12 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular While waiting for element with locator - Locator: By(css selector, #company-code). The following tasks were pending: - $timeout: function u(){return e.isActivatePage?void t.cancel(s):(s=t(u,o),void i.poll(r).then(function(t){d=t,e.$broadcast("noti-count-updated",d)}))}
Appreciate your comments on solving this. The codeI tried for an negative scenario as follows, Thanks
it('After invalid login it should show an error toast', function () {
browser.get('https:XXXX.com');
var EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf($('#company-code')))
.then(function () {
browser.waitForAngularEnabled(false);
browser.driver.findElement(by.id('company-code')).sendKeys('ccXXX');
browser.driver.findElement(by.id('username')).sendKeys('[email protected]');
browser.driver.findElement(by.id('password')).sendKeys('wrong password');
browser.driver.findElement(by.id('signin')).click()
.then(function () {
var EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf($('.alert-warning')))
.then(function () {
var myElement = element(by.css('.alert-warning'));
expect(myElement.isDisplayed()).toBeTruthy();
});
});
});
});
});