Ouch! It's exactly what my first point was trying to achieve. Thanx a lot! Now, I'll have to adapt it to Selenium. I'll try & post it on your blog, Daan.
Who said "TDD"?. I know that not so much is tested in this way be it's so exhaustive (regarding the total number of Pages / Components to check) plus it provide so fast feedback that I find it mandatory for whom wishes to do TDD in Wicket. Regards, Pierre On Wed, Nov 25, 2009 at 10:06 AM, Martijn Dashorst < [email protected]> wrote: > Spring has a classpath scanner which you can copy and adapt to scan > for pages and then try to instantiate them. The problem is often that > pages don't have a default constructor, which is a problem if you want > to instantiate them automagically. > > Martijn > > On Wed, Nov 25, 2009 at 12:57 AM, Pierre Goupil <[email protected]> > wrote: > > Guys, > > > > One thing that I like regarding Wicket tester is that it easily allows > one > > to check a Page under design for any exception that it could throw at > > creation-time. Actually, doing such a basic test is for me essential, so > as > > it takes only two lines of code, I systematically check all my pages this > > way. > > > > You know, the: > > > > // start and render the test page > > this.tester.startPage(HomePage.class); > > > > // assert rendered page class > > this.tester.assertRenderedPage(HomePage.class); > > > > thing. > > > > What I like so much with it is that any error which would occur when you > > load the page in FF / IE... occurs without leaving Eclipse and > immediately. > > When the workflow to find the page in the browser is long and repetitive, > > it's a relief! > > > > BUT, when the number of pages grow, two related problems emerge: > > > > -you have to duplicate these two lines of code everytime, which is a > (small) > > pain in itself > > -and you have no guarantee that you didn't forget any page, which is > worst. > > > > So I'm looking for a way to list all Page instances in a Wicket app, > which > > could then allow me to be sure that they are all covered by a test. And > when > > it's done maybe I could use the same system in order to ensure that > Selenium > > (the automated functional testing tool) has covered all my pages as well > > (more deeply). > > > > I could use a test coverage tool, but 1) it wouldn't work with Selenium > 2) I > > don't want to generate a report, I want the test suit to fail if a Page > is > > not covered by my test class. > > > > Could anyone suggest where to start, please? > > > > Regards, > > > > Pierre > > > > > > -- > > Rien de grand ne s'est accompli dans le monde sans passion. > > > > (G.W.F. Hegel, philosophe allemand) > > > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.4 increases type safety for web applications > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Rien de grand ne s'est accompli dans le monde sans passion. (G.W.F. Hegel, philosophe allemand)
