Недопустимое определение шаблона компонента страницы «$» для «ApplicationSummaryPage», параметры должны быть либо замыканием, либо картой и замыканием.

Ниже моя страница Geb, Spec и Error. Я не уверен, где и в чем проблема. Когда я удаляю нижеприведенное из ApplicationSummaryPage, я не получаю эту ошибку.

ds(wait: true)
{ module DatasourceInformationRow, $("table.ic-table-creditReportProduct table tr", it) }
class ApplicationSummaryPage extends Page
{
    static url = "application-summary/application-summary.jsf"

    static at =
    { assert title == "Application Summary" }

    static content =
    {
        menu
        { module MenuModule }

        userPanel
        {module UserPanelModule }

        ds(wait: true)
        { module DatasourceInformationRow, $("table.ic-table-creditReportProduct table tr", it) }

        applicationSummaryForm
        { $("#applicationSummary_form") }

        workItemDiv
        {$("div", id: "consumerWorkItems:workItemPanel")}

        workItemsSection
        {workItemDiv.find (".ui-panel-title").text()}

        resubmitLink
        {$("a",id: "loginForm")}

        overrideDecisionLink
        {$("a",id: "loginForm")}

        addNoteLink
        {$("a",id: "loginForm")}
    }
}

Спецификация

класс SearchSpec расширяет BaseUiSpec { def setup () { логин («менеджер») }

def "cccc"()
{
    when: "I search"
    to SearchPage
    at SearchPage

    applicationid.value "10002000000010000"
    searchButton.click()
    at SearchPage

    waitFor
    { searchResultsData }

    println "------------"+ searchResults(0).ApplicationId.text()

    searchResults(0).ApplicationId.click(ApplicationSummaryPage)
    Thread.sleep 5000
    at ApplicationSummaryPage
    println "-----???"+ ds
}

}

Ошибка

geb.waiting.WaitTimeoutException: condition did not pass in 15.0 seconds (failed with exception)
    at geb.waiting.Wait.waitFor(Wait.groovy:126)
    at geb.content.PageContentTemplate.create(PageContentTemplate.groovy:117)
    at geb.content.PageContentTemplate.get(PageContentTemplate.groovy:98)
    at geb.content.NavigableSupport.getContent(NavigableSupport.groovy:43)
    at geb.content.NavigableSupport.propertyMissing(NavigableSupport.groovy:127)
    at geb.Browser.propertyMissing(Browser.groovy:175)
    at geb.spock.GebSpec.propertyMissing(GebSpec.groovy:55)
    at test.SearchSpec.cccc(SearchSpec.groovy:33)
Caused by: geb.error.InvalidPageContent: Definition of page component template '$' of 'ApplicationSummaryPage' is invalid, params must be either a Closure, or Map and Closure (args were: [class java.lang.String, null])
    at geb.content.PageContentTemplateBuilder.throwBadInvocationError(PageContentTemplateBuilder.groovy:69)
    at geb.content.PageContentTemplateBuilder.methodMissing(PageContentTemplateBuilder.groovy:51)
    at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
    at com.equifax.ic.testing.framework.ui.pages.applicationmanagement.ApplicationSummaryPage._clinit__closure2_closure5(ApplicationSummaryPage.groovy:24)
    at com.equifax.ic.testing.framework.ui.pages.applicationmanagement.ApplicationSummaryPage._clinit__closure2_closure5(ApplicationSummaryPage.groovy)
    at geb.content.PageContentTemplate.invokeFactory(PageContentTemplate.groovy:134)
    at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy:103)
    at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy)
    at geb.waiting.Wait.waitFor(Wait.groovy:115)
    ... 7 more

person Aravind Yarram    schedule 12.04.2012    source источник


Ответы (1)


Проблема заключалась в том, что я не хотел передавать индекс для ds. Исправленная версия ниже

println "-----???"+ ds(0)

Получил ответ в списке рассылки Geb. Размещение здесь для других.

person Aravind Yarram    schedule 13.04.2012