samirnijenhuis / laravel-percy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Percy.io in your Laravel testsuite

This is an unofficial package to bring Percy to your Laravel testsuite, we are in no way related to Percy.io

What It Does

This package allows you to easily use Percy in your existing Laravel testsuite

Installation

First make sure you have the Percy CLI installed

npm install --save-dev @percy/cli

or

yarn add --dev @percy/cli

Install this package

composer require --dev letspaak/laravel-percy

Add the PERCY_TOKEN to your .env file

PERCY_TOKEN=aaabbbcccdddeeefff

Usage

By default we use Laravel's Dusk package to capture our webpages that we send to Percy.

// Visit the homepage and send the snapshot to Percy
$browser->visit('/')->snapshot('Homepage')

After your tests are created, run them as follows:

npx percy exec -- php artisan dusk

Credits

This package is heavily based on Percy's Java implementation

Alternatives

License

The MIT License (MIT). Please see License File for more information.

About


Languages

Language:PHP 100.0%