PHPackages                             jhoopes/laravel-selenium-driver - 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. jhoopes/laravel-selenium-driver

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

jhoopes/laravel-selenium-driver
===============================

A package wrapper that works with selenium to test laravel applications in the browser, inspired from laracasts integrated package

31.5k↓50%[1 issues](https://github.com/jhoopes/laravel-selenium-driver/issues)PHP

Since Sep 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jhoopes/laravel-selenium-driver)[ Packagist](https://packagist.org/packages/jhoopes/laravel-selenium-driver)[ RSS](/packages/jhoopes-laravel-selenium-driver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Selenium Driver for Laravel 5 and PHPUnit
=================================================

[](#laravel-selenium-driver-for-laravel-5-and-phpunit)

This package is designed around much of what the integrated package from Jeffery Way. It emulates much of the API from Laravel's existing testing packages for PHP Unit.

Set Up / Install
----------------

[](#set-up--install)

1. Download the latest version of selenium 2 from here:
2. If you are going to be using firefox as your browser, running the selenium server is all you need.
    - If you would like to use chrome, you will need to download the chrome driver and install it to your path (i.e. /usr/local/bin on a mac)
    - You can find the chrome driver here:
3. After you have downloaded those 2 things, install the package via composer

Configuration and setting up your first test
--------------------------------------------

[](#configuration-and-setting-up-your-first-test)

- This package uses a selenium .env file for certain settings. You can create this file based on the sample below

Sample .env.seleniumConfig

```

# Application environment
APP_ENV=testing

# Which browser you'd like to use
BROWSER=chrome

# The base url for the application on your local machine
BASE_URL=http://test.dev

# Whether or not you'd like to boot up a laravel application during your testing
#   this is so you can use things like "seeInDatabase"
USE_LARAVEL=true

#If you booted laravel, set this to 1 if you'd like your database connection to be auto migrated
MIGRATE=0

#If you booted laravel, set this to 1 if you'd like your database connection to be auto seeded
SEED=0

#OPTIONAL:  You can optionally set the window's witdth and height with these values.  Be sure that they are integers
WINDOW_WIDTH=1250
WINDOW_HEIGHT=900

```

- This configuration file is used in consort with the phpunit.xml file.
    - For example, to connect to the database through phpunit and working with laravel, you will need to set your database configuration information there.
    - Or make sure the database configuration setup in your normal .env file.
    - e.g. For when using homestead, this is what I would put in your phpunit.xml file

```

               ./tests/

               app/

```

- If you are using Laravel Valet, Your database should be local to your host, and so phpunit should be able to connect to it via the normal .env file
- Once you have the configuration set up, please see examples to further understand how to set up your tests.

Writing tests
-------------

[](#writing-tests)

- Additional documentation is forthcoming, but I wanted to note that it is important to remember that selenium will be running a live session inside of your browser on the application.
    - Because of this, your phpunit session (if using laravel) when running tests will be entirely different than the one running within the browser.
    - Keep this in mind when performing "session" items within your test code and not running it within the web browser

Running Tests
-------------

[](#running-tests)

- The first step before running tests is that you will need to start your selenium server
    - To do that, simply run ` java -jar /path/to/selenium-server/selenium-server.jar`
- To run your tests, you can run an entire directory or a single class with acceptance tests.
- e.g.

```
phpunit tests/acceptance
phpunit tests/acceptance/ExampleTest.php

```

- What should occur is that your web browser opens, and runs through the acceptance test

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

[](#documentation)

- Documentation is currently in the works.
- To see what is in the current API look through the traits directory for function names.

Future features
---------------

[](#future-features)

- A more fleshed out API
- Additional helpers for JS widgets like selectize, dropzone, etc.
- Tests for this package
- Better documentation

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3297518?v=4)[John Hoopes](/maintainers/jhoopes)[@jhoopes](https://github.com/jhoopes)

---

Top Contributors

[![jhoopes](https://avatars.githubusercontent.com/u/3297518?v=4)](https://github.com/jhoopes "jhoopes (16 commits)")

### Embed Badge

![Health badge](/badges/jhoopes-laravel-selenium-driver/health.svg)

```
[![Health](https://phpackages.com/badges/jhoopes-laravel-selenium-driver/health.svg)](https://phpackages.com/packages/jhoopes-laravel-selenium-driver)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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