Switch from domcontentloaded to load, fix waitForAngular

Root cause found via screenshot: page.goto with domcontentloaded
returned before Angular even bootstrapped — the page still showed
Dashboard while the test checked for integration content.

Fix: Change waitUntil from domcontentloaded to load across all 37
goto calls. 'load' waits for initial JS/CSS to load, meaning Angular
has bootstrapped and the SPA router has processed the route.

Simplified waitForAngular to wait for route-level content selectors
without the URL check (the load event handles that now).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-02 22:24:32 +03:00
parent 9402f1a558
commit 1a356ee72d
12 changed files with 107 additions and 107 deletions

View File

@@ -276,7 +276,7 @@ test.describe('Integration Services — Connector Lifecycle', () => {
const browser = await playwright.chromium.launch();
const page = await browser.newPage({ ignoreHTTPSErrors: true });
await page.goto(BASE, { waitUntil: 'domcontentloaded' });
await page.goto(BASE, { waitUntil: 'load' });
if (page.url().includes('/welcome')) {
await page.getByRole('button', { name: /sign in/i }).click();
await page.waitForURL('**/connect/authorize**', { timeout: 10_000 });
@@ -619,7 +619,7 @@ test.describe('Integration Services — Connector CRUD & Status', () => {
test.describe('Integration Services — UI Verification', () => {
test('landing page redirects to first populated tab or shows onboarding', async ({ liveAuthPage: page }) => {
await page.goto(`${BASE}/setup/integrations`, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.goto(`${BASE}/setup/integrations`, { waitUntil: 'load', timeout: 60_000 });
await waitForAngular(page);
// Wait for Angular to redirect to a tab (happens after loadCounts() completes)
@@ -640,38 +640,38 @@ test.describe('Integration Services — UI Verification', () => {
});
test('Registries tab lists registry integrations', async ({ liveAuthPage: page }) => {
await page.goto(`${BASE}/setup/integrations/registries`, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.goto(`${BASE}/setup/integrations/registries`, { waitUntil: 'load', timeout: 60_000 });
await waitForAngular(page);
// Wait for table data to load (auto-retry with timeout)
const rows = page.locator('table tbody tr');
await expect(rows.first()).toBeVisible({ timeout: 15_000 });
await expect(rows.first()).toBeVisible({ timeout: 30_000 });
await snap(page, '02-registries-tab');
});
test('SCM tab lists SCM integrations', async ({ liveAuthPage: page }) => {
await page.goto(`${BASE}/setup/integrations/scm`, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.goto(`${BASE}/setup/integrations/scm`, { waitUntil: 'load', timeout: 60_000 });
await waitForAngular(page);
const rows = page.locator('table tbody tr');
await expect(rows.first()).toBeVisible({ timeout: 15_000 });
await expect(rows.first()).toBeVisible({ timeout: 30_000 });
await snap(page, '03-scm-tab');
});
test('CI/CD tab lists CI/CD integrations', async ({ liveAuthPage: page }) => {
await page.goto(`${BASE}/setup/integrations/ci`, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.goto(`${BASE}/setup/integrations/ci`, { waitUntil: 'load', timeout: 60_000 });
await waitForAngular(page);
const rows = page.locator('table tbody tr');
await expect(rows.first()).toBeVisible({ timeout: 15_000 });
await expect(rows.first()).toBeVisible({ timeout: 30_000 });
await snap(page, '04-cicd-tab');
});
test('tab switching navigates between all tabs', async ({ liveAuthPage: page }) => {
await page.goto(`${BASE}/setup/integrations`, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.goto(`${BASE}/setup/integrations`, { waitUntil: 'load', timeout: 60_000 });
await waitForAngular(page);
const tabs = ['Registries', 'SCM', 'CI/CD', 'Runtimes / Hosts', 'Advisory & VEX', 'Secrets'];