Skip to content

Commit 6133c97

Browse files
committed
improve clusterLabels PO to avoid loose selector usage
1 parent d227647 commit 6133c97

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

cypress/e2e/po/pages/fleet/fleet.cattle.io.cluster.po.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ export class FleetClusterDetailsPo extends BaseDetailPagePo {
6666
return this.self().get('.btn').contains('Create App Bundle');
6767
}
6868

69-
clusterLabels(): Cypress.Chainable {
70-
return this.self().find('.tag-data');
69+
hasClusterLabel(key: string, value: string) {
70+
return this.self()
71+
.find('.tag-data')
72+
.contains(`${ key }: ${ value }`);
7173
}
7274
}
7375

cypress/e2e/tests/pages/fleet/fleet-clusters.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('Fleet Clusters - bundle manifests are deployed from the BundleDeployme
127127
fleetClusterDetailsPage.clusterTabs().clickTabWithSelector('[data-testid="btn-applications"]');
128128

129129
// check cluster labels
130-
fleetClusterDetailsPage.clusterLabels().contains('foo: bar').scrollIntoView().should('be.visible');
130+
fleetClusterDetailsPage.hasClusterLabel('foo', 'bar').should('be.visible');
131131

132132
// check state
133133
fleetClusterDetailsPage.appBundlesList().resourceTableDetails(gitRepo, 1).contains('Active');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"@cypress/grep": "3.1.5",
156156
"@cypress/vue": "5.0.5",
157157
"@cypress/webpack-dev-server": "3.4.1",
158-
"@percy/cli": "^1.31.11",
158+
"@percy/cli": "1.31.11",
159159
"@percy/cypress": "3.1.6",
160160
"@types/copy-webpack-plugin": "5.0.3",
161161
"@types/dompurify": "3.0.5",

0 commit comments

Comments
 (0)