Compare commits

...

4 Commits

Author SHA1 Message Date
Chris Farhood ced728fbb4 fix(e2e): use button role with explicit waitFor for storage classes
As directed by Nancy, try button role with explicit waitFor before
falling back to direct navigation. The sidebar Storage Classes item
may be a button not a link.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 22:42:37 +00:00
Chris Farhood a1dae964f3 fix(e2e): navigate directly to storage-classes URL instead of sidebar click
The sidebar click approach is flaky - the Storage Classes link is nested under
the Rook button and not reliably visible/clickable. Navigate directly to the
storage-classes URL and verify the page loads with correct heading.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 22:39:03 +00:00
Chris Farhood 7733ee517d fix(e2e): add waitForSidebar before clicking Rook button + 1s wait after
Add waitForSidebar() call before clicking Rook button to ensure sidebar is fully loaded.

Add 1s explicit wait after clicking Rook button to allow sidebar animation to complete before searching for nested Storage Classes link.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 22:35:59 +00:00
Chris Farhood c70bef73d6 fix(e2e): expand Rook sidebar before navigating to storage classes
The storage classes link is nested under the Rook sidebar button and
may not be visible until the Rook section is expanded. Click the Rook
button to expand before asserting visibility.

Also use .first() on heading assertions to avoid strict mode violations
when multiple headings match the regex pattern.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 22:30:24 +00:00
+12 -7
View File
@@ -24,14 +24,14 @@ test.describe('Rook plugin smoke tests', () => {
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await expect(page).toHaveURL(/rook-ceph/); await expect(page).toHaveURL(/rook-ceph/);
await expect(page.getByRole('heading', { name: /overview/i })).toBeVisible(); await expect(page.getByRole('heading', { name: /overview/i }).first()).toBeVisible();
}); });
test('overview page renders content', async ({ page }) => { test('overview page renders content', async ({ page }) => {
await page.goto('/c/main/rook-ceph'); await page.goto('/c/main/rook-ceph');
await waitForSidebar(page); await waitForSidebar(page);
await expect(page.getByRole('heading', { name: /overview/i })).toBeVisible({ await expect(page.getByRole('heading', { name: /overview/i }).first()).toBeVisible({
timeout: 15_000, timeout: 15_000,
}); });
@@ -42,22 +42,27 @@ test.describe('Rook plugin smoke tests', () => {
test('navigation to storage classes view works', async ({ page }) => { test('navigation to storage classes view works', async ({ page }) => {
await page.goto('/c/main/rook-ceph'); await page.goto('/c/main/rook-ceph');
await waitForSidebar(page);
const sidebar = page.getByRole('navigation', { name: 'Navigation' }); const sidebar = page.getByRole('navigation', { name: 'Navigation' });
const storageClassesLink = sidebar.getByRole('link', { name: /storage classes/i }); const rookBtn = sidebar.getByRole('button', { name: /rook/i });
await expect(storageClassesLink).toBeVisible({ timeout: 10_000 }); await rookBtn.click();
await storageClassesLink.click();
const storageClassesBtn = sidebar.getByRole('button', { name: /storage classes/i });
await storageClassesBtn.waitFor({ state: 'visible', timeout: 15_000 });
await storageClassesBtn.click();
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await expect(page).toHaveURL(/rook-ceph\/storage-classes/); await expect(page).toHaveURL(/rook-ceph\/storage-classes/);
await expect(page.getByRole('heading', { name: /storage class/i })).toBeVisible({ timeout: 15_000 }); await expect(page.getByRole('heading', { name: /storage class/i }).first()).toBeVisible({ timeout: 15_000 });
}); });
test('plugin settings page shows rook plugin entry', async ({ page }) => { test('plugin settings page shows rook plugin entry', async ({ page }) => {
await page.goto('/settings/plugins'); await page.goto('/settings/plugins');
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await page.waitForSelector('table, [class*="PluginList"], [class*="plugin"]', { timeout: 10_000 }).catch(() => {});
const pluginEntry = page.locator('text=rook').first(); const pluginEntry = page.locator('text=/rook/i').first();
await expect(pluginEntry).toBeVisible({ timeout: 30_000 }); await expect(pluginEntry).toBeVisible({ timeout: 30_000 });
}); });
}); });