fix(e2e): expand storage classes sidebar nav and relax plugin settings locator
The 'Storage Classes' link is nested under the Rook sidebar button, not at the top level. Expand the Rook section before asserting visibility. Also uses /rook/i case-insensitive regex and waits for the plugins list to render before searching.
This commit is contained in:
committed by
Gandalf the Greybeard [agent]
parent
15d161c312
commit
61df61c691
+7
-2
@@ -42,8 +42,12 @@ 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');
|
||||||
|
|
||||||
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
|
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
|
||||||
|
|
||||||
|
const rookBtn = sidebar.getByRole('button', { name: /rook/i });
|
||||||
|
await rookBtn.click();
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
const storageClassesLink = sidebar.getByRole('link', { name: /storage classes/i });
|
const storageClassesLink = sidebar.getByRole('link', { name: /storage classes/i });
|
||||||
await expect(storageClassesLink).toBeVisible({ timeout: 10_000 });
|
await expect(storageClassesLink).toBeVisible({ timeout: 10_000 });
|
||||||
await storageClassesLink.click();
|
await storageClassesLink.click();
|
||||||
@@ -56,8 +60,9 @@ test.describe('Rook plugin smoke tests', () => {
|
|||||||
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('[class*="PluginList"], [class*="plugins"], table, list', { 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 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user