Skip to content

test(e2e): match home-page counts/namespaces waits with or without pagesize - #18658

Open
marcelofukumoto wants to merge 1 commit into
rancher:masterfrom
marcelofukumoto:fix-regex-regression-e2e-test
Open

test(e2e): match home-page counts/namespaces waits with or without pagesize#18658
marcelofukumoto wants to merge 1 commit into
rancher:masterfrom
marcelofukumoto:fix-regex-regression-e2e-test

Conversation

@marcelofukumoto

@marcelofukumoto marcelofukumoto commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

The Cypress home-page readiness helper (HomePagePo.goToAndWaitForGet) intercepts and
waits for the v1/counts and v1/namespaces requests with a hardcoded
pagesize=<defaultPageSize> query param:

v1/counts?pagesize=100000&exclude=metadata.managedFields
v1/namespaces?pagesize=100000&exclude=metadata.managedFields

That param is only sent when the dashboard uses server-side (sql-cache) pagination — i.e.
it depends on the dashboard build and the backend advertising pagination support. Against a
backend/UI that does not paginate those calls, the request is v1/counts?exclude=…
(no pagesize), so the intercept never matches and cy.wait('@getUrl0') times out after
10s. The result is a flaky/failing readiness wait when the specs run against a backend whose
UI doesn't send pagesize (e.g. an older release line), even though login and the page load
fine.

Occurred changes and/or fixed issues

  • HomePagePo.goToAndWaitForGet now matches these calls with a regex that fires the wait
    whether or not pagesize is present (and regardless of its value):
    /\/v1\/counts\?.*exclude=metadata\.managedFields/
    /\/v1\/namespaces\?.*exclude=metadata\.managedFields/
    
  • PagePo.goToAndWaitForGet signature widened from string[] to (string | RegExp)[] so
    regex matchers are accepted (backwards compatible — existing string callers are unaffected).
  • Removed the now-unused PAGINATION_UTILS import from home.po.ts.

Technical notes summary

  • The wait is still a genuine readiness guard: it waits for the actual counts / namespaces
    response before proceeding; it just no longer pins the exact URL shape.
  • It also stops being coupled to the PAGINATION_UTILS.defaultPageSize value, so a future
    change to the default page size won't silently break the wait.
  • No product code changes; test-infra only.

Areas or cases that should be tested

  • Any spec that starts on the home page via HomePagePo.goToAndWaitForGet (a large portion of
    the suite) — confirm the page-ready wait still passes on CI (paginated backend).
  • If available, confirm the same specs also pass against a backend/UI that does not send
    pagesize (older release line).

Areas which could experience regressions

  • Only the home-page readiness wait. The regex is scoped to the exact counts / namespaces
    collection calls (anchored on ?…exclude=metadata.managedFields), so it won't match
    unrelated requests.

Screenshot/Video

N/A — test-infrastructure change, no UI impact.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔄 Auto-Retry Failed Run

The Tests workflow failed for the commits below and has been automatically retried.
Follow up on a retried run through its link if needed.

Commit Workflow run Retried at
0da50e5 31003941754 2026-08-05 12:43 UTC
207b2dd 31007187854 2026-08-05 13:32 UTC

@richard-cox richard-cox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

master now tracks 2.16 and in this release pagination will always been enabled. this one would need to go into previous branches only. however those branches are fine and pass gates. i think we can leave this one

@marcelofukumoto

Copy link
Copy Markdown
Member Author

This was to fix the usage on the local environment usage of the Cypress.
If you run your e2e test from master in a rancher/dashboard that is not on master. It will fail.
Not sure if there is use case for that.
But if not, I can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants