From 207b2dd59116ec7c2c7b32a6e30ebaa15049c7cb Mon Sep 17 00:00:00 2001 From: Marcelo Fukumoto Date: Wed, 5 Aug 2026 14:01:09 +0200 Subject: [PATCH] Added a regex check instead to better check older versions --- cypress/e2e/po/pages/home.po.ts | 8 +++++--- cypress/e2e/po/pages/page.po.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/po/pages/home.po.ts b/cypress/e2e/po/pages/home.po.ts index 38632395b2e..02ae55a1fb9 100644 --- a/cypress/e2e/po/pages/home.po.ts +++ b/cypress/e2e/po/pages/home.po.ts @@ -7,7 +7,6 @@ import HomeClusterListPo from '@/cypress/e2e/po/lists/home-cluster-list.po'; import BurgerMenuPo from '@/cypress/e2e/po/side-bars/burger-side-menu.po'; import NotificationsCenterPo from '@/cypress/e2e/po/components/notification-center.po'; import { MEDIUM_TIMEOUT_OPT } from '@/cypress/support/utils/timeouts'; -import { PAGINATION_UTILS } from '@/cypress/support/utils/shell'; const burgerMenu = new BurgerMenuPo(); @@ -22,9 +21,12 @@ export default class HomePagePo extends PagePo { // There's issues reporting when this page is ready, specifically for the user avatar click // To help with this be super sure the page is ready + // Match these calls whether or not the backend paginates them: newer Rancher adds + // `pagesize=` while older backends omit it. Using a regex fires the wait on the + // real request against both, keeping the readiness guard without pinning a version. PagePo.goToAndWaitForGet(HomePagePo.goTo, [ - `v1/counts?pagesize=${ PAGINATION_UTILS.defaultPageSize }&exclude=metadata.managedFields`, - `v1/namespaces?pagesize=${ PAGINATION_UTILS.defaultPageSize }&exclude=metadata.managedFields`, + /\/v1\/counts\?.*exclude=metadata\.managedFields/, + /\/v1\/namespaces\?.*exclude=metadata\.managedFields/, ]); const homePage = new HomePagePo(); diff --git a/cypress/e2e/po/pages/page.po.ts b/cypress/e2e/po/pages/page.po.ts index 688daa486c8..870d421c3bc 100644 --- a/cypress/e2e/po/pages/page.po.ts +++ b/cypress/e2e/po/pages/page.po.ts @@ -19,7 +19,7 @@ export default class PagePo extends ComponentPo { * If using this on a page with a specific cluster context it will make another counts request for counts for it (cluster/counts) * Note - If that cluster is the upstream one the request will be the same as management (v1/counts) */ - static goToAndWaitForGet(goTo: () => Cypress.Chainable, getUrls = [ + static goToAndWaitForGet(goTo: () => Cypress.Chainable, getUrls: (string | RegExp)[] = [ 'v1/counts', ], timeout = 10000) { getUrls.forEach((cUrl, i) => {