PHP code example of josrom / laravel-dusk-5.1
1. Go to this page and download the library: Download josrom/laravel-dusk-5.1 library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
josrom / laravel-dusk-5.1 example snippets
if ($this->app->environment('local')) {
$this->app->register(\Laravel\Dusk\DuskServiceProvider::class);
}
$browser->loginAs($user)
->visit('/user')
->assertSee('Some Event')
->clickLink('Register Now')
->assertSee('Some Event')
->check('accept_terms')
->press('Submit Application')
->assertSee('Your application has been submitted.')
->press('.paypal-button')
->waitFor('#injectedUnifiedLogin', 30)
->switchFrame('injectedUl')
->type('#email', env('PAYPAL_TEST_BUYER_USERNAME'))
->type('#password', env('PAYPAL_TEST_BUYER_PASSWORD'))
->press('#btnLogin')
->waitFor('#confirmButtonTop', 30)
->waitUntilMissing('#spinner')
->press('#confirmButtonTop')
->waitForText('You paid', 30)
->waitUntilMissing('#spinner')
->press('#merchantReturnBtn')
->waitForText('Events Registration', 30)
->pause(10000) // waiting for IPN callback from paypal
->refresh()
->assertSee('Payment verified')
;
$browse->select2('@selector');
$browse->select2('@selector', 'you_text_value');
$browse->select2('@selector', ['foo', 'bar'], 5);
$browse->select2('.select2-users + .select2', 'you_text_value');
$browse->selectBySelector('select.my-custom-selector', 'value');
$browser->visit('http://laravel.com/#/login')
->assertPathIs('/')
->assertFragmentIs('/login');
$browser->visit('http://laravel.com?key=test')
->assertPathIs('/')
->assertQueryIs('key=test');
$browser->visit('http://laravel.com')
->scrollTo('#cookie-id')
->click('#cookie-id');
$browser->visit('http://laravel.com')
->wysiwyg('tinymce', 'form-id', '<h2>value</h2>');
bash
php artisan dusk:install
bash
php artisan dusk
bash
php artisan vendor:publish --provider="Laravel\Dusk\DuskServiceProvider" --tag="config"