Skip to content Skip to sidebar Skip to footer

Testing Angular Dynamic Page Content (ng-if) With Geb

I am trying to test if an Angular ng-if element is visible or not using Geb. So far I've attempted to test if the displayed property is true or false as follows. Angular:

Solution 1:

What I had missed was that the Angular code generates dynamic page content. Geb(through the underlying selenium) will just have the initial DOM before any JavaScript manipulation is performed.

I solved this using the waitFor method provided by Geb.

checkbox.value(false)
waitFor("quick") {
    assertThat(unselectedErrorText.displayed).isTrue()
}

Any further, more comprehensive explanation is very much appreciated!

Post a Comment for "Testing Angular Dynamic Page Content (ng-if) With Geb"