-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an easy way to add some custom methods on Navigator #96
Comments
This issue relates to #235 |
This issue relates to #236 |
Originally posted by Alexander Zolotov. 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: test: Or you can create testHelper that will have methods like that. May be I misunderstood you. Can you give an example of a real test and page classes that it uses? |
Originally posted by Alex Anderson. We inject behaviour into our We're using Grails, so we do the injection in |
Originally posted by Marcin Erdmann. @alexander Zolotov All of your suggestions (putting the method into a base page, a test helper, base class) seem logical and probably would do. The only thing I don't like about it is that you will have to write @alex Anderson |
Originally posted by Marcin Erdmann. Copy pasted from mailing list to better keep track of the discussion: "I'm eager to take the issue on if only somebody has a hint on how to approach the problem. My only idea is to add the new method using Groovy categories which would be listed in GebConfig and then mixed in by the Geb code into all navigators - maybe in a static initializer for the Navigator class?" |
Originally posted by Luke Daley. My current thinking is that we will introduce a NavigatorFactory interface and a default impl. The factory instance will be retrieved from the config, which would allow users to inject their own factory if necessary. |
Originally posted by Luke Daley. Implemented via new NavigatorFactory mechanism, which can be injected via config. |
Resolved |
Originally created by Marcin Erdmann.
In my test I quite often do:
button.displayed & !button.disabled
It would look much better if I could add a method on all Navigator objects like:
boolean isVisibleAndEnabled() {
displayed & !disabled
}
The text was updated successfully, but these errors were encountered: