PHP code example of rainlab / dusk-plugin

1. Go to this page and download the library: Download rainlab/dusk-plugin 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/ */

    

rainlab / dusk-plugin example snippets


// File: plugins/october/test/tests/browser/AuthenticationTest.php
//
class AuthenticationTest extends BrowserTestCase
{
    public function testAuthentication()
    {
        $this->browse(function($browser) {
            $browser
                ->visit('/admin')
                ->waitForLocation('/admin/backend/auth/signin')
                ->assertTitleContains('Administration Area |')
                ->type('login', env('DUSK_ADMIN_USER', 'admin'))
                ->type('password', env('DUSK_ADMIN_PASS', 'admin'))
                ->check('remember')
                ->press('Login');

            $browser
                ->waitForLocation('/admin')
                ->assertTitleContains('Dashboard |')
                ->click('#layout-mainmenu .mainmenu-account > a')
                ->clickLink('Sign Out');

            $browser
                ->waitForLocation('/admin/backend/auth/signin')
                ->assertTitleContains('Administration Area |');
        });
    }
}
bash
php artisan dusk:chrome-driver
bash
php artisan dusk:chrome-driver 86
bash
php artisan test:dusk <PLUGIN CODE>
bash
php artisan test:dusk october.test
bash
php artisan test:dusk october.test --browse

php artisan test:dusk october.test --filter=PeopleTest