Nearsoft/PHP-SeleniumClient — pull request #13 by andrewmackrodt (2013-03-31 12:48:20+00:00)
Title: Find by javascript support and other improvements

Developers tend to have better familiarity with js selectors than xpath/css. I've extended the By class to include a jsSelector method which takes an optional second argument to specify how the lookup should be performed, e.g.

$driver->findElement(By:jsSelector('input[name^="en_"]')); # defaults to $
$driver->findElement(By:jsSelector('#content .red', 'document.querySelectorAll'));

It's also possible to speed up the running of unit tests by adjusting the environment variables introduced in phpunit.xml.dist (copy to phpunit.xml). The tests extend an abstract class which reset the browser state at the end of every test removing the need for the browser to be restarted between tests. Chrome's performance is several times faster than Firefox and I'm able to run the entire test suite in 45 seconds.

Changelog
--

Additions:
- findElementsBy magic methods in WebDriver
- environment variables to change the tests url and browser
- an environment variable to specify tests should be run in a single browser instance (speed improvement)
- innerHTML and outerHTML convenience methods in WebElement
- find elements By user javascript selector
- new tab hack in TargetLocator

Modifications:
- Docblock and PhpStorm code inspection fixes
- better timing precision in WebDriverWait->until
- moved phpunit.xml to phpunit.xml.dist (and generate code coverage)