Sunday, November 27, 2011

Weekly roundup: PHPUnit_Selenium

I am now the maintainer of PHPUnit_Selenium, the PHP library for writing PHPUnit test cases that make use of Selenium RC to drive a real browser (usually to perform end-to-end tests). PHPUnit will continue shipping the library, and PHPUnit_Extensions_SeleniumTestCase will continue to be compatible with the Api in the manual.
Right now, you should use PHPUnit_Selenium in tandem with Selenium 2. Selenium 2 integrates WebDriver (not supported yet from PHP code) and implements the old Selenium RC Api, so it will continue to work and be maintained. If you encounter a backward compatibility break, open an issue.
PHPUnit_Selenium was not maintained and was broken in PHPUnit 3.6; with the next release, it will resume working. I'm integrating all sort of pull requests initiated during 2011, so if you want to contribute or to merge back one of your forks, you will be welcome!

Here are my original articles published this week.
Practical PHP Refactoring: Replace Parameter with Explicit Methods explains how to break up a method into a few, finer-grained ones.
Setting up a LAMP box with Puppet is an how to on writing Puppet manifests for provisioning packages and services like Apache, PHP and MySql in a machine (instead of writing long scripts containing apt-get, yum and /etc/init.d/ calls).
Practical PHP Refactoring: Preserve Whole Object explains how to pass an entire object to a method instead of extracting its state and passing a series of variables.
PhoneGap: native applications written in HTML is a review of a mobile application frameworks which promises to wrap your Ajax-based applications into an Android or iOS one.


3 comments:

Stephane said...

I red your paper which compare different PHP selenium lib. If i well understand (quick reading of the code in few minutes) the selenium 2 driver is really light allowing us performing root command. The response calls did'nt allow us requesting for a specifique JsonWireProtocole returned value ... dod you plan to do something in the next week ? I was using selenium 1 and really want to use Selenium 2 with PHPUnit as easy as before. the other way is to add one of the lib yous study in the autoload of PHPUnit ... What is the best way in your point of view ? waiting or using another lib or something from both solution ...
think you, Stephane

Stephane said...

I have to add something : I try to use Selenium extension in Story extension test.

using directly low level class instead of selenium2_TestCase.

Stephane

Giorgio said...

The article is probably out of the date. PHPUnit_Selenium is capable of using both Selenium 1 and 2 (WebDriver) APIs now.
Don't know about Story tests, that extension is not supported anymore by PHPUnit itself, IIRC.

ShareThis