David, At checker closure is executed in context of a page instance even though it is declared as static so you could declare a boolean method in your base class which checks for the variable to be set, call that method from the at checker for your base class and then extend that method in your child pages, ensuring to call super. If you don't overwrite the static at checker field in your child pages then the one from superclass will be used. Be aware that you will loose implicit assertions from your at checker which might negatively affect reporting when an at checker fails.
I would advise against tinkering with verifyThisPageOnly as it is an orchestration method which does more than just holding the at checker logic. Personally I would add a method checking for that variable to my base class (e.g. pageLoaded()) and call it as the first thing in my at checkers. This way you would have your logic encapsulated should it ever change yet you would still get decent diagnostics if your at checker fails with just minor, at least in my opinion, code duplication. On Monday, 18 July 2016, David Lumpkin <[email protected]> wrote: > Hi Geb Users, > > Have you found an efficient way to inherit at checker closures? An > application I'm working with is very asynchronous but has a javascript > variable it sets when the page is ready to interact with. Currently I am > including this check in each of my at checkers, but I'd like to set it in a > superclass that gets executed for each page that extends the superclass. > Have any of you done something like this? I was thinking about extending > the verifyThisPageAtOnly method but figured I'd ask here first to see if > anyone has advice. > > Thanks, > -David > > -- > You received this message because you are subscribed to the Google Groups > "Geb User Mailing List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <javascript:_e(%7B%7D,'cvml','geb-user%[email protected]');>. > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/geb-user/3d520d74-99e3-4e39-9442-0821b473ef73%40googlegroups.com > <https://groups.google.com/d/msgid/geb-user/3d520d74-99e3-4e39-9442-0821b473ef73%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CA%2B52dQQZhrR6qboGtDnmdbrjK8KDAayQAbzf25LyrA85FyfscQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
