Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
/ laravel-dusk-starter Public archive

Drop in Laravel + Dusk starter kit to provide browser testing for non-Laravel applications

Notifications You must be signed in to change notification settings

uofa/laravel-dusk-starter

Repository files navigation

Laravel Dusk provides an expressive, easy-to-use browser automation and testing API. By default, Dusk does not require you to install JDK or Selenium on your machine. Instead, Dusk uses a standalone ChromeDriver installation. However, you are free to utilize any other Selenium compatible driver you wish.

Setup

  • Install necessary dependencies (composer install)
  • Start writing your tests by modifying ./tests/Browser/AppTest.php
  • Refer to the documentation (v5.4) for help in choosing assertions
  • To run Dusk, execute php artisan dusk on the command line

Custom Browser Assertions

  • ./tests/Browser/BaseBrowser.php
Assertion Description
$browser->assertElementCountIs($count, $elements) Assertion for checking the number of elements matches a given count.
$browser->assertElementCountIsNot($count, $elements) Assertion for checking the number of elements does not match a given count.

Custom Browser Macros

  • ./app/Providers/TestServiceProvider.php
$browser->scrollIntoView(string $id [, bool $addBuffer = true]);

$browser->scrollTo(string $element);

About

Drop in Laravel + Dusk starter kit to provide browser testing for non-Laravel applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages