test(browser): expand config coverage and shared helpers

Add BrowserTestHelpers and configuration/deploy browser tests for apps,
databases, services, and Livewire toggles. Refactor existing browser
suites onto shared seed/login helpers, soft-skip onboarding, and null
broadcasting so host-side Pest runs avoid docker DNS.
This commit is contained in:
Andras Bacsai
2026-08-04 11:43:45 +02:00
parent ff0590137d
commit 07933640f2
14 changed files with 1508 additions and 270 deletions
+21 -2
View File
@@ -26,6 +26,7 @@ uses(TestCase::class)->in('Feature', 'v4/Feature', 'v4/Browser', 'v5/Browser');
*/
require_once __DIR__.'/Support/V5TestHelpers.php';
require_once __DIR__.'/Support/BrowserTestHelpers.php';
/*
|--------------------------------------------------------------------------
@@ -41,15 +42,33 @@ beforeEach(function () {
// Flush the Server identity map cache to ensure tests get fresh data
Server::flushIdentityMap();
// Browser Livewire actions often dispatch events; the Soketi host is not
// resolvable from host-side Pest runs (docker DNS name coolify-realtime).
config(['broadcasting.default' => 'null']);
});
function loginAndSkipBoarding(string $email = 'test@example.com', string $password = 'password'): mixed
{
return visit('/login')
$page = visit('/login')
->fill('email', $email)
->fill('password', $password)
->click('Login')
->click('Skip Setup');
->wait(1.5);
// First-login root users land on onboarding; skip when the control exists.
$page->script(<<<'JS'
(() => {
const candidates = Array.from(document.querySelectorAll('button, a, [role="button"]'));
const skip = candidates.find((el) => (el.textContent || '').trim().toLowerCase() === 'skip setup');
if (skip) {
skip.click();
}
})()
JS);
$page->wait(1.5);
return $page;
}
/*