PHPackages                             athena-oss/php-fluent-webdriver-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. athena-oss/php-fluent-webdriver-client

ActiveLibrary

athena-oss/php-fluent-webdriver-client
======================================

PHP Fluent WebDriver Client

v0.7.3(9y ago)3132.3k3[2 PRs](https://github.com/athena-oss/php-fluent-webdriver-client/pulls)Apache-2.0PHP

Since Oct 11Pushed 4y ago2 watchersCompare

[ Source](https://github.com/athena-oss/php-fluent-webdriver-client)[ Packagist](https://packagist.org/packages/athena-oss/php-fluent-webdriver-client)[ RSS](/packages/athena-oss-php-fluent-webdriver-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

PHP Fluent WebDriver Client
===========================

[](#php-fluent-webdriver-client)

[![Build Status](https://camo.githubusercontent.com/4dcbb33441fb2ecef52b75b99a8a310762ab215677567a24e1d65bf534a146b0/68747470733a2f2f7472617669732d63692e6f72672f617468656e612d6f73732f7068702d666c75656e742d7765626472697665722d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/athena-oss/php-fluent-webdriver-client)[![Coverage Status](https://camo.githubusercontent.com/7f2b3123f3fcf69ba863b63f6ee3da79ce98396d021511e44097add70e39e019/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f617468656e612d6f73732f7068702d666c75656e742d7765626472697665722d636c69656e742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/athena-oss/php-fluent-webdriver-client?branch=master)

A fluent DSL for writing browser tests.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](README.md#installation)
- [External requirements](README.md#external-requirements)
- [Usage](README.md#usage)
    - [Synchronous assertions](README.md#synchronous-assertions)
    - [Asynchronous assertions](README.md#asynchronous-assertions)
- [Visual representation of the DSL](README.md#visual-representation-of-the-dsl)
- [Facebook WebDriver dependency](README.md#facebook-webdriver-dependency)
- [API docs](README.md#api-docs)
- [Contributing](README.md#contributing)
- [Versioning](README.md#versioning)
- [License](README.md#license)

Installation
------------

[](#installation)

The recommended way of installing it is by using Composer:

```
$ composer require athena-oss/php-fluent-webdriver-client:dev-master
```

External requirements
---------------------

[](#external-requirements)

The library is meant to be used alongside [Selenium](http://www.seleniumhq.org/), which is in charge of wrapping different browser vendors behind a unified [WebDriver spec](https://www.w3.org/TR/webdriver/). In order to be able to run the code samples contained in this document you'll need to download and run Selenium locally. For running the code examples you'll additionally need to install [PhantomJS](http://phantomjs.org/).

Usage
-----

[](#usage)

The library attempts to reduce the boilerplate code needed to write browser tests by providing an opinionated DSL. The DSL allows for two distinct patterns of tests:

- Synchronous assertions
- Asynchronous assertions

### Synchronous assertions

[](#synchronous-assertions)

Synchronous assertions are those expressed with the following pattern:

- Fetch URL
- Convert fetched HTML document into a Page Object
- Find an element by custom selector
- Assert that the element is enabled/selected/visible etc.
- (Optionally) Perform action on element (click, clear, submit)

Sample:

```
namespace OLX\SampleWebDriver\Tests;

use OLX\FluentWebDriverClient\Browser\Browser;
use OLX\FluentWebDriverClient\Browser\BrowserDriverBuilder;

class WikipediaBrowserTest extends \PHPUnit_Framework_TestCase
{
    public function testArticlePage_RegularArticleInEnglish_ShouldDisplayArticleTitleAsHeader()
    {
        $driver = (new BrowserDriverBuilder('http://localhost:4444/wd/hub'))
            ->withType('phantomjs')
            ->build();

        $browser = new Browser($driver);

        $browser->get('https://en.wikipedia.org/wiki/Athena')
            ->getElement()
            ->withCss('h1#firstHeading')
            ->assertThat()
            ->isHidden()
            ->thenFind()
            ->asHtmlElement();
    }
}
```

Running the above test would fail (an Exception is thrown), as an element matching the given CSS exists in the DOM and is visible.

### Asynchronous assertions

[](#asynchronous-assertions)

Synchronous assertions are those expressed with the following pattern:

- Fetch URL
- Convert fetched HTML document into a Page Object
- Find an element by custom selector
- Wait for a condition on the element (a timeout means the assertion failed)
- (Optionally) Perform action on element (click, clear, submit)

Sample:

```
namespace OLX\SampleWebDriver\Tests;

use OLX\FluentWebDriverClient\Browser\Browser;
use OLX\FluentWebDriverClient\Browser\BrowserDriverBuilder;

class WikipediaBrowserTest extends \PHPUnit_Framework_TestCase
{
    public function testArticlePage_RegularArticleInEnglish_ShouldDisplaySpecialHeaderAfter3Seconds()
    {
        $driver = (new BrowserDriverBuilder('http://localhost:4444/wd/hub'))
            ->withType('phantomjs')
            ->build();

        $browser = new Browser($driver);

        $browser->get('https://en.wikipedia.org/wiki/Athena')
            ->getElement()
            ->withCss('h1#specialHeading')
            ->wait(3)
            ->toBeVisible()
            ->thenFind()
            ->asHtmlElement();
    }
}
```

Running the above test would fail (an Exception is thrown), as an element matching the given CSS doesn't exist in the DOM 3 seconds after the DOM was ready.

Visual representation of the DSL
--------------------------------

[](#visual-representation-of-the-dsl)

The diagram bellow illustrates the methods that can be called in each state of the call chain. A few key points:

- The names inside each rectangle, when not prefixed, correspond to interfaces and classes in the library
- The FB prefix corresponds to the Facebook PHP WebDriver package

[![Visual representation of the DSL](docs/assets/dsl.png)](docs/assets/dsl.png)

Facebook WebDriver dependency
-----------------------------

[](#facebook-webdriver-dependency)

The [Facebook PHP WebDriver](https://github.com/facebook/php-webdriver) is the underlying implementation of all communication between the library and the Selenium HTTP API. At its current state, the DSL can't hide away the Facebook implementation completely. Therefore it is recommended that you read their documentation in case you're using any of the DSL methods which return a Facebook type.

Replacing the Facebook implementation by our own Selenium API abstraction is currently not among one of the project top priorities, but it's an improvement we're considering implementing (as a major, backward-incompatible version).

API docs
--------

[](#api-docs)

An [API documentation](http://athena-oss.github.io/php-fluent-webdriver-client/sami) is provided.

Contributing
------------

[](#contributing)

Checkout our guidelines on how to contribute in [CONTRIBUTING.md](CONTRIBUTING.md).

Versioning
----------

[](#versioning)

Releases are managed using github's release feature. We use [Semantic Versioning](http://semver.org) for all the releases. Every change made to the code base will be referred to in the release notes (except for cleanups and refactorings).

License
-------

[](#license)

Licensed under the [Apache License Version 2.0 (APLv2)](LICENSE).

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Total

4

Last Release

3342d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ba284afd0236bd9aad37791d4334966e98fb5331f66b3e3d3ccdfa86bac726e?d=identicon)[rafaelspinto](/maintainers/rafaelspinto)

---

Top Contributors

[![suciista09](https://avatars.githubusercontent.com/u/17154706?v=4)](https://github.com/suciista09 "suciista09 (5 commits)")[![pproenca](https://avatars.githubusercontent.com/u/8202400?v=4)](https://github.com/pproenca "pproenca (4 commits)")[![antfig-olx](https://avatars.githubusercontent.com/u/20286818?v=4)](https://github.com/antfig-olx "antfig-olx (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/athena-oss-php-fluent-webdriver-client/health.svg)

```
[![Health](https://phpackages.com/badges/athena-oss-php-fluent-webdriver-client/health.svg)](https://phpackages.com/packages/athena-oss-php-fluent-webdriver-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M340](/packages/drupal-core-recommended)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M367](/packages/laravel-zero-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
