Download the PHP package josrom/laravel-dusk-5.1 without Composer
On this page you can find all versions of the php package josrom/laravel-dusk-5.1. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-dusk-5.1
Laravel 5.1
Introduction
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. However, you are free to utilize any other Selenium driver you wish.
Official Documentation
Documentation for Dusk can be found on the Laravel website.
Installation
To get the last version of Laravel Dusk for 5.1, simply require the project using Composer:
Instead, you may of course manually update your require block and run composer update if you so choose:
Add the service provider app/Providers/AppServiceProvider.php
file:
After installing the Dusk package, run the dusk:install
Artisan command:
A Browser
directory will be created within your tests
directory and will contain an example test. Next, set the APP_URL
environment variable in your .env
file. This value should match the URL you use to access your application in a browser.
To run your tests, use the dusk
Artisan command. The dusk
command accepts any argument that is also accepted by the phpunit
command:
Configuration
By default dusk use the port 9515 and have a timeout of 20 seconds.
If you need change the configuration the dusk port and/or timeout, it is needed to publish the config file:
To make the changes by *environment variables, add the fields in the dusk env file**.
Extra methods
Method | Definition |
---|---|
switchFrame | (type of selector, value of selector) |
select2 | (selector, value(s), wait in seconds) |
selectBySelector | (selector css, value of selector) |
assertFragmentIs | (value of fragment) |
assertQueryIs | (value of query) |
scrollTo | (selector jQuery) |
wysiwyg | (type of wysiwyg: tinymce, ID of wysiwyg, value) |
Examples
switchFrame
Example of payment with paypal using the switchFrame
method:
select2
Example of select2
uses:
-
For default select2. If value not passed, it be selected automatically:
-
Another way, if need concrete value:
-
For multiple mode usage like this:
- Css-selector for the select html tag should be ends with + select2 name:
selectBySelector
Example of selectBySelector
uses:
assertFragmentIs
Example of assertFragmentIs
uses:
assertQueryIs
Example of assertQueryIs
uses:
scrollTo
Example of scrollTo
uses:
wysiwyg
Example of wysiwyg
uses:
License
Laravel Dusk is open-sourced software licensed under the MIT license
All versions of laravel-dusk-5.1 with dependencies
laravel/framework Version 5.1.*
facebook/webdriver Version 1.*
nesbot/carbon Version ~1.20