From 3256f2fc3be4878822dcf8ee297594ff829ade20 Mon Sep 17 00:00:00 2001 From: Cody Jackson Date: Sun, 9 Jun 2024 08:43:33 -0700 Subject: [PATCH] Fixing an azuread test where the wrong auth provider is being selected It appears that there are 2 less providers being used now. Is this a backend issue? --- .../create/cluster-create.po.ts | 4 ---- cypress/e2e/po/pages/users-and-auth/authProvider.po.ts | 2 +- cypress/e2e/tests/pages/manager/cluster-manager.spec.ts | 2 +- shell/components/SelectIconGrid.vue | 2 +- shell/edit/provisioning.cattle.io.cluster/index.vue | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create.po.ts b/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create.po.ts index b7052b6b919..fe5b7759b6f 100644 --- a/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create.po.ts +++ b/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create.po.ts @@ -37,10 +37,6 @@ export default class ClusterManagerCreatePagePo extends ClusterManagerCreateImpo this.self().find('.toggle-container').should(assertion); } - gridElementExistance(groupIndex = 0, itemIndex = 0, assertion: string) { - this.self().find(`[data-testid="cluster-manager-create-grid-${ groupIndex }-${ itemIndex }"]`).should(assertion); - } - gridElementExistanceByName(name: string, assertion: string) { return this.self().contains('.grid .name', name, { timeout: 10000 }).should(assertion); } diff --git a/cypress/e2e/po/pages/users-and-auth/authProvider.po.ts b/cypress/e2e/po/pages/users-and-auth/authProvider.po.ts index 3ffec765091..0e8f1636194 100644 --- a/cypress/e2e/po/pages/users-and-auth/authProvider.po.ts +++ b/cypress/e2e/po/pages/users-and-auth/authProvider.po.ts @@ -27,6 +27,6 @@ export default class AuthProviderPo extends PagePo { } selectAzureAd() { - return this.self().find('[data-testid="select-icon-grid-3"]').click(); + return this.self().find('[data-testid="select-icon-grid-AzureAD"]').click(); } } diff --git a/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts b/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts index 92b10b1ece7..492328902cb 100644 --- a/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts +++ b/cypress/e2e/tests/pages/manager/cluster-manager.spec.ts @@ -73,7 +73,7 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs // seems like the waitForPage does await for full DOM render, so let's wait for a simple assertion // like "gridElementExists" to make sure we aren't creating a fake assertion with the toggle - clusterCreate.gridElementExistance(0, 0, 'exist'); + clusterCreate.gridElementExistanceByName('Linode', 'exist'); clusterCreate.rkeToggleExistance('not.exist'); const sideNav = new ProductNavPo(); diff --git a/shell/components/SelectIconGrid.vue b/shell/components/SelectIconGrid.vue index d78803a2168..ade26ceae7e 100644 --- a/shell/components/SelectIconGrid.vue +++ b/shell/components/SelectIconGrid.vue @@ -106,7 +106,7 @@ export default { :target="get(r, targetField)" :rel="rel" class="item" - :data-testid="componentTestid + '-' + idx" + :data-testid="componentTestid + '-' + get(r, nameField)" :class="{ 'has-description': !!get(r, descriptionField), 'has-side-label': !!get(r, sideLabelField), [colorFor(r, idx)]: true, disabled: get(r, disabledField) === true diff --git a/shell/edit/provisioning.cattle.io.cluster/index.vue b/shell/edit/provisioning.cattle.io.cluster/index.vue index 273c2585c60..d622ac3dbba 100644 --- a/shell/edit/provisioning.cattle.io.cluster/index.vue +++ b/shell/edit/provisioning.cattle.io.cluster/index.vue @@ -627,7 +627,7 @@ export default { name-field="label" side-label-field="tag" :color-for="colorFor" - :component-testid="'cluster-manager-create-grid-' + i" + component-testid="cluster-manager-create-grid" @clicked="clickedType" />