2

If my page is rendered using AJAX request should I execute something like

waitForElementToBeVisible('.todoListItem');
//that is my custom function that waits 
//till element will be rendered

before making call:

element(by.model('todoList.todoText')).sendKeys('write first protractor test');

which sendKeys to element with CSS class .todoListItem?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
Artem Vorobyev
  • 185
  • 1
  • 9

1 Answers1

3

If this is an AngularJS application under test, things should be handled naturally by protractor - it always works in sync with Angular. This is, though, theory.

In practice, this is not always the case - for instance, our test codebase has the browser.wait() calls here and there to make the tests flow the way we want them to work.

Note that disabling Angular animations and increasing the implicit wait timeout sometimes help too.

See also:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195