PHPackages                             josrom/laravel-dusk-5.1 - 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. josrom/laravel-dusk-5.1

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

josrom/laravel-dusk-5.1
=======================

Laravel Dusk provides simple end-to-end testing and browser automation.

0.1.16(7y ago)11.7k2MITPHPPHP &gt;=5.6.4

Since Jun 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/JoseVte/laravel-dusk-5.1)[ Packagist](https://packagist.org/packages/josrom/laravel-dusk-5.1)[ RSS](/packages/josrom-laravel-dusk-51/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (18)Used By (0)

[![](https://camo.githubusercontent.com/2412744304860c125827160c9e585c7f7ac8f07496671794f829c68761b900de/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6475736b2e737667)](https://camo.githubusercontent.com/2412744304860c125827160c9e585c7f7ac8f07496671794f829c68761b900de/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6475736b2e737667)

[![Build Status](https://camo.githubusercontent.com/2bd33f20d13c62b3cdbdaa1fb3c92e99fe46ca9dc4abe41f5d331bd189816c5a/68747470733a2f2f7472617669732d63692e6f72672f6c61726176656c2f6475736b2e737667)](https://travis-ci.org/laravel/dusk)[![Total Downloads](https://camo.githubusercontent.com/f67ad10429c003381fa4b4e145db2d507a9dca8ab5723c1e8ec12cc3cb404224/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2f6475736b2f642f746f74616c2e737667)](https://packagist.org/packages/laravel/dusk)[![Latest Stable Version](https://camo.githubusercontent.com/147613d5535c9a83be417db11b77c862821b418f6b0351b2487391dbbab41415/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2f6475736b2f762f737461626c652e737667)](https://packagist.org/packages/laravel/dusk)[![License](https://camo.githubusercontent.com/6537948ec6d06d26852e69f42e601197772763cb7da5fe7de77fe5ea4d0023b8/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2f6475736b2f6c6963656e73652e737667)](https://packagist.org/packages/laravel/dusk)

Laravel 5.1
-----------

[](#laravel-51)

[![Build Status](https://camo.githubusercontent.com/fab77101ea6bb0851c5c8765b63cb99aad99343ab8030453f02e7ab8591a84d4/68747470733a2f2f7472617669732d63692e6f72672f4a6f73655674652f6c61726176656c2d6475736b2d352e312e737667)](https://travis-ci.org/JoseVte/laravel-dusk-5.1)[![Total Downloads](https://camo.githubusercontent.com/48b5f4fe334081252c94b163a50fead10988f0c3bf51fefbf6704e9214160417/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73726f6d2f6c61726176656c2d6475736b2d352e312f642f746f74616c2e737667)](https://packagist.org/packages/josrom/laravel-dusk-5.1)[![Latest Stable Version](https://camo.githubusercontent.com/d14495a287aeff8891bcf711063ed2c1716b913b84f5a865f592a0d3b8e6b995/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73726f6d2f6c61726176656c2d6475736b2d352e312f762f737461626c652e737667)](https://packagist.org/packages/josrom/laravel-dusk-5.1)[![License](https://camo.githubusercontent.com/f0d8801a42b598205f6cc4f2ec18b0b6b898bcd1714475838899df61d9df2d24/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73726f6d2f6c61726176656c2d6475736b2d352e312f6c6963656e73652e737667)](https://packagist.org/packages/josrom/laravel-dusk-5.1)

Introduction
------------

[](#introduction)

Laravel Dusk provides an expressive, easy-to-use browser automation and testing API. By default, Dusk does not require you to install JDK or Selenium on your machine. Instead, Dusk uses a standalone Chromedriver. However, you are free to utilize any other Selenium driver you wish.

Official Documentation
----------------------

[](#official-documentation)

Documentation for Dusk can be found on the [Laravel website](https://github.com/laravel/dusk/tree/1.0).

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

[](#installation)

To get the last version of Laravel Dusk for 5.1, simply require the project using [Composer](https://getcomposer.org/):

```
composer require --dev josrom/laravel-dusk-5.1
```

Instead, you may of course manually update your require block and run composer update if you so choose:

```
{
    "require-dev": {
        "josrom/laravel-dusk-5.1": "0.1.*"
    }
}
```

Add the service provider `app/Providers/AppServiceProvider.php` file:

```
if ($this->app->environment('local')) {
    $this->app->register(\Laravel\Dusk\DuskServiceProvider::class);
}
```

After installing the Dusk package, run the `dusk:install` Artisan command:

```
php artisan dusk:install
```

A `Browser` directory will be created within your `tests` directory and will contain an example test. Next, set the `APP_URL` environment variable in your `.env` file. This value should match the URL you use to access your application in a browser.

To run your tests, use the `dusk` Artisan command. The `dusk` command accepts any argument that is also accepted by the `phpunit` command:

```
php artisan dusk
```

Configuration
-------------

[](#configuration)

By default dusk use the port 9515 and have a timeout of 20 seconds.

If you need change the configuration the dusk port and/or timeout, it is needed to publish the config file:

```
php artisan vendor:publish --provider="Laravel\Dusk\DuskServiceProvider" --tag="config"
```

To make the changes by *environment variables*\*, add the fields in the **dusk env file**.

Extra methods
-------------

[](#extra-methods)

MethodDefinition[switchFrame](#switchFrame)(type of selector, value of selector)[select2](select2)(selector, value(s), wait in seconds)[selectBySelector](selectBySelector)(selector css, value of selector)[assertFragmentIs](assertFragmentIs)(value of fragment)[assertQueryIs](assertQueryIs)(value of query)[scrollTo](scrollTo)(selector jQuery)[wysiwyg](wysiwyg)(type of wysiwyg: tinymce, ID of wysiwyg, value)### Examples

[](#examples)

#### switchFrame

[](#switchframe)

Example of payment with paypal using the `switchFrame` method:

```
$browser->loginAs($user)
    ->visit('/user')
    ->assertSee('Some Event')
    ->clickLink('Register Now')
    ->assertSee('Some Event')
    ->check('accept_terms')
    ->press('Submit Application')
    ->assertSee('Your application has been submitted.')
    ->press('.paypal-button')
    ->waitFor('#injectedUnifiedLogin', 30)
    ->switchFrame('injectedUl')
    ->type('#email', env('PAYPAL_TEST_BUYER_USERNAME'))
    ->type('#password', env('PAYPAL_TEST_BUYER_PASSWORD'))
    ->press('#btnLogin')
    ->waitFor('#confirmButtonTop', 30)
    ->waitUntilMissing('#spinner')
    ->press('#confirmButtonTop')
    ->waitForText('You paid', 30)
    ->waitUntilMissing('#spinner')
    ->press('#merchantReturnBtn')
    ->waitForText('Events Registration', 30)
    ->pause(10000) // waiting for IPN callback from paypal
    ->refresh()
    ->assertSee('Payment verified')
    ;
```

#### select2

[](#select2)

Example of `select2` uses:

- For default select2. If value not passed, it be selected automatically:

```
$browse->select2('@selector');
```

- Another way, if need concrete value:

```
$browse->select2('@selector', 'you_text_value');
```

- For multiple mode usage like this:

```
$browse->select2('@selector', ['foo', 'bar'], 5);
```

- Css-selector for the select html tag should be ends with + select2 name:

```

```

```
$browse->select2('.select2-users + .select2', 'you_text_value');
```

#### selectBySelector

[](#selectbyselector)

Example of `selectBySelector` uses:

```
$browse->selectBySelector('select.my-custom-selector', 'value');
```

#### assertFragmentIs

[](#assertfragmentis)

Example of `assertFragmentIs` uses:

```
$browser->visit('http://laravel.com/#/login')
        ->assertPathIs('/')
        ->assertFragmentIs('/login');
```

#### assertQueryIs

[](#assertqueryis)

Example of `assertQueryIs` uses:

```
$browser->visit('http://laravel.com?key=test')
        ->assertPathIs('/')
        ->assertQueryIs('key=test');
```

#### scrollTo

[](#scrollto)

Example of `scrollTo` uses:

```
$browser->visit('http://laravel.com')
        ->scrollTo('#cookie-id')
        ->click('#cookie-id');
```

#### wysiwyg

[](#wysiwyg)

Example of `wysiwyg` uses:

```
$browser->visit('http://laravel.com')
        ->wysiwyg('tinymce', 'form-id', 'value');
```

License
-------

[](#license)

Laravel Dusk is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

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.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~76 days

Total

17

Last Release

2658d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2277596?v=4)[Jose Romero](/maintainers/Josrom)[@josrom](https://github.com/josrom)

---

Top Contributors

[![JoseVte](https://avatars.githubusercontent.com/u/3540836?v=4)](https://github.com/JoseVte "JoseVte (35 commits)")

---

Tags

dusklaravellaravel-dusktestinglaravelwebdriverLaravel 5.1dusk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/josrom-laravel-dusk-51/health.svg)

```
[![Health](https://phpackages.com/badges/josrom-laravel-dusk-51/health.svg)](https://phpackages.com/packages/josrom-laravel-dusk-51)
```

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k24.7M207](/packages/laravel-octane)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k41.3M39.1k](/packages/orchestra-testbench)[statamic/cms

The Statamic CMS Core Package

4.8k3.5M925](/packages/statamic-cms)[hotmeteor/spectator

Testing helpers for your OpenAPI spec

3051.5M1](/packages/hotmeteor-spectator)[guanguans/laravel-soar

SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。

2228.3k](/packages/guanguans-laravel-soar)[spurwork/spectator

Testing helpers for your OpenAPI spec

3041.5k](/packages/spurwork-spectator)

PHPackages © 2026

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