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): {} {
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

View File

@ -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() {

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 { 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';

View File

@ -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');

View File

@ -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,

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,
sort: 'false',
search: 'false',
sort: false,
search: false,
},
{
...SPEC_TYPE,

View File

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

View File

@ -148,6 +148,7 @@ export default {
clusterCounts,
selectedTab: 'cluster-events',
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">
<Tabbed @changed="tabChange">
<Tab
v-if="canViewEvents"
name="cluster-events"
:label="t('clusterIndexPage.sections.events.label')"
:weight="2"