Download the PHP package stechstudio/laravel-visual-testing without Composer

On this page you can find all versions of the php package stechstudio/laravel-visual-testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-visual-testing

Visual UI screenshot testing for Laravel Dusk

Latest Version on Packagist Build Status

This package extends Dusk with the ability to do visual diffs with the Percy visual testing platform.

Why write visual tests?

If you are new to the idea of visual testing we recommend reading through Visual testing and visual diffs on the Percy blog.

Sometimes called visual regression testing or UI testing, visual testing is the process of automatically discovering and reviewing software for perceptual changes.

Visual testing is all about what your users actually see and interact with.

This form of testing is very useful in cases where you want to guard against unexpected changed to your UI. Visual testing is not meant to replace your Laravel unit/feature/browser tests, but rather provide another tool in your testing toolbox.

Getting started

This package integrates with Laravel Dusk. If you haven't already, first go through the Dusk installation steps and make sure you can run the example test with php artisan dusk.

Next:

  1. Sign up for a free account at percy.io and create your first project. Put your PERCY_TOKEN in your Laravel .env file (or specific dusk environment files if you are using those).

  2. Install the @percy/agent NPM package.

  3. Install this composer package.

How to use

To take a snapshot call snapshot() on the browser instance in any of your Dusk tests.

Then run your test suite like your normally would.

Naming your snapshots

By default the name of your snapshot will be the relative URL of the page (e.g. /auth/login). You can also pass in your own name when taking the snapshot.

Snapshot options

You can pass in an array of options when taking a snapshot:

Disabling snapshots

If you want to run your tests without snapshots, use the --without-percy command line option.

Selecting base build branch

Percy uses a variety of strategies to determine the optimal base build for comparison. For details see Base build selection.

If you want to override and specify your own base you have two options:

Basic example

Open the example test at tests/Browser/ExampleTest.php. Add a call to snapshot() right after the visit, and pass in a name for your snapshot.

Now go run your test:

If all goes well, you should see output similar to this:

Now go check out your Percy dashboard, and you should see the new build.

At this point it won't have anything to compare the snapshot to. But if you go modify the welcome.blade.php file and run it again, you'll get a nice visual diff of your change.


All versions of laravel-visual-testing with dependencies

PHP Build Version
Package Version
Requires laravel/dusk Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stechstudio/laravel-visual-testing contains the following files

Loading the files please wait ....