Edster Edster - 1 month ago 30
AngularJS Question

Testing Angular ng-click link with Geb

I am trying to test if an Angular ng-click link is being clicked with Geb. Link does not really navigate anywhere, so test should stay on the same page. But seems that test can't find my link definition on my Geb UI page.

Angular:

<a ng-click="menuAction('open')">...</a>


Geb UI Page "MainPage":

openLink { $("a", "ng-click":"menuAction('open')") }


Test:
given:
to MainPage

when:
openLink.click()

then:
at MainPage


Getting the following error:

org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (898, 147). Other element would receive the click: <div ng-show="processing" class="my-new-container ng-scope">...</div>


Found similar problem here.
Testing Angular dynamic page content (ng-if) with Geb
But unfortunately it did not help me to resolve my problem.

Appreciate any help!

Answer

This was solution to my problem.

openLink(to: OtherPage) { $("a", "ng-click": "menuAction('open')") }