我正在Grails / Angular应用程序中实现Geb / Selenium。我不熟悉Geb&硒。运行以下Geb测试时:
def "navigate to User edit page" () {
given:
login(admin, pass)
when:
waitFor { to UserListPage }
then:
at (new UserListPage())
waitFor { userList.hasUser("admin") }
userList.hasUser("marisa.adelman")
when:
userList.clickUser("marisa.adelman")
then:
waitFor(60) { at (new UserMaintenancePage()) }
}
行userList.clickUser("marisa.adelman")
在表中找到所提供用户的行,并单击它以加载维护页面。测试在Chrome和Firefox中都通过,但是当我在PhantomJS中使用WaitTimeoutException运行它时失败,如下所示:
Failure: |
navigate to User edit page(vdo.auth.AdminFunctionalSpec)
|
geb.waiting.WaitTimeoutException: condition did not pass in 60.0 seconds. Failed with exception:
geb.waiting.WaitTimeoutException: condition did not pass in 10.0 seconds. Failed with exception:
Assertion failed:
$("form", id: "frmUserCreateEdit")
|
[]
at geb.waiting.Wait.waitFor(Wait.groovy:138)
at geb.waiting.DefaultWaitingSupport.doWaitFor(DefaultWaitingSupport.groovy:51)
at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy:42)
at geb.Page.waitFor(Page.groovy:511)
at geb.Browser.methodMissing(Browser.groovy:207)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at vdo.auth.AdminFunctionalSpec.navigate to User edit page(AdminFunctionalSpec.groovy:123)
Caused by: geb.waiting.WaitTimeoutException: condition did not pass in 10.0 seconds. Failed with exception:
Assertion failed:
$("form", id: "frmUserCreateEdit")
|
[]
at geb.waiting.Wait.waitFor(Wait.groovy:138)
at geb.Page.verifyThisPageAtOnly(Page.groovy:226)
at geb.Page.verifyAt(Page.groovy:182)
at geb.Browser.doAt(Browser.groovy:455)
at geb.Browser.at(Browser.groovy:354)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at vdo.auth.AdminFunctionalSpec.navigate to User edit page_closure13(AdminFunctionalSpec.groovy:123)
at geb.waiting.Wait.waitFor(Wait.groovy:127)
... 6 more
引起:断言失败:
$("form", id: "frmUserCreateEdit")
|
[]
at vdo.auth.pages.UserMaintenancePage._clinit__closure1(UserMaintenancePage.groovy:1 0)
at geb.waiting.Wait.waitFor(Wait.groovy:127)
... 13 more
我已尝试在单个waitFor上设置超时,从10到60秒; GebConfig超时10到60秒。 UserMaintenancePage等上的atCheckWaiting
设置为true。一切都没有运气。
我是否错过了PhantomJS配置设置,或者是否有某种解决方法可以实际测试到该页面的链接?任何其他指针将不胜感激