java - Geb to() is not working for Page List -


I am trying to implement the checker () on the page object, when click on a button made on the page If there is an error or there is no error after going to a new page

When I use a list to provide all possible page classes, only the first page () is checked And then verification fails. It does never check other pages in the list. My implementation is almost exactly like the Geb manual. {/ Title == "Welcome"} Fixed content = {loginBtn (: [account page, landing page]) $ $ ("button", id: "login")

  }}} Class account page expanded {{title == "My account"} Static content = {// page content} extends class login-geostry (GebReportingTest) {@Test Public Zero Checkspecified () {Landing Page Login } In the above example, the browser goes to the landing page and when you have If you click on the button without the field, then it should see an error and be on the landing page. But with the current implementation of the landingpage, it tries to check (on the account page) and then fails. If I change the appointment to AccountBtn (AccountPage, LandingPage), the case of negative examination will pass, but the good path will fail.  

Any thoughts?

Edit: With stack trace

  title.contains ("My Account") | | | Welcome to org.codehaus.groovy.runtime.InvokerHelper.assertFailed (welcome to at org.codehaus.groovy.runtime.ScriptbytecodeAdapter.assertFailed (InvictHelper.java398) at com.website.pages.AccountPage $ $ __clinit__closure1. doCall (AccountPage.groovy: 10) com.website.pages.AccountPage $ __Clint__ closeure1.doCall (accountPage.groovy) at sun.reflect.GeneratedMethodAccessor16.invoke (unknown source) at sun.reflect.DellegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java: 25) at org.codehaus.groovy.reflection.CachedMethod.invoke (cachedmethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke (MetaMethod.java 33rd day) org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.org org groovy.lang.metaclassImpl.invokeMethod on org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call (PogoMetaClassSite.java39) on .codehaus.groovy (ClosureMetaClass.java .7272) on invokeMethod (ClosureMetaClass.java7272) .runtime.callsite.AbstractCallSite.call (AbstractCallSite.java1212) geb.wait ing. Wait.waitFor (Wait.groovy: 117) ... 90 more    

I'm sure It is not that you can use it again within the class names (you have done this inside the landing page class). Use the following three sections and it should work, I believe!

  class landing page extended {{title == "welcome"} static content = {loginBtn (to: AccountPage) {$ ("button", id: "login")}}} class Extends the account page {{{title == "My account"} Static content = {// page content}} class logging () GebReportingTest {@ test the public Zero CheckArror Displayed () {To Login Landing Page. Click ()}}    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -