mabadir / laravel-cypress
Library to bootstrap Cypress testing in Laravel
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-01-11 16:26:12 UTC
README
Easily Bootstrap your Laravel application with Cypress helpers to get you up and running with Cypress testing quickly.
Documentation
Install
You can install this package through composer. Make sure to request this package as Dev Dependency only, to avoid any potential security risks.
composer require mabadir/laravel-cypress --dev
Then you need to publish the config file through:
php artisan vendor:publish
Configuration
-
First ensure you have configured the URL that you will use for your Cypress Acceptance testing. Usually this URL is something like
acceptance.example.test
. In your.env
file add an entry:CYPRESS_URL=acceptance.example.test
-
This package supports swapping the Database on the fly in order to keep your
local
database clean from acceptance testing data. The database needs to be using thelocal
database connection. Add this entry to.env
:CYPRESS_DB=acceptance
-
Add Cypress commands to
cypress/support/commands.js
by running the command:php artisan cypress:publish
Usage
This package by default offers the following routes:
You can extend or override the built in routes, by creating a new routes file in your app routes/acceptance.php
. Adding any routes to this file will make them available to your acceptance
domain name only. All routes are prefixed by /__testing__/
Security
If you discover any security related issues, please email mina@abadir.email instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.