Skip to content
Closed
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
6 changes: 6 additions & 0 deletions cypress/e2e/po/pages/fleet/fleet.cattle.io.cluster.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export class FleetClusterDetailsPo extends BaseDetailPagePo {
addAppButton() {
return this.self().get('.btn').contains('Create App Bundle');
}

hasClusterLabel(key: string, value: string) {
return this.self()
.find('.tag-data')
.contains(`${ key }: ${ value }`);
}
}

export class FleetClusterEditPo extends BaseDetailPagePo {
Expand Down
24 changes: 14 additions & 10 deletions cypress/e2e/tests/pages/fleet/fleet-clusters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { FleetClusterListPagePo, FleetClusterDetailsPo } from '@/cypress/e2e/po/
import ClusterManagerListPagePo from '@/cypress/e2e/po/pages/cluster-manager/cluster-manager-list.po';
import { MenuActions } from '@/cypress/support/types/menu-actions';
import { gitRepoTargetAllClustersRequest } from '@/cypress/e2e/blueprints/fleet/gitrepos';
import { FleetApplicationListPagePo, FleetGitRepoCreateEditPo, FleetApplicationCreatePo } from '~/cypress/e2e/po/pages/fleet/fleet.cattle.io.application.po';
import { FleetApplicationListPagePo, FleetGitRepoCreateEditPo, FleetApplicationCreatePo } from '@/cypress/e2e/po/pages/fleet/fleet.cattle.io.application.po';
import { WorkloadsDeploymentsListPagePo } from '@/cypress/e2e/po/pages/explorer/workloads/workloads-deployments.po';
import * as path from 'path';
import * as jsyaml from 'js-yaml';
import { HeaderPo } from '@/cypress/e2e/po/components/header.po';
import { LONG_TIMEOUT_OPT, MEDIUM_TIMEOUT_OPT, VERY_LONG_TIMEOUT_OPT } from '@/cypress/support/utils/timeouts';
import { EXTRA_LONG_TIMEOUT_OPT, LONG_TIMEOUT_OPT, MEDIUM_TIMEOUT_OPT, VERY_LONG_TIMEOUT_OPT } from '@/cypress/support/utils/timeouts';
import { FeatureFlagsPagePo } from '@/cypress/e2e/po/pages/global-settings/feature-flags.po';
import LoadingPo from '@/cypress/e2e/po/components/loading.po';
import { qase } from '@/cypress/support/qase';

const fleetClusterListPage = new FleetClusterListPagePo();
const fleetAppBundlesListPage = new FleetApplicationListPagePo();
Expand Down Expand Up @@ -81,7 +82,7 @@ describe('Fleet Clusters - bundle manifests are deployed from the BundleDeployme
cy.updateNamespaceFilter('local', 'none', '{"local":["all://user"]}');
});

it('data is populated in fleet cluster list and detail view', () => {
qase(9691, it('data is populated in fleet cluster list and detail view', () => {
ClusterManagerListPagePo.navTo();
clusterList.waitForPage();
clusterList.list().state(clusterName).contains('Active', VERY_LONG_TIMEOUT_OPT);
Expand All @@ -108,7 +109,7 @@ describe('Fleet Clusters - bundle manifests are deployed from the BundleDeployme
fleetClusterListPage.resourceTableDetails(clusterName, 2).should('be.visible');
// check cluster state in fleet
fleetClusterListPage.resourceTableDetails(clusterName, 1).contains('Not Ready', MEDIUM_TIMEOUT_OPT);
fleetClusterListPage.resourceTableDetails(clusterName, 1).contains('Active', LONG_TIMEOUT_OPT);
fleetClusterListPage.resourceTableDetails(clusterName, 1).contains('Active', EXTRA_LONG_TIMEOUT_OPT);
// check Git Repos ready
fleetClusterListPage.resourceTableDetails(clusterName, 3).should('have.text', '1');
// check Helm Ops ready
Expand All @@ -117,10 +118,6 @@ describe('Fleet Clusters - bundle manifests are deployed from the BundleDeployme
fleetClusterListPage.resourceTableDetails(clusterName, 5).should('have.text', '2');
// check resources: testing https://github.com/rancher/dashboard/issues/11154
fleetClusterListPage.resourceTableDetails(clusterName, 6).contains( ' 7 ', MEDIUM_TIMEOUT_OPT);
// check cluster labels
fleetClusterListPage.list().resourceTable().sortableTable()
.subRows()
.should('contain.text', 'foo=bar');

const fleetClusterDetailsPage = new FleetClusterDetailsPo(namespace, clusterName);

Expand All @@ -129,6 +126,9 @@ describe('Fleet Clusters - bundle manifests are deployed from the BundleDeployme
fleetClusterDetailsPage.waitForPage(null, 'applications');
fleetClusterDetailsPage.clusterTabs().clickTabWithSelector('[data-testid="btn-applications"]');

// check cluster labels
fleetClusterDetailsPage.hasClusterLabel('foo', 'bar').should('be.visible');

// check state
fleetClusterDetailsPage.appBundlesList().resourceTableDetails(gitRepo, 1).contains('Active');
// check name
Expand All @@ -140,8 +140,8 @@ describe('Fleet Clusters - bundle manifests are deployed from the BundleDeployme
// check target
fleetClusterDetailsPage.appBundlesList().resourceTableDetails(gitRepo, 5).contains('All');
// check cluster resources
fleetClusterDetailsPage.appBundlesList().resourceTableDetails(gitRepo, 7).should('have.text', ' 1 ');
});
fleetClusterDetailsPage.appBundlesList().resourceTableDetails(gitRepo, 7).should('contain.text', '');
}));

it('check all tabs are available in the details view', () => {
// testing https://github.com/rancher/dashboard/issues/11155
Expand Down Expand Up @@ -421,6 +421,10 @@ describe('Fleet CLuster List - resources', { tags: ['@fleet', '@adminUser'] }, (
});

it('should only display action menu with allowed actions only', () => {
// Ensure table is fully loaded before interacting with action menu
fleetClusterListPage.list().resourceTable().sortableTable().checkVisible();
fleetClusterListPage.list().resourceTable().sortableTable().checkLoadingIndicatorNotVisible();

const constActionMenu = fleetClusterListPage.list().resourceTable().sortableTable()
.rowActionMenuOpen('local');

Expand Down
2 changes: 2 additions & 0 deletions cypress/jenkins/cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ yarn add -W mocha cypress-mochawesome-reporter cypress-multi-reporters cypress-c

yarn add -W https://github.com/elaichenkov/cypress-delete-downloads-folder

yarn add -D @percy/cli

export NO_COLOR=1
export PERCY_CLIENT_ERROR_LOGS=false
CYPRESS_grepTags="CYPRESSTAGS" npx percy exec -- cypress run --browser chrome --config-file cypress/jenkins/cypress.config.jenkins.ts
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
"@aws-sdk/client-eks": "3.879.0",
"@aws-sdk/client-iam": "3.863.0",
"@aws-sdk/client-kms": "3.863.0",
"@smithy/fetch-http-handler": "5.1.1",
"@novnc/novnc": "1.2.0",
"@popperjs/core": "2.11.8",
"@rancher/icons": "2.0.55",
"@smithy/fetch-http-handler": "5.1.1",
"@vee-validate/zod": "4.15.0",
"ansi_up": "5.0.0",
"axios": "1.13.2",
Expand Down Expand Up @@ -155,7 +155,7 @@
"@cypress/grep": "3.1.5",
"@cypress/vue": "5.0.5",
"@cypress/webpack-dev-server": "3.4.1",
"@percy/cli": "1.31.8",
"@percy/cli": "1.31.11",
"@percy/cypress": "3.1.6",
"@types/copy-webpack-plugin": "5.0.3",
"@types/dompurify": "3.0.5",
Expand Down Expand Up @@ -223,4 +223,4 @@
"resolutions": {
"html-webpack-plugin": "5.0.0"
}
}
}
Loading
Loading