Methods 对于具有多个重定向的表单,如何在Geb中使用via方法?

Methods 对于具有多个重定向的表单,如何在Geb中使用via方法?,methods,geb,Methods,Geb,试图断言在用户身份验证后显示了正确的登录页 注意到在身份验证之后,应用程序重定向到我能够为其创建页面方法的几个页面 given to LegacyLoginPage when: someoneLogsIn(testUsername, testPassword) then: via AuthenticationTargetPage and: via LoginRedirectPage //Thread.sleep(5000) then: at ReferenceLibraryPage 当使

试图断言在用户身份验证后显示了正确的登录页

注意到在身份验证之后,应用程序重定向到我能够为其创建页面方法的几个页面

given  
to LegacyLoginPage
when: someoneLogsIn(testUsername, testPassword)
then:
via AuthenticationTargetPage
and:
via LoginRedirectPage
//Thread.sleep(5000)
then: at ReferenceLibraryPage 

当使用
via
方法运行spec时,测试将失败assert步骤

当服务器启动重定向时,不应使用
via()
via()
更改浏览器指向的url,在本例中,该url不是您想要的。您最可能的目标是:

when: 
someoneLogsIn(testUsername, testPassword)

then: 
waitFor { at ReferenceLibraryPage }