title: Functional testing for our site
body: <p>I'm working with <a href="http://mink.behat.org/" rel="nofollow">Mink</a> / <a href="http://sahi.co.in/" rel="nofollow">Sahi</a> to write a functional test suite for my site.</p>
  
  <p>I have a set of tests working through them with Firefox and Chrome, which I'm happy with. They're running nightly on our Jenkins box, and working well.</p>
  
  <p>However, because our Jenkins box is a server and Chrome/Firefox are GUI apps, I have had to make the tests run on my desktop PC. This is a pain because it means I have to leave it switched on every night, which is bad for environmental and cost reasons. Plus if it has any problems with power or network or software, then the tests fail.</p>
  
  <p>So I would like some advice on switching the tests to use a headless browser on the Jenkins box itself.</p>
  
  <p>It seems I have three options: Goutte, Zombie and Phantom (unless anyone can recommend another, of course). The following summarises my progress so far:</p>
  
  <ul>
  <li><p><em>Goutte</em>: This is PHP-driven, so would run inside of Mink, removing the need for Sahi. This sounds great, as the Jenkins box has limited resources, so the less I need to install and run on it the better. However, I need to run JS code as part of the tests, and I understand Goutte isn't capable of this. Does that rule it out?</p></li>
  <li><p><em>Zombie</em>: Runs under Node.js. Unfortunately, I haven't been able to make this work at all. I've installed Node, NPM and Zombie, but I can't get Mink to recognise it. Can anyone give me some clearer instructions than the Mink site on how to get this running?</p></li>
  <li><p><em>Phantom</em>: Unfortunately, Mink doesn't have a driver for Phantom, so I'd have to run it via Sahi. As I said, I'd prefer not to have to install Sahi on the Jenkins server, especially as it also needs to run continuously as a server. But it is the only one I've had any success with so far. Running it under Sahi, I can get my tests to run successfully (though not consistenly, which is a worry - it seems to timeout randomly, about one in three times). Can anyone suggest a way to run this without needing Sahi (or any other middle-tier server) installed? Or if I do need Sahi, can anyone tell me how to configure Jenkins to start Sahi at the begining of the test suite and stop it at the end?</p></li>
  </ul>
  
  <p>I'd really appreciate any advice on how to proceed. None of these options seem to have a clear win, for one reason or another. But functional testing is important, so this must be a solved problem. What is the best solultion for me?</p>
  
  <p>(I know there's also the option of re-writing my scripts in Javascript to talk directly to Zombie or Phantom. I'd prefer not to do that, as when they fail I will still need to see them running in Firefox to see what's going wrong, so a cross-browser interface like Mink is ideal - not to mention the fact that I've already written the all tests in PHP!)</p>
  
  <p>Thanks for any advice.  :)</p>