fix(e2e): stale sidebar locator in storage-classes test (PRI-699) #57

Closed
privilegedescalation-engineer[bot] wants to merge 5 commits from gandalf/fix-flaky-storage-class into main
privilegedescalation-engineer[bot] commented 2026-05-05 14:02:56 +00:00 (Migrated from github.com)

Summary

Fixes the flaky navigation to storage classes view works E2E test on PR #56.

Root cause

After clicking the Rook button in the sidebar, the test captured a sidebar reference before the page transition completed. The storageClassesLink locator was resolved against a stale sidebar state, causing the visibility assertion at line 52 to timeout.

Fix

  • Re-acquire sidebar reference after clicking Rook button (sidebarAfterClick)
  • Use waitFor({ state: 'visible' }) instead of expect().toBeVisible() for the storage-classes link — gives Playwright's locators time to re-resolve after DOM update

Testing

  • E2E run will validate the fix (targeting gandalf/e2e-fix as base)
  • CI must pass

References

cc @cpfarhood

## Summary Fixes the flaky `navigation to storage classes view works` E2E test on [PR #56](/privilegedescalation/headlamp-rook-plugin/pull/56). ## Root cause After clicking the Rook button in the sidebar, the test captured a sidebar reference before the page transition completed. The `storageClassesLink` locator was resolved against a stale sidebar state, causing the visibility assertion at line 52 to timeout. ## Fix - Re-acquire sidebar reference after clicking Rook button (`sidebarAfterClick`) - Use `waitFor({ state: 'visible' })` instead of `expect().toBeVisible()` for the storage-classes link — gives Playwright's locators time to re-resolve after DOM update ## Testing - E2E run will validate the fix (targeting `gandalf/e2e-fix` as base) - CI must pass ## References - Parent: [PRI-699](/PRI/issues/PRI-699) - Parent escalation: [PRI-697](/PRI/issues/PRI-697) cc @cpfarhood
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 14:03:03 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 17:44:03 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
privilegedescalation-engineer[bot] commented 2026-05-05 19:14:07 +00:00 (Migrated from github.com)

Closing — superseded by #61 (canonical E2E consolidation PR). E2E infra changes have been consolidated into a single PR per repo per PRI-779.

Closing — superseded by #61 (canonical E2E consolidation PR). E2E infra changes have been consolidated into a single PR per repo per PRI-779.

Pull request closed

Sign in to join this conversation.