Replacing Test::WWW::Selenium::Catalyst with Gtk3::WebKit


I'm trying to replace Test::WWW::Selenium::Catalyst using Gtk3::Webkit and 
Test::WWW::Mechanize::Catalyst. Main goal is to avoid the lengthy Selenium 
Server and Firefox startup when running tests but it would also be nice to be 
able to run tests in parallel more easily. Even with randomized port numbers, 
the Selenium server fails to start up sometimes.

A quick hack got me pretty far but now I'm stuck trying to get AJAX requests 
to work. I'm able to satisfy all other requests by hooking into the 'resource-
request-starting' signal, getting the result with 
Test::WWW::Mechanize::Catalyst and give it back to WebKit as a data: URI. 
Unfortunately, one cannot make AJAX requests to data: URIs. Instead I tried to 
change the request to a POST to a simple HTTP Echo service, but for example I 
cannot find out how to set the content-type of the HTTP request. There does 
not seem to be a write accessor for that property.

So does anyone have ideas, advice or experience in this area? I guess as a 
last resort, I will fork out and answer requests in a separate process via a 
real HTTP request. But doing it in-process would let us get rid of quite a few 
difficulties in writing tests for asynchronous interfaces...


Attachment: signature.asc
Description: This is a digitally signed message part.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]