added a comment - - edited
I'm not sure that it realy need. IMHO, unnecessary and inappropriate complexity. IMHO again, Navigator should provide simple methods that allows to do everything, and not all possible combinations of existing methods.
Why not encapsulate this logic in your page-classes? In this case, you can create a base page class with method ensureVisibleAndEnabled (throws AssertException) and other similar methods, and use them in every child class where they are needed:
page:
def submitForm
ensureVisibleAndEnabled(submitButton).click
end
test:
page.submitForm
Or you can create testHelper that will have methods like that.
Or you can create base class for all you tests. If you are using junit or testng it will even be a good idea.
Or you can use hamcrest-library and create appropriate matchers.
May be I misunderstood you. Can you give an example of a real test and page classes that it uses?
I'm not sure that it realy need. IMHO, unnecessary and inappropriate complexity. IMHO again, Navigator should provide simple methods that allows to do everything, and not all possible combinations of existing methods.
Why not encapsulate this logic in your page-classes? In this case, you can create a base page class with method ensureVisibleAndEnabled (throws AssertException) and other similar methods, and use them in every child class where they are needed:
page:
def submitForm
ensureVisibleAndEnabled(submitButton).click
end
test:
page.submitForm
Or you can create testHelper that will have methods like that.
Or you can create base class for all you tests. If you are using junit or testng it will even be a good idea.
Or you can use hamcrest-library and create appropriate matchers.
May be I misunderstood you. Can you give an example of a real test and page classes that it uses?