Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/divineomega/phantomjs-laravel-testing
The PhantomJS Laravel Testing package allows you to easily test your Laravel application's JavaScript functionality.
https://github.com/divineomega/phantomjs-laravel-testing
automated-testing functional-testing integration-testing laravel phantomjs php testing
Last synced: 3 months ago
JSON representation
The PhantomJS Laravel Testing package allows you to easily test your Laravel application's JavaScript functionality.
- Host: GitHub
- URL: https://github.com/divineomega/phantomjs-laravel-testing
- Owner: DivineOmega
- License: lgpl-3.0
- Created: 2017-02-07T23:28:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-06T10:00:02.000Z (almost 7 years ago)
- Last Synced: 2024-10-15T02:38:41.451Z (3 months ago)
- Topics: automated-testing, functional-testing, integration-testing, laravel, phantomjs, php, testing
- Language: PHP
- Homepage:
- Size: 34.2 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PhantomJS Laravel Testing
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](https://laravel.com/docs/master/dusk) instead. [PhantomJS development is being suspended](https://github.com/ariya/phantomjs/issues/15344) and will likely not receive any future updates.**
## Features
* Identical syntax to standard Laravel testing code where possible
* PhantomJS-powered headless browser allows full functionality testing, including JavaScript & AJAX
* Makes use of database transactions to prevent testing having permanent effects on the database
* Automated setup and install of all dependencies, including phantomjs binary## Requirements
* Only Laravel 5.1 is currently supported
## Installation
1. Add composer script `"PhantomInstaller\\Installer::installPhantomJS"` to `composer.json` `post-install-cmd` and `post-update-cmd` arrays.
2. Install via `composer require divineomega/phantomjs-laravel-testing`.
3. Add service provider `DivineOmega\PhantomJSLaravelTesting\ServiceProvider::class` to `config/app.php` `providers` array.
4. Add global middleware `\DivineOmega\PhantomJSLaravelTesting\Http\Middleware\GlobalMiddleware::class` to `app/Http/Kernel.php` `middleware` array.## Usage
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
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');
}
}```