On Wednesday, June 13, 2012 2:59:33 AM UTC+2, Mike Dee wrote: > > > A couple of questions regarding a test I'd like to perform. Let's assume > that testing occurs with a live database (and GWT-RPC). I know that > contest of the database and what should be returned for certain queries. > I'd like to run tests that execute certain queries and make sure they > appear in the table (at certain positions). >
I'd probably rather use Selenium/WebDriver tests here. > 1) How would I test the clicking within the results. For example, each > person's name appears (per row) as a Hyperlink in the results. This is > implemented in a CellTable with Hyperlinks. Normal behavior is that when > the Hyperlink is clicked, GWT goes to the new place. There is no > notification to the activity. I suppose a ClickHandler could be added, but > it would have no usefulness other than testing. Would it be better to not > use a Hyperlink (maybe a Label with a click handler) and add a > selectPerson() method to the Presenter. Then the activity could test the > selection and handle the advancing to the new Place? > How can you possibly use a Hyperlink (widget) in a CellTable?! You might want to handle the "click" event from within your cell and call History.newItem() or PlaceController#goTo() from there (still not testable), or use a callback (similar to ButtonCell, ActionCell, or ClickableTextCell) where you put the History/PlaceController stuff, or route it through the Presenter. > 2) I've seen a technique where a Display interface is created within the > Presenter. It contains a list of HasText and HasClickHandlers that > conceptually define the View. It seems pretty fine grained. Of course, > this has the same issue related to Hyperlinks. > Don't do that, if you ever write tests with a mock view, it'll be a pain to mock. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/0F7Otmrw_FEJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
