add dusk tests

This commit is contained in:
Andras Bacsai
2024-10-28 22:57:56 +01:00
parent bb7184b3ff
commit 2eef8ee433
10 changed files with 117 additions and 64 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\Browser;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
use Throwable;
class ProjectAddNewTest extends DuskTestCase
{
/**
* A basic test for the projects page.
* Login with the test user and assert that the user is redirected to the projects page.
*
* @return void
*
* @throws Throwable
*/
public function testLogin()
{
$this->browse(function (Browser $browser) {
$browser->loginWithRootUser()
->visit('/projects')
->pressAndWaitFor('+ Add', 1)
->assertSee('New Project')
->screenshot('project-add-new-1')
->type('name', 'Test Project')
->screenshot('project-add-new-2')
->press('Continue')
->assertSee('Test Project.')
->screenshot('project-add-new-3');
});
}
}