This sounds like a good idea, but I'm having difficulty telling from the Selenium documentation what the output looks like or what it is able to test. It appears that one runs scripts in (or on top of) a browser interface, so I assume the output is either the resulting HTML after appropriate widgets have been clicked or an image of the resulting rendered page? And so one would then compare that content to previous versions and other browser versions of the same page to check for bugs and regressions, yes? Is that gist of how Selenium is designed to operate?
The scripts will run on a set of servers, using Selenium RC. Selenium RC will run a browser on the server, and emulate a user doing actions. It will return pass or fail on the conditions of your test.
For example, here is a php script that goes to the main page of enwiki, types test into the search box, hits enter, then verifies that the title is "Test - Wikipedia, the free encyclopedia". This test will return as a pass.
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class Example extends PHPUnit_Extensions_SeleniumTestCase { function setUp() { $this->setBrowser("*chrome"); $this->setBrowserUrl("http://en.wikipedia.org"); }
function testMyTestCase() { $this->open("/wiki/Main_Page"); $this->type("searchInput", "test"); $this->click("searchGoButton"); $this->waitForPageToLoad("30000"); $this->assertEquals("Test - Wikipedia, the free encyclopedia", $this->getTitle()); } } ?>
Respectfully,
Ryan Lane