According to http://www.gebish.org/manual/current/modules.html#modules Modules should be defined like this:
class ExamplePage extends Page {
static content = {
theModule { module ExampleModule }
}
}
From Geb's Documentation:
16.2.2 Strong typing
In order to gain improved authoring support, you must include types in your tests and page objects. Additionally, you must explicitly access the browser and page objects instead of relying on dynamic dispatch.
So:
HomePage homePage = browser.to HomePage
homePage.loginButton.click()
It's works fine for Pages, but can i find the way to have it with Modules aswell? to have autocompletion here:
HomePage homePage = browser.to HomePage
homePage.loginFormModule. *autosuggestion here*
(where "loginFormModule" - is module of HomePage)
Stronger typing for module definitions has been recently added to master but hasn't been released yet. Basically the location of module()
method has changed so that now IntelliJ understands the return type of it. If you wish to give it a try then you can use 0.10.1-SNAPSHOT
from Geb's snapshot repo. The way you pass a base navigator and parameters to a module has changed, see the latest chapter on modules for info. It would be awesome if you could give it a try and tell me if by simply changing the version you get autocompletion.