2012-04-12 2 views
1

Ниже приведена моя страница Geb, спецификация и ошибка. Я не уверен, где и в чем проблема. Когда я удаляю ниже из 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")} 
    } 
} 

Spec

класс SearchSpec расширяет BaseUiSpec { настройки четкости() { логин ("менеджер") }

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 

ответ

0

Проблема заключалась в том, что я wan't передавая индекс для йза. Скорректированный вариант ниже

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

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

Смежные вопросы