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/msgid/geb-user/88b88a53-8125-446a-a2d6-d91c695f9335%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.