mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 14:23:44 +00:00
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:
+21
-2
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user