Hi, On Thu, Mar 17, 2016 at 10:47 PM, Boris Goldowsky <[email protected]> wrote:
> I¹m thinking it would be handy to automate testing of the simplest of > validity & accessibility requirements eg, checking that every <img> > element has an alt attribute, and every form input has a label. > Eventually maybe taking this up a notch and connecting with existing HTML > validation and a11y-checking engines. As things stand, I have to do any > such testing manually with browser-based tools. > > Is this something that already exists, or that others would be interested > in collaborating on? > > I can think of a couple of possible methods that would be pretty general > not sure which is best. > > A) extend WicketTester, adding some assertion methods; then one could > write a Junit test for each page asserting that it passes certain criteria. > > B) create a runtime checker, something like StatelessChecker, that when > enabled would check every page as it is rendered. You could turn this on > during development to have checking of the actual rendered HTML. > > I¹d be grateful for any thoughts or suggestions. > I think approach A) is better. No need to extend WicketTester though. You can just introduce a helper class that uses tester.getLastResponseAsString() and do the checks. If you go with Approach B) then better use IResponseFilter. See org.apache.wicket.response.filter.EmptySrcAttributeCheckFilter for inspiration. > > Boris > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
