e2e fixes

This commit is contained in:
Richard Cox 2024-12-17 18:08:20 +00:00
parent 3844e8f468
commit 4ddf08a94b
8 changed files with 10 additions and 17 deletions

View File

@ -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): {} { 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); const fakeNavClusterData = generateFakeNavClusterData(fakeProvClusterId, fakeMgmtClusterId, addEditClusterCapabilities);
// add cluster to fleet clusters for testing https://github.com/rancher/dashboard/issues/9984 // add cluster to fleet clusters for testing https://github.com/rancher/dashboard/issues/9984

View File

@ -57,7 +57,7 @@ export default class ClusterDashboardPagePo extends PagePo {
} }
fullEventsLink() { fullEventsLink() {
return cy.get('.events-table-link').contains('Full events list'); return cy.get('[data-testid="events-link"]').contains('Full events list');
} }
fullSecretsList() { fullSecretsList() {

View File

@ -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 ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po';
import { generateFakeClusterDataAndIntercepts } from '@/cypress/e2e/blueprints/nav/fake-cluster'; 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 fakeProvClusterId = 'some-fake-cluster-id';
const fakeMgmtClusterId = 'some-fake-mgmt-id'; const fakeMgmtClusterId = 'some-fake-mgmt-id';

View File

@ -48,7 +48,7 @@ describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer', '@admi
clusterDashboard.waitForPage(undefined, 'cluster-events'); 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'); 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'] }, () => { 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(); eventsNoDataset();
clusterDashboard.goTo(); 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'); cy.wait('@eventsNoData');
clusterDashboard.waitForPage(undefined, 'cluster-events'); clusterDashboard.waitForPage(undefined, 'cluster-events');

View File

@ -9,7 +9,7 @@ import { ResourceListComponentName } from './resource-list.config';
import { PanelLocation, ExtensionPoint } from '@shell/core/types'; import { PanelLocation, ExtensionPoint } from '@shell/core/types';
import ExtensionPanel from '@shell/components/ExtensionPanel'; import ExtensionPanel from '@shell/components/ExtensionPanel';
import { sameContents } from '@shell/utils/array'; 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 { export default {
name: ResourceListComponentName, name: ResourceListComponentName,

View File

@ -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 is an object. This is broken in non-SSP world anyway (won't sort on object, filtering on `$[x][y]` paths are broken )
...SELECTOR, ...SELECTOR,
sort: 'false', sort: false,
search: 'false', search: false,
}, },
{ {
...SPEC_TYPE, ...SPEC_TYPE,

View File

@ -101,6 +101,7 @@ export default {
> >
<template v-slot:header-right> <template v-slot:header-right>
<router-link <router-link
data-testid="events-link"
:to="allEventsLink" :to="allEventsLink"
class="events-link" class="events-link"
> >

View File

@ -148,6 +148,7 @@ export default {
clusterCounts, clusterCounts,
selectedTab: 'cluster-events', selectedTab: 'cluster-events',
extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route), extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route),
canViewEvents: !!this.$store.getters['cluster/schemaFor'](EVENT)
}; };
}, },
@ -737,6 +738,7 @@ export default {
<div class="mt-30"> <div class="mt-30">
<Tabbed @changed="tabChange"> <Tabbed @changed="tabChange">
<Tab <Tab
v-if="canViewEvents"
name="cluster-events" name="cluster-events"
:label="t('clusterIndexPage.sections.events.label')" :label="t('clusterIndexPage.sections.events.label')"
:weight="2" :weight="2"