This is the second time I've written this and the first time was years ago, so I don't recall what I was doing. I am writing our Web tests so we can pass a --noserver switch and run the code directly. That means overriding WWW::Mechanize::_make_request and pretending to be a Web server, knowing how to call your code, setting up the proper %ENV variables, following redirects, etc. So far I have this debugging information along with the tests:
> > > GETing login.pl > > > POSTing login.pl < < < Redirect requested to /login.pl?login=2 > > > GETing /login.pl?login=2 < < < Redirect requested to / > > > GETing /
That tells me I've successfully logged in, handling cookie information and all that. Then the code blows up, but it's getting closer! When it's done, we'll be able to debug our Web tests much more easily.
Re:Test::WWW::Mechanize::Catalyst
Ovid on 2007-01-16T19:08:15
Ah, looks vaguely similar to what I've written. It would be nice if a generic solution could be provided for this. Since I'm writing this for work, I can't release the code.
Re:Test::WWW::Mechanize::Object
Ovid on 2007-01-17T07:13:14
Argh! I checked on the CPAN and glanced that that module, but I didn't really look at it as closely as I should have. I was thinking "run mech without a Web server" and that code is "run mech with requests on an object". D'oh! Ah well
:)