Skip to content

Commit d803ecd

Browse files
committed
Update versions in chart test
Dashboard has no control over versions returned by the backend, so click on the first anchor tag in the versions list instead of specifying a specific version. Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
1 parent e0f731f commit d803ecd

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cypress/e2e/po/pages/explorer/charts/chart.po.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export class ChartPage extends PagePo {
4747
return new BannersPo('[data-testid="deprecation-and-experimental-banner"]', this.self());
4848
}
4949

50+
versions() {
51+
return this.self().find('.chart-content__right-bar__section--cVersion a');
52+
}
53+
5054
selectVersion(version: string) {
5155
return this.self().find('.chart-content__right-bar__section--cVersion').contains(version).click();
5256
}

cypress/e2e/tests/pages/explorer/apps/charts.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ describe('Apps/Charts', { tags: ['@explorer', '@adminUser'] }, () => {
112112
// Set up intercept for the network request triggered by $fetch
113113
cy.intercept('GET', '**/v1/catalog.cattle.io.clusterrepos/**').as('fetchChartDataAfterSelect');
114114

115-
chartPage.selectVersion('105.1.0+up4.10.0');
115+
chartPage.versions()
116+
.first()
117+
.then((firstVersion) => {
118+
chartPage.selectVersion(firstVersion.text());
116119

117-
cy.wait('@fetchChartDataAfterSelect').its('response.statusCode').should('eq', 200);
120+
cy.wait('@fetchChartDataAfterSelect').its('response.statusCode').should('eq', 200);
121+
});
118122
});
119123

120124
it('should not call fetch when navigating back to charts page', () => {

0 commit comments

Comments
 (0)