PHPackages                             devchid/wpselenium - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. devchid/wpselenium

ActiveLibrary[Testing &amp; Quality](/categories/testing)

devchid/wpselenium
==================

WPSelenium is a library that allows you to quickly get up and running testing your site with selenium and phpunit.

v1.2.1(6y ago)457MITPHPPHP ^7.1CI failing

Since May 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/walisc/WPSelenium)[ Packagist](https://packagist.org/packages/devchid/wpselenium)[ Docs](http://wpselenium.devchid.com/)[ RSS](/packages/devchid-wpselenium/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

WPSelenium
==========

[](#wpselenium)

WPSelenium is a library that allows you to quickly get up and running testing your site with selenium and phpunit.
------------------------------------------------------------------------------------------------------------------

[](#wpselenium-is-a-library-that-allows-you-to-quickly-get-up-and-running-testing-your-site-with-selenium-and-phpunit)

WPSelenium is a library that quickly gets you up and running when you want to test your site using selenium and phpunit. It does this by installing and configuring [phpunit](https://phpunit.de/), the [selenium server](https://www.seleniumhq.org/download/), the [php client webdriver (by facebook)](https://github.com/facebook/php-webdriver) and the correct drivers for the browser you want to test on. Once installed all you have to worry about is writing your selenium php tests.

WPSelenium also includes support for testing WordPress plugins and themes. It does this by providing WordPress specific hooks and configuration end points you can use.

**Usage**

```
Operand browser is required

Usage: vendor/bin/wpselenium   [options]
Example: vendor/bin/wpselenium chrome --type wordpress

Operands:
    Brower you want to test on. Chrome and Firefox supported by default. See documenation if you want to add
             others.

Options:
  --type       The type of site you are testing. e.g --type wordpress
  --loglevel   Console loglevel - info, warn, error, debug.
  -?, --help        Show this help and quit.

```

Getting Started
---------------

[](#getting-started)

### Requirements

[](#requirements)

In order to run WPSelenium you will need to have the following installed

- [Java](https://java.com/en/download/help/download_options.xml) (and make sure its on your system path. Type java in your terminal or command line window to check)
- [Php &gt;= 7.2 ](https://www.php.net/downloads.php)
- [Composer](https://getcomposer.org/doc/00-intro.md)
- [Chrome](https://www.google.com/chrome/) or [Firefox](https://www.mozilla.org/en-US/firefox/new/) or any other browser you want to test on (given you have the drivers)

### 1. Install

[](#1-install)

To get started with WPselenium install it using composer using the following command:-

`composer require --dev devchid/wpselenium`

> **Note:-** This command assumes that the working directory you are running it from is a composer project. If not, you can easily make it one buy running `composer init` or adding a `composer.json` file.

> **Note:-** WPSelnenium curently downloads the **76.0.3809.126 chrome drivers** and the **0.24 firefox gecko drivers**. If your browser needs a newer or older vesion of a driver (you will get error suggesting this if unsure) please specify an updated download url for the driver in the wpselenium.xml config file. Please see the [documentation site](http://wpselenium.devchid.com/) for more details.

### 2. Configure

[](#2-configure)

Having installed wpselenium you need to create a wpselenium.xml config file. This file should be in the same location as you `composer.json` file. Below if a very basic sample configuration to get you going.

```

    http://localhost:3000

                  vendor/devchid/wpselenium/src/Sample/SampleTest.php

```

You will need to replace siteUrl, with you own site you are trying to test.

> Note:- The WPSelenium.xml can embed the phpunit config, using the phpunit endpoint (like above). This specified config is then loaded when testing your project with phpunit. However if you want to create your own phpunit config file (phpunit.xml) you can also do this (and not include it here). See [documentation site](https://wpselenium.centrid.tech/) for more details.

### 3. Run Tests

[](#3-run-tests)

After this previous step you are in essence done. You can run the following command from the same location as your `composer.json` file (were browser\_driver can either be chrome or firefox)

`/vendor/bin/wpselenium [brower_driver]`

If everything was configured properly you should see a browser window opened up to your site's home page (Example below). This window will close after about 10s .

[![example_login](https://camo.githubusercontent.com/b10b149636faa66ece37bebe0a4fd148c4f02b84dca84f7ebe72dff91af0ec09/68747470733a2f2f777073656c656e69756d2e63656e74726964736f6c2e746563682f696d616765732f6578616d706c652f6c6f67696e5f6368726f6d652e706e67)](https://camo.githubusercontent.com/b10b149636faa66ece37bebe0a4fd148c4f02b84dca84f7ebe72dff91af0ec09/68747470733a2f2f777073656c656e69756d2e63656e74726964736f6c2e746563682f696d616765732f6578616d706c652f6c6f67696e5f6368726f6d652e706e67)

> Note:-
>
> 1. On first run WPSelenium will download the required files and configure those appropriately. This means your first run will take a little bit long to start testing your site.
> 2. WPSelenium currently comes with only support for chrome and firefox. However if there is another browser you want to test you can specify the link to the browser drivers in you wpselenium config. From there you can rerun the above command using the specified name of your driver (I.e /vendor/bin/wpselenium opera). See Configuration section for more details.

If you managed to see the home page of your site like the above example, everything is set up correct. You can now go ahead and write your tests.

WordPress Support
-----------------

[](#wordpress-support)

WPSelenium comes with inbuilt support for WordPress sites. This is particularly useful when building custom plugins or themes that might require UI testing. Please see [documentation site](https://wpselenium.centridsol.tech/) for more details.

Documentation
-------------

[](#documentation)

The WPSelenium library is fully documented at . If you think of anything else that should be documented that's not there, please do give a shout.

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

[](#contributing)

WPSelenium is an opensource project and contributions are valued.

If you are contributing a bug fix, please create a pull request with the following details

- The problem/bug you are addressing
- The version of WPSelenium the fix is for
- How you tested the fix

If it's a new feature, please add it as a issue with the label enhancement, detailing the new feature and why you think it's needed. Will discuss it there and once it's agreed upon you can create a pull request with the details highlighted above.

Authors
-------

[](#authors)

- **Chido Warambwa** - *Initial Work* -

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~22 days

Recently: every ~27 days

Total

7

Last Release

2428d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/252bce2f4ca566ccb0a882cfa3668f15e01458bd07ee14afaf3b40c8f5d074b0?d=identicon)[devchid](/maintainers/devchid)

---

Top Contributors

[![walisc](https://avatars.githubusercontent.com/u/5619335?v=4)](https://github.com/walisc "walisc (10 commits)")

---

Tags

composerdriverfacebookphpphpunitseleniumphpcomposerphpunitfacebookseleniumwebdrivers

### Embed Badge

![Health badge](/badges/devchid-wpselenium/health.svg)

```
[![Health](https://phpackages.com/badges/devchid-wpselenium/health.svg)](https://phpackages.com/packages/devchid-wpselenium)
```

###  Alternatives

[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[lmc/steward

Steward - makes Selenium WebDriver + PHPUnit testing easy and robust

222163.1k1](/packages/lmc-steward)[juampi92/test-seo

Easy way to test your SEO

26341.0k](/packages/juampi92-test-seo)[aik099/phpunit-mink

Library for using Mink in PHPUnit tests. Supports session sharing between tests in a test case.

72136.2k1](/packages/aik099-phpunit-mink)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k34](/packages/robiningelbrecht-phpunit-coverage-tools)

PHPackages © 2026

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