From 869d1c7225a71a3baa2f292569c6360417671b95 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Tue, 5 May 2026 13:55:54 +0000 Subject: [PATCH] fix(e2e): use .first() to handle strict mode violations with multiple headings (PRI-700) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kube-vip page has both 'kube-vip — Overview' (h1) and 'kube-vip Not Detected' (h2) headings. getByRole('heading', { name: /kube.vip/i }) resolves to both in strict mode. Using .first() to match the first one (the overview heading) instead. --- e2e/kube-vip.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/kube-vip.spec.ts b/e2e/kube-vip.spec.ts index 8d4d6f9..b2fc4f9 100644 --- a/e2e/kube-vip.spec.ts +++ b/e2e/kube-vip.spec.ts @@ -24,14 +24,14 @@ test.describe('kube-vip plugin smoke tests', () => { await page.waitForLoadState('networkidle'); await expect(page).toHaveURL(/kube-vip/); - await expect(page.getByRole('heading', { name: /kube.vip/i })).toBeVisible(); + await expect(page.getByRole('heading', { name: /kube.vip/i }).first()).toBeVisible(); }); test('kube-vip page renders content', async ({ page }) => { await page.goto('/c/main/kube-vip'); await waitForSidebar(page); - await expect(page.getByRole('heading', { name: /kube.vip/i })).toBeVisible({ + await expect(page.getByRole('heading', { name: /kube.vip/i }).first()).toBeVisible({ timeout: 15_000, }); @@ -43,7 +43,7 @@ test.describe('kube-vip plugin smoke tests', () => { test('plugin settings page shows kube-vip plugin entry', async ({ page }) => { await page.goto('/settings/plugins'); await page.waitForLoadState('networkidle'); - await page.waitForSelector('[class*="PluginList"], [class*="plugins"], table, list', { timeout: 10_000 }).catch(() => {}); + await page.waitForSelector('table, [class*="PluginList"], [class*="plugin"]', { timeout: 10_000 }).catch(() => {}); const pluginEntry = page.locator('text=/kube.vip/i').first(); await expect(pluginEntry).toBeVisible({ timeout: 30_000 });