styde / dawn
Browser kit testing for Laravel 5.4, compatible with Laravel Dusk
Installs: 1 099
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.9
- symfony/css-selector: ~3.1
- symfony/dom-crawler: ~3.1
This package is auto-updated.
Last update: 2020-08-06 00:17:03 UTC
README
Testing the idea of having a browser kit testing for laravel 5.4 with an API similar to the one provided by Laravel Dusk
Installation:
Install the package by executing composer require "styde/dawn=dev-master"
in the console.
Then include the trait Styde\Dawn\SupportsBrowserKit
in your TestCase
class, for example:
<?php
namespace Tests;
use TestCase;
use Styde\Dawn\SupportsBrowserKit;
class DawnTestCase extends TestCase
{
use SupportsBrowserKit;
}
And that's it! Now you will be able to call visit
which will return an instance of the Styde\Dawn\TestResponse
class.
This test response class includes methods such as: assertPathIs
or assertSeeIn
that will allow you to test the response using the Browser kit testing.
The main difference / idea vs the current Browser Kit Testing package (https://github.com/laravel/browser-kit-testing) is reproducing the Laravel Dusk API, so it is easier to move the test between the two packages
(i.e. use browser kit testing when JavaScript is not required to speed up the tests, or Dusk in order to be able to test JavaScript, get screenshots etc.
This is not suppose to be a legacy package either but to be actively maintained in case the community finds it useful, therefore I'm looking forward to read your thoughts.