So I spent a little time yesterday after writing this mail looking into a few different browser automation and emulation tools - many of them don't even have API methods for setting the value of file fields in forms, and of those that do it usually doesn't work except in some specific, tricky setup (firefox with a custom plugin and security policies disabled etc.) PhantomJS lists file uploads as something to support in a future release[1] so we won't be able to use it for this now.
So I think we should just bypass web browsers and use something like Mechanize[2] or Twill[3] for the tests specifically relating to file upload, and at such time as we want to start testing the custom application (which doesn't seem to be a priority this week) we can start on a PhantomJS-based suite as it seems like one of the more robust headless browser options out there. Today, though, I'll be driving GeoNetwork with OWSLib and httplib2 to simulate our usage of it in GeoNode - hopefully I can sort out the issues there. [1] http://code.google.com/p/phantomjs/wiki/Roadmap [2] http://twill.idyll.org/ [3] http://wwwsearch.sourceforge.net/mechanize/ -- David Winslow OpenGeo - http://opengeo.org/ On Tue, Apr 12, 2011 at 3:25 AM, Andreas Hocevar <[email protected]>wrote: > Thanks for setting this up! See some comments inline. > > On Apr 12, 2011, at 00:01 , David Winslow wrote: > > > geonode-client runs the minification script (we don't have any unit tests > in this project IIRC so they aren't run.) > > Right. But we have increasing test coverage in gxp, and a decreasing amount > of custom code in geonode-client, so we're improving here continuously. > > > One issue I ran into was that the geonode-client project has some > submodules that point at authenticated github URLs. I think we could create > a github user account or a deploy key[2] for the deploy server to make it > able to access these - but it would probably be nicer to others trying to do > automated builds of GeoNode if we instead change them out for the anonymous > ones. Developers who need the push access could easily modify the > .git/config for individual repositories so it wouldn't be a big burden for > them. I went ahead and pushed a new branch to my fork showing what this > would look like: > > https://github.com/dwins/geonode-client/compare/master...testing-master > > Thanks David, I've cherry-picked this changeset into master and synth. In > fact, using the authenticated URLs was unintentional. > > > So on that topic, does anyone have a favorite scriptable browser > emulator? I've recently been pointed toward http://www.phantomjs.org/which > has the advantage of being based on the real engine behind one of the > current big three browsers, but I know there are others out there (perhaps > more mature, I think phantom is fairly new.) > > I would like to give phantomjs a try at least, unless others come up with a > pointer to the perfect headless js testsuite. > > Andreas. > > -- > Andreas Hocevar > OpenGeo - http://opengeo.org/ > Expert service straight from the developers. > >
