Skip to content

Laravel Dusk browser testing for TastyIgniter core and extensions

License

Notifications You must be signed in to change notification settings

tastyigniter/ti-ext-dusk

Repository files navigation

Build Status Total Downloads Latest Stable Version License

Introduction

The TastyIgniter Dusk extension brings Laravel Dusk's browser testing capabilities to your TastyIgniter application. It equips core and extension developers with the tools to write and run automated browser tests, ensuring your application's functionality is robust and reliable.

Note: This extension is intended for development purposes only. It should never be installed in a production environment, as it could allow arbitrary users to authenticate with your application.

Features

  • Automated Browser Testing: Write and run tests that simulate user interactions with your application.
  • Easy Setup: Get started with browser testing quickly with minimal configuration.

Installation

You can install the extension via composer using the following command:

composer require tastyigniter/ti-ext-dusk:"^4.0" -W

After installing the extension, run the following command to create a tests/Browser directory, an example Dusk test, and install the Chrome Driver binary for your operating system:

php artisan dusk:install

Getting started

Set the APP_URL environment variable in your application's .env file to the URL of your TastyIgniter application. This URL is used when running your browser tests.

Usage

Writing tests

You can write your browser tests in the tests/Browser directory of your extension. By default, the extension creates an example test in the tests/Browser/ExampleTest.php file. If you are new to writing Dusk tests, you can refer to the Laravel Dusk documentation for more information.

Running tests

To run your browser tests, use the dusk command to run all the tests in the tests/Browser directory.

php artisan dusk

You can also run a specific test file by passing the path to the test file as an argument to the dusk command:

php artisan dusk tests/Browser/ExampleTest.php

You can re-run tests that failed in the previous test run the following command:

php artisan dusk:fails

Managing Chrome Driver

The dusk:chrome-driver command allows you to install a different version of the Chrome Driver binary.

# Install the latest version of ChromeDriver for your OS...
php artisan dusk:chrome-driver
 
# Install a given version of ChromeDriver for your OS...
php artisan dusk:chrome-driver 86
 
# Install a given version of ChromeDriver for all supported OSs...
php artisan dusk:chrome-driver --all
 
# Install the version of ChromeDriver that matches the detected version of Chrome / Chromium for your OS...
php artisan dusk:chrome-driver --detect

Changelog

Please see CHANGELOG for more information on what has changed recently.

Reporting issues

If you encounter a bug in this extension, please report it using the Issue Tracker on GitHub.

Contributing

Contributions are welcome! Please read TastyIgniter's contributing guide.

Security vulnerabilities

For reporting security vulnerabilities, please see our our security policy.

License

TastyIgniter Coupons extension is open-source software licensed under the MIT license.

About

Laravel Dusk browser testing for TastyIgniter core and extensions

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages