breakign dusk tests

This commit is contained in:
Mark Gregory
2026-06-19 11:35:58 +01:00
parent 978b477de3
commit 9e633b6e5b
7 changed files with 133 additions and 90 deletions
+12 -3
View File
@@ -3,17 +3,20 @@
namespace Tests\Browser;
use Laravel\Dusk\Browser;
use Tests\Browser\Concerns\InteractsWithWmsBrowser;
use Tests\Browser\Concerns\InteractsWithWmsData;
use Tests\DuskTestCase;
class AuthBrowserTest extends DuskTestCase
{
use InteractsWithWmsBrowser;
use InteractsWithWmsData;
public function test_login_page_renders_professional_auth_form(): void
{
$this->browse(function (Browser $browser): void {
$browser->visit('/login')
->waitFor('input[name="email"]', 10)
->assertSee('Log in')
->assertPresent('input[name="email"]')
->assertPresent('input[name="password"]')
@@ -45,10 +48,16 @@ class AuthBrowserTest extends DuskTestCase
->visit('/admin')
->waitFor('.wms-app-shell', 10)
->assertSee('Platform')
->assertPresent('form[action$="/logout"]')
->script('document.querySelector("form[action$=\\"/logout\\"]").submit();');
->assertPresent('form[action$="/logout"]');
$browser->waitForLocation('/', 10);
$this->removeDebugbar($browser);
$browser->script('document.querySelector("form[action$=\\"/logout\\"]")?.submit();');
$browser->waitUntil(
'window.location.pathname === "/" || window.location.pathname === "/login" || ! document.querySelector(".wms-app-shell")',
15
);
});
}