Package Data | |
---|---|
Maintainer Username: | DivineOmega |
Package Create Date: | 2017-02-07 |
Package Last Update: | 2018-03-06 |
Home Page: | |
Language: | PHP |
License: | LGPL-3.0 |
Last Refreshed: | 2024-12-15 15:11:18 |
Package Statistics | |
---|---|
Total Downloads: | 50 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 5 |
Total Watchers: | 4 |
Total Forks: | 0 |
Total Open Issues: | 0 |
The PhantomJS Laravel Testing package allows you to easily test your Laravel application's JavaScript functionality. It makes use of the PhantomJS headless browser to emulate how a real use would interact with your pages. If you have done regular Laravel testing, you'll be happy to know that this package attempts to match its syntax as much as possible.
💡 NOTE: If you're starting a new project, I recommend using Laravel Dusk instead. PhantomJS development is being suspended and will likely not receive any future updates.
"PhantomInstaller\\Installer::installPhantomJS"
to composer.json
post-install-cmd
and post-update-cmd
arrays.composer require divineomega/phantomjs-laravel-testing
.DivineOmega\PhantomJSLaravelTesting\ServiceProvider::class
to config/app.php
providers
array.\DivineOmega\PhantomJSLaravelTesting\Http\Middleware\GlobalMiddleware::class
to app/Http/Kernel.php
middleware
array.Simply change your test classes to extend PhantomJSTestCase
instead of TestCase
, then run your unit tests as you normally do. PhantomJS will
automatically be started up when required.
An example test case is shown below.
<?php
use DivineOmega\PhantomJSLaravelTesting\Objects\PhantomJSTestCase;
class ExampleTestCase extends PhantomJSTestCase
{
public function testGoogleShowsImFeelingLucky()
{
$this->visit('https://google.co.uk/');
$this->see('I\'m Feeling Lucky');
}
public function testGoogleShowsImFeelingDucky()
{
$this->visit('https://google.co.uk/');
$this->see('I\'m Feeling Ducky');
}
}