Lubomir,

Using a checking method returning a boolean in the superclass and then
calling it from the at checker of the child class would work but I would
advise you to rethink your approach to your usage of at checkers in general.

It is unfortunately not stated anywhere in the manual (hence I created
https://github.com/geb/issues/issues/512) but at checkers were devised to:
- help to fail fast if your tests end up on a completely wrong page (e.g. a
not found page, see http://gebish.org/manual/current/#unexpected-pages, or
a page that you did not expect to end up after clicking a button)
- wait for the page to fully load when dealing with single page apps
They were not designed to verify that content on a given page is rendered
as expected which is what you seem to be doing. Given that at checkers are
executed every time page verification is performed (e.g. calling to()) it's
best to keep them simple and quick (e.g. just checking the title of the
page) so that you do not slow down your tests unnecessarily by performing
the same verification over and over again. I would therefore suggest having
a separate test for each page that only once verifies that the expected
elements are displayed when you navigate to a given page instead of
performing such verification in the at checker.

I'm glad that you enjoy using Geb.

Cheers,
Marcin

On Fri, Dec 8, 2017 at 9:21 AM, Lubomír Zrnečko <[email protected]>
wrote:

> Hi, Marcin,
> well, my situation is that I have a base page that contains some common
> elements like our app toolbar and menus and a subpage that contains some
> specific content. In the base page I had 'at checker' for presence of the
> tool bar and some buttons and in the subpage I had 'at checker' for the
> page-specific content. Now I had a situation that the button in the toolbar
> is was not displayed on a subpage but the test passed, so I came to the
> conclusion that 'at' sections are not merged. I guess that I will work it
> around by defining checking method returning boolean in the base page and
> use it in subpage 'at' section. What do you think?
> Btw. many thanks for GEB, it's a great tool! And for the quick reply!
> Best regards
> Lubomir
>
> On Thursday, December 7, 2017 at 9:59:27 PM UTC+1, Marcin Erdmann wrote:
>>
>> No, unfortunately for you, they are not automagically merged in any way.
>> There are ways around it so if you tell me a bit more about your usecase I
>> might be able to give you some pointers.
>>
>> As a side note, can you please explain how you’d expect the at checkers
>> to behave if they were merged? Maybe we can create an issue for it and
>> improve on the current situation.
>>
>> On Thu, Dec 7, 2017 at 1:52 PM, Lubomír Zrnečko <[email protected]>
>> wrote:
>>
>>> Hi,
>>> how does 'at' verification work for subclasses? Is it similar with
>>> 'content' so all 'at' statements in page class hierarchy are merged to one
>>> and then evaluated?
>>> I would expect to be so but I don't see this behavior in my setup.
>>> Thanks for your help
>>> Best regards
>>> Lubomir
>>>
>>> --
>>> 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/ms
>>> gid/geb-user/7e17dbda-c53e-4533-a3e0-d5b8aba335bb%40googlegroups.com
>>> <https://groups.google.com/d/msgid/geb-user/7e17dbda-c53e-4533-a3e0-d5b8aba335bb%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/fb73cc30-df11-4723-8e89-380bb8454bc5%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/fb73cc30-df11-4723-8e89-380bb8454bc5%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%2B52dQQywKbvpnP%2BNQN-i9FaLoVP%2BwQjHVTWsAWM-vendT-toA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to