From 4ddf08a94b617df90e1ba66e4f3fb78cf24a8df3 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Tue, 17 Dec 2024 18:08:20 +0000 Subject: [PATCH] e2e fixes --- cypress/e2e/blueprints/nav/fake-cluster.ts | 2 +- .../e2e/po/pages/explorer/cluster-dashboard.po.ts | 2 +- .../tests/navigation/side-nav/main-side-menu.spec.ts | 2 +- .../explorer/dashboard/cluster-dashboard.spec.ts | 12 +----------- shell/components/ResourceList/index.vue | 2 +- shell/config/product/explorer.js | 4 ++-- shell/pages/c/_cluster/explorer/EventsTable.vue | 1 + shell/pages/c/_cluster/explorer/index.vue | 2 ++ 8 files changed, 10 insertions(+), 17 deletions(-) diff --git a/cypress/e2e/blueprints/nav/fake-cluster.ts b/cypress/e2e/blueprints/nav/fake-cluster.ts index 8391e69528..de9a85f57b 100644 --- a/cypress/e2e/blueprints/nav/fake-cluster.ts +++ b/cypress/e2e/blueprints/nav/fake-cluster.ts @@ -2474,7 +2474,7 @@ function generateFakeNavClusterData(provClusterId = 'some-prov-cluster-id', mgmt } export function generateFakeClusterDataAndIntercepts(fakeProvClusterId = 'some-prov-cluster-id', fakeMgmtClusterId = 'some-mgmt-cluster-id', addEditClusterCapabilities = false): {} { - const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-decription'; + const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-description'; const fakeNavClusterData = generateFakeNavClusterData(fakeProvClusterId, fakeMgmtClusterId, addEditClusterCapabilities); // add cluster to fleet clusters for testing https://github.com/rancher/dashboard/issues/9984 diff --git a/cypress/e2e/po/pages/explorer/cluster-dashboard.po.ts b/cypress/e2e/po/pages/explorer/cluster-dashboard.po.ts index 6eb0c38a2e..e3e6ad73d7 100644 --- a/cypress/e2e/po/pages/explorer/cluster-dashboard.po.ts +++ b/cypress/e2e/po/pages/explorer/cluster-dashboard.po.ts @@ -57,7 +57,7 @@ export default class ClusterDashboardPagePo extends PagePo { } fullEventsLink() { - return cy.get('.events-table-link').contains('Full events list'); + return cy.get('[data-testid="events-link"]').contains('Full events list'); } fullSecretsList() { diff --git a/cypress/e2e/tests/navigation/side-nav/main-side-menu.spec.ts b/cypress/e2e/tests/navigation/side-nav/main-side-menu.spec.ts index 560a43f17f..ffc0ca298a 100644 --- a/cypress/e2e/tests/navigation/side-nav/main-side-menu.spec.ts +++ b/cypress/e2e/tests/navigation/side-nav/main-side-menu.spec.ts @@ -4,7 +4,7 @@ import PagePo from '@/cypress/e2e/po/pages/page.po'; import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po'; import { generateFakeClusterDataAndIntercepts } from '@/cypress/e2e/blueprints/nav/fake-cluster'; -const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-decription'; +const longClusterDescription = 'this-is-some-really-really-really-really-really-really-long-description'; const fakeProvClusterId = 'some-fake-cluster-id'; const fakeMgmtClusterId = 'some-fake-mgmt-id'; diff --git a/cypress/e2e/tests/pages/explorer/dashboard/cluster-dashboard.spec.ts b/cypress/e2e/tests/pages/explorer/dashboard/cluster-dashboard.spec.ts index 739bb22bff..4607ef4b87 100644 --- a/cypress/e2e/tests/pages/explorer/dashboard/cluster-dashboard.spec.ts +++ b/cypress/e2e/tests/pages/explorer/dashboard/cluster-dashboard.spec.ts @@ -48,7 +48,7 @@ describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer', '@admi clusterDashboard.waitForPage(undefined, 'cluster-events'); - // check if burguer menu nav is highlighted correctly for local cluster + // check if burger menu nav is highlighted correctly for local cluster BurgerMenuPo.checkIfClusterMenuLinkIsHighlighted('local'); }); @@ -257,19 +257,9 @@ describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer', '@admi }); it('can view events table empty if no events', { tags: ['@vai', '@adminUser'] }, () => { - cy.visit(clusterDashboard.urlPath(), { - onBeforeLoad(win) { - cy.stub(win.console, 'error').as('consoleError'); - cy.stub(win.console, 'warn').as('consoleWarn'); - }, - }); - eventsNoDataset(); clusterDashboard.goTo(); - cy.get('@consoleError').should('not.be.called'); // See error lot - cy.get('@consoleWarn').should('not.be.called'); // See warning log (there will be some....) - cy.wait('@eventsNoData'); clusterDashboard.waitForPage(undefined, 'cluster-events'); diff --git a/shell/components/ResourceList/index.vue b/shell/components/ResourceList/index.vue index bc4c1f5126..62b59484c9 100644 --- a/shell/components/ResourceList/index.vue +++ b/shell/components/ResourceList/index.vue @@ -9,7 +9,7 @@ import { ResourceListComponentName } from './resource-list.config'; import { PanelLocation, ExtensionPoint } from '@shell/core/types'; import ExtensionPanel from '@shell/components/ExtensionPanel'; import { sameContents } from '@shell/utils/array'; -import { PAGINATED_RESOURCE_TABLE_NAME } from '@shell/components/PaginatedResourceTable.vue'; +// import { PAGINATED_RESOURCE_TABLE_NAME } from '@shell/components/PaginatedResourceTable.vue'; export default { name: ResourceListComponentName, diff --git a/shell/config/product/explorer.js b/shell/config/product/explorer.js index d6035b5290..11769b8f78 100644 --- a/shell/config/product/explorer.js +++ b/shell/config/product/explorer.js @@ -311,8 +311,8 @@ export function init(store) { { // Selector is an object. This is broken in non-SSP world anyway (won't sort on object, filtering on `$[x][y]` paths are broken ) ...SELECTOR, - sort: 'false', - search: 'false', + sort: false, + search: false, }, { ...SPEC_TYPE, diff --git a/shell/pages/c/_cluster/explorer/EventsTable.vue b/shell/pages/c/_cluster/explorer/EventsTable.vue index 4afbbd4b71..4b1b1a6af5 100644 --- a/shell/pages/c/_cluster/explorer/EventsTable.vue +++ b/shell/pages/c/_cluster/explorer/EventsTable.vue @@ -101,6 +101,7 @@ export default { >