Patb Patb - 1 year ago 86
PHP Question

PHPUnit Selenium integration for Laravel 5.2+

Before Laravel's 5.2 release, Laracasts' integrated package was providing Selenium integration for Laravel. I couldn't find any similar package for the 5.2 release. Is there any? How can I integrate selenium testing with Laravel?

I've seen these links, they do not provide any solutions:

Selenium and Laravel 5.2

Has anyone tried Laravel Integrated package in Laravel 5.2?

Answer Source

PHPUnit itself has a selenium extension. It's not quite laravelish, and is not backed by a modern WebDriver interface.

CodeCeption is a very powerful, yet easy-to-use testing tool for PHP. Not only does it provide a unit-testing API, it also provides its own selenium acceptance testing API.

It also has perfect Laravel integration and a great chrome extension for generating acceptance test in browser. Here's an example code from the docs:

$I->fillField('username', 'davert');
$I->fillField('password', 'qwerty');
$I->see('Welcome to codeception!');

Here's a step-by-step guide to getting started with acceptance testing using CodeCeption:

Here are some other options: