How to have geb static content recognized form test script

允我心安 提交于 2019-12-13 03:52:10

问题


The example:

Page Class

Page TestPage extends Page{
    static at = {blah blah....} 

    static content = {
        someVar {$(By.id("someId"))}
    }
}

Script:

class Test extends GebReportingSpec{

    def "some Feature Methods"(){
        when:
        def page1 = at TestPage
        page1.someVar.click() //In intellij "someVar" shows as unrecognized
    }
}

According to what I have read and researched, in the example above, someVar should autocomplete and be recognized, but it is not. the code still runs and works correctly but someVar still comes up as unrecognized by the autocompiler in Intellij.

The only way I can have the variable be recognized is by creating a getter method for someVar

When I see the answer to this question: Geb authoring support within Intellij-IDEA?

I assume that what I am attempting to do should work but it does not. is there a way to have the static content autocomplete without creating getter methods?

Edit: Also wanted to add that in my case I am getting the page objects from a jar file. Both the binaries and the sources jars are downloaded and recognized.

来源:https://stackoverflow.com/questions/50688315/how-to-have-geb-static-content-recognized-form-test-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!