Replace fixed waits with waitForAngular in UI tests

The 3s waitForTimeout after page.goto wasn't enough for Angular to
bootstrap and render content. Replace with waitForAngular() helper
that waits for actual DOM elements (nav, headings) up to 15s, with
5s fallback.

32 calls updated across 10 test files.

Also adds waitForAngular to helpers.ts export.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-02 20:31:34 +03:00
parent 624e132a61
commit 744637c7c6
10 changed files with 47 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ import {
createIntegrationViaApi,
cleanupIntegrations,
snap,
waitForAngular,
} from './helpers';
const BASE = process.env['PLAYWRIGHT_BASE_URL'] || 'https://stella-ops.local';
@@ -172,7 +173,7 @@ test.describe('Secrets Integration — UI Verification', () => {
createdIds.push(vaultId, consulId);
await page.goto(`${BASE}/setup/integrations/secrets`, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.waitForTimeout(3_000);
await waitForAngular(page);
// Verify the page loaded with the correct heading
const heading = page.getByRole('heading', { name: /secrets/i });
@@ -193,7 +194,7 @@ test.describe('Secrets Integration — UI Verification', () => {
waitUntil: 'domcontentloaded',
timeout: 45_000,
});
await page.waitForTimeout(3_000);
await waitForAngular(page);
// Verify detail page loaded — should show integration name
const pageContent = await page.textContent('body');