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:
@@ -132,14 +132,14 @@ test.describe('Pagination — API', () => {
|
||||
test.describe('Pagination — UI Pager', () => {
|
||||
test('pager info renders on registries tab', async ({ liveAuthPage: page }) => {
|
||||
await page.goto(`${BASE}/setup/integrations/registries`, {
|
||||
waitUntil: 'domcontentloaded',
|
||||
waitUntil: 'load',
|
||||
timeout: 45_000,
|
||||
});
|
||||
await waitForAngular(page);
|
||||
|
||||
// The pager should show "X total . page Y of Z" — auto-retry
|
||||
const pagerInfo = page.locator('.pager__info');
|
||||
await expect(pagerInfo).toBeVisible({ timeout: 15_000 });
|
||||
await expect(pagerInfo).toBeVisible({ timeout: 30_000 });
|
||||
await expect(pagerInfo).toContainText('total', { timeout: 15_000 });
|
||||
await expect(pagerInfo).toContainText('page', { timeout: 15_000 });
|
||||
|
||||
@@ -148,20 +148,20 @@ test.describe('Pagination — UI Pager', () => {
|
||||
|
||||
test('pager controls are present', async ({ liveAuthPage: page }) => {
|
||||
await page.goto(`${BASE}/setup/integrations/registries`, {
|
||||
waitUntil: 'domcontentloaded',
|
||||
waitUntil: 'load',
|
||||
timeout: 45_000,
|
||||
});
|
||||
await waitForAngular(page);
|
||||
|
||||
// Check for pagination navigation — auto-retry
|
||||
const pager = page.locator('.pager');
|
||||
await expect(pager).toBeVisible({ timeout: 15_000 });
|
||||
await expect(pager).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
// Should have navigation buttons
|
||||
const firstBtn = page.locator('button[title="First page"]');
|
||||
const lastBtn = page.locator('button[title="Last page"]');
|
||||
await expect(firstBtn).toBeVisible({ timeout: 15_000 });
|
||||
await expect(lastBtn).toBeVisible({ timeout: 15_000 });
|
||||
await expect(firstBtn).toBeVisible({ timeout: 30_000 });
|
||||
await expect(lastBtn).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
await snap(page, 'pagination-ui-controls');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user