angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Expected Conditions no longer working with Angular 2.0+ #4214

Open kalaiA opened 7 years ago

kalaiA commented 7 years ago

Prior to Angular 2.0+, we were using Expected Conditions to wait for modal transitions. Without Expected Conditions, modal transitions would through off the timing of the tests. After migrating the project to Angular 2.0+, these Expected Conditions no longer work.

modalOkButtonElement.click(); // closes the modal (fades the modal away using css transitions, then routes to a different component, which is rendered to the user.) var EC = protractor.ExpectedConditions; browser.wait(EC.presence(componentTitleElement), 5000); expect(componentTitleElement.getText()).toContain("My Routed Component Page Title");

The test runs and stops at the Expected Condition. After waiting some time at the Expected Condition, it times out and outputs that the element is not found. Is this a known problem?

Please advise.

Bug report

heathkit commented 7 years ago

Could you post an example repro? ExpectedConditions are working fine for me with Angular 4. Do you have waitForAngular enabled?