PHP code example of valcuandrei / pest-e2e

1. Go to this page and download the library: Download valcuandrei/pest-e2e 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/ */

    

valcuandrei / pest-e2e example snippets


use App\Models\User;

test('that a user can update their profile', function () {
    $user = User::factory()->create();

    e2e('frontend')
        ->actingAs($user)
        ->withParams([
            'name' => 'Test User',
            'email' => '[email protected]',
        ])
        ->runTest('UserProfile can update their profile');

    expect($user->fresh()->name)->toBe('Test User');
    expect($user->fresh()->email)->toBe('[email protected]');
});

e2e()->target('frontend', fn ($p) => $p
    ->dir('resources/js/e2e')
    ->env(['APP_URL' => 'http://localhost'])
    ->params(['baseUrl' => 'http://localhost'])
);

e2e('frontend')->run();

e2e('frontend')->runTest('UserProfile can update their profile');

e2e('frontend')
    ->withParams(['name' => 'Test User'])
    ->runTest('UserProfile can update their profile');

e2e('frontend')
    ->actingAs($user)
    ->runTest('Dashboard loads');

e2e('frontend')->run();

'agent_output' => true,

config('pest-e2e.auth.route');

config('pest-e2e.reports.base_dir');
bash
php artisan pest-e2e:install
bash
php artisan pest-e2e:install --yes
bash
php artisan pest-e2e:install --unattended
bash
php artisan pest-e2e:install --configure-phpunit
bash
php artisan test --parallel --processes=4
bash
php artisan test --parallel --recreate-databases
text
testing_test_1
testing_test_2
testing_test_3
testing_test_4
dotenv
PEST_E2E_SERVER_PORT=8800
bash
php artisan test
bash
php artisan test --parallel --processes=4
bash
PEST_E2E_AGENT_OUTPUT=1 php artisan test ./tests/Browser
bash
php artisan test ./tests/Browser --pest-e2e-agent-output
php artisan test ./tests/Browser --parallel --pest-e2e-agent-output
text
CURSOR_AGENT
bash
php artisan test --browse
php artisan test --debug
php artisan test --run-using=yarn
text
/pest-e2e/auth/login
text
storage/framework/testing/pest-e2e