Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions tests/tests/lightspeed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ const goToPodsList = async (page: Page, ns: string | null = null) => {
const goToPodDetails = async (page: Page, ns: string, podName: string) => {
await goToPodsList(page, ns);
await filterByName(page, podName);
const rows = page.locator(resourceRows);
await expect(async () => {
const count = await rows.count();
expect(count).toBeGreaterThanOrEqual(1);
expect(count).toBeLessThanOrEqual(4);
}).toPass({ timeout: 5_000 });
await page.locator('a.co-resource-item__resource-name').first().click();
const link = page.locator(resourceRows).filter({ hasText: podName });
await expect(link.first()).toBeVisible({ timeout: 30_000 });
await link.first().click();
Comment on lines +37 to +39

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Click the pod link element, not the row container.

On Line 37-39, link resolves to matching resource rows and the test clicks the row itself. That can still be flaky/non-navigational. Target the resource-name anchor within the filtered row and click that element explicitly.

Proposed fix
-  const link = page.locator(resourceRows).filter({ hasText: podName });
-  await expect(link.first()).toBeVisible({ timeout: 30_000 });
-  await link.first().click();
+  const row = page.locator(resourceRows).filter({ hasText: podName }).first();
+  const link = row.locator('a.co-resource-item__resource-name').first();
+  await expect(link).toBeVisible({ timeout: 30_000 });
+  await link.click();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const link = page.locator(resourceRows).filter({ hasText: podName });
await expect(link.first()).toBeVisible({ timeout: 30_000 });
await link.first().click();
const row = page.locator(resourceRows).filter({ hasText: podName }).first();
const link = row.locator('a.co-resource-item__resource-name').first();
await expect(link).toBeVisible({ timeout: 30_000 });
await link.click();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/tests/lightspeed.spec.ts` around lines 37 - 39, The test is currently
clicking on the resource row container itself (the result of
page.locator(resourceRows).filter({ hasText: podName })), which can lead to
flaky behavior. Instead of clicking link.first() directly, locate the
resource-name anchor element within the filtered row and click that specific
anchor element to ensure reliable navigation. This targets the actual clickable
link rather than the container row.

};

const popover = '[data-test="ols-plugin__popover"]';
Expand Down