alexandresalome/php-webdriver

This package is abandoned and no longer maintained. The author suggests using the facebook/webdriver package instead.

PHP-WebDriver is a client for WebDriver and a Behat extension

v0.9.0 2014-05-07 08:56 UTC

README

DEPRECATED

This library is deprecated, because another implementation exists and is more reliable: the Facebook PHP-WebDriver implementation https://github.com/facebook/php-webdriver

This library won't be maintained anymore.

Description

PHP client and Behat extension

Build status Latest stable version Total Downloads

This library provides 2 things:

  • A library with a proper API to manipulate a WebDriver instance
  • A Behat extension to ease testing through a browser

WebDriver was initiated by Selenium-group and consists of a Restful API to manipulate a browser remotely (cookies, forms, DOM inspection, screenshots...).

This library provides a PHP interface for WebDriver server manipulation:

$client  = new WebDriver\Client('http://localhost:4444');
$browser = $client->createBrowser('firefox');

$browser->open('http://google.fr');
$browser->element(By::name('q'))->type('Hello');
$browser->element(By::css('input[type=submit]'))->click();

Documentation

Installation

Add the library to your composer.json:

{
    "require": {
        "alexandresalome/php-webdriver": "~0.7"
    }
}

Changelog

v0.9

  • Alert messages

v0.8

  • Behat new steps for form assertions
  • Maximize window for testing

v0.7

  • Manipulate windows size and position
  • Execute code asynchronously: $browser->executeAsync('...')
  • Test if 2 elements are equals: $element->equals($otherElement)
  • Behat new steps: I move forward, I move back

v0.6

  • Cleanup Behat sentences
  • Repeat up to 5 time a test before failing
  • Tests and integration trough travis-ci.org
  • BC break: I should see 3 xpath elements "//a" has been removed in favor of I should see 3 "xpath=//a"
  • BC break: I click on xpath "//a" has been removed in favor of I click on "xpath=//a"

v0.5

  • New methods to move mouse: $browser->moveTo() and $element->moveTo(): moves mouse to absolute or relative position
  • $browser->getText(): returns text of the browser
  • Behat
    • New step: I move mouse to "css=h1"

v0.4

  • timeout is now configurable in Behat extension

v0.3

  • New method to test if an element is displayed ($element->isDisplayed())
  • Behat
    • Add a timeout spin on step I should not see "some text"

v0.2

  • new element method on element $element->getElement($by)
  • Behat
    • Provide a context for Behat testing

v0.1

  • Cookie management
  • Element crawling
  • Javascript methods
  • Client & Browser management

References