Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions cypress/e2e/po/pages/home.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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=<n>` 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();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/po/pages/page.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Loading