added browser tests
linter / quality (push) Failing after 1m3s
tests / ci (8.3) (push) Failing after 49s
tests / ci (8.4) (push) Failing after 1m4s
tests / ci (8.5) (push) Failing after 1m5s

This commit is contained in:
Daan Meijer
2026-06-23 15:03:34 +02:00
parent 1e33bfb50b
commit a35b50bec6
15 changed files with 491 additions and 171 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
use App\Models\User;
class LoginTest extends DuskTestCase
{
public function test_a_user_can_log_in(): void
{
User::where('email', 'dusk@example.com')->delete();
$user = User::factory()->create([
'email' => 'dusk@example.com',
]);
$this->browse(function (Browser $browser) use ($user) {
$browser->visit('/login')
->waitFor('#email')
->type('email', $user->email)
->type('password', 'wrong-password')
->press('[data-test="login-button"]')
->assertPathIs('/login')
->screenshot('login-error');
});
}
}