Hi Steve,

Can you please explain what you mean by "it will look at the hierarchy of
modules and verify the content"? I don't follow what made you believe that
if you call an at checker of a page type its content will be "verified". Is
there a section in the manual that made you believe that?

There is nothing in Geb that walks content defintions when switching pages.
You will on the other hand start getting test failures with
RequiredPageContentNotPresent exception as soon as you start accessing
content definitions returning empty navigators, which should be the case if
you use obviously wrong selectors.

Cheers,
Marcin

On Mon, Jun 26, 2017 at 5:39 PM, <[email protected]>
wrote:

> Hello.  If I have a single-page webapp and if I want to set up the content
> to be a hierarchy of Modules, how can I ensure that if I navigate to a page
> object, it will look at the hierarchy of modules and verify the content?
> For example, if I have the following page class:
> class HomePage extends Page {
>     static url = 'home'
>     static at = {
>         title == 'Home Page' && mainViewModule.displayed
>     }
>     static content = {
>         mainViewModule { module MainViewModule }
>     }
> }
>
> and then MainViewModule is defined like this:
> class MainViewModule extends Module {
>     static content = {
>         mainView { $('div', class: 'main-view') }
>         dashboardModule { module DashboardModule }
>     }
> }
>
> then DashboardModule:
> class DashboardModule extends Module {
>     static content = {
>         dashboard = { MainViewModule.find 'dashboard' }
>         subModule1 = { module SubModule1 }
>         subModule2 = { module SubModule2 }
>     }
> }
>
> where the submodules generally look like this:
> class SubModuleX extends Module {
>     static content = {
>         ...
>     }
> }
>
> If my tests (using Spock) do the following:
> class SomeSpec extends GebReportingSpec {
>     def 'navigate to the home page'() {
>         when:
>         to HomePage
>
>         then:
>         at HomePage
>     }
> }
>
> How can I ensure that it verifies the content defined in the HomePage
> class, as well as down through the hierarchy of modules?  The way that I
> have the code (as described above), I can change the selectors to incorrect
> values, but it still doesn't fail the test.
>
> Thanks,
> Steve
>
> --
> 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/88b88a53-8125-446a-a2d6-d91c695f9335%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/88b88a53-8125-446a-a2d6-d91c695f9335%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%2B52dQSpXE__C5BbW3DjbF7QN3PX%3DikbcHOgQYRqpp0f7qVQ3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to