From b24b875059d3ea2e9544ee4e2dc0648f69e43230 Mon Sep 17 00:00:00 2001 From: a-arias Date: Wed, 26 Nov 2025 17:56:07 -0700 Subject: [PATCH] add visual testing to cloud credentials and cluster manager --- .../e2e/tests/pages/manager/cloud-credential.spec.ts | 11 ++++++++++- .../e2e/tests/pages/manager/cluster-manager.spec.ts | 11 +++++++++++ cypress/globals.d.ts | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/tests/pages/manager/cloud-credential.spec.ts b/cypress/e2e/tests/pages/manager/cloud-credential.spec.ts index 76c560601ba..80b574cbad6 100644 --- a/cypress/e2e/tests/pages/manager/cloud-credential.spec.ts +++ b/cypress/e2e/tests/pages/manager/cloud-credential.spec.ts @@ -39,6 +39,7 @@ describe('Cloud Credential', { tags: ['@manager', '@adminUser'] }, () => { beforeEach(() => { cy.login(); + cy.changeRancherTheme(); HomePagePo.goTo(); // this is needed to ensure we have a valid authentication session }); @@ -54,6 +55,13 @@ describe('Cloud Credential', { tags: ['@manager', '@adminUser'] }, () => { cloudCredentialsPage.goTo(); cloudCredentialsPage.waitForPage(); cloudCredentialsPage.create(); + + // Ignoring the user profile picture + cy.hideElementBySelector('[data-testid="nav_header_showUserMenu"]'); + // Ignoring the side navbar counters + cy.hideElementBySelector("[data-testid='type-count']"); + // takes percy snapshot. + cy.percySnapshot('List of cloud credentials page'); cloudCredentialsPage.createEditCloudCreds().waitForPage(); cloudCredentialsPage.createEditCloudCreds().cloudServiceOptions().selectSubTypeByIndex(0).click(); cloudCredentialsPage.createEditCloudCreds().waitForPage('type=aws'); @@ -61,7 +69,8 @@ describe('Cloud Credential', { tags: ['@manager', '@adminUser'] }, () => { cloudCredentialsPage.createEditCloudCreds().accessKey().set(access); cloudCredentialsPage.createEditCloudCreds().secretKey().set(secret); cloudCredentialsPage.createEditCloudCreds().nameNsDescription().name().set(name); - + // takes percy snapshot. + cy.percySnapshot('Cluster credential creation page'); cloudCredentialsPage.createEditCloudCreds().nameNsDescription().name().value() .should('eq', name); diff --git a/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts b/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts index c2a7765cf68..f05f07a053d 100644 --- a/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts +++ b/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts @@ -46,6 +46,7 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs before(() => { cy.login(); + cy.changeRancherTheme(); }); // Revert commented out tests as part of https://github.com/rancher/dashboard/issues/15391 @@ -545,6 +546,16 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs const clusterList = new ClusterManagerListPagePo('_'); clusterList.waitForPage(); + + // Ignoring the user profile picture + cy.hideElementBySelector('[data-testid="nav_header_showUserMenu"]'); + // Ignoring the side navbar counters + cy.hideElementBySelector("[data-testid='type-count']"); + // Ignoring machine and age counters + cy.hideElementBySelector("[class='col-machine-summary-graph']"); + cy.hideElementBySelector("[class='col-live-date']"); + // takes percy snapshot. + cy.percySnapshot('Cluster manager Local cluster'); }); describe('Cluster Details Page and Tabs', () => { diff --git a/cypress/globals.d.ts b/cypress/globals.d.ts index 96f36339b29..4e52bdbde69 100644 --- a/cypress/globals.d.ts +++ b/cypress/globals.d.ts @@ -71,6 +71,7 @@ declare global { setupWebSocket: any; hideElementBySelector(text:string) :void; state(state: any): any; + changeRancherTheme(): Chainable; login(username?: string, password?: string, cacheSession?: boolean, skipNavigation?: boolean, acceptConfirmation?: string): Chainable; logout(): Chainable;