From b5f7405fce7211aaace70eb5ed69cf5c755629e5 Mon Sep 17 00:00:00 2001 From: mfrances Date: Fri, 19 Feb 2021 16:22:05 -0500 Subject: [PATCH 1/9] change existing ids to data-testid --- .../user_fed_kerberos_test.spec.ts | 22 +++++++++---------- .../providers/CreateKerberosProviderPage.ts | 12 +++++----- src/components/keycloak-card/KeycloakCard.tsx | 4 ++-- .../UserFederationKerberosSettings.tsx | 6 ++--- src/user-federation/UserFederationSection.tsx | 4 ++-- .../kerberos/KerberosSettingsRequired.tsx | 8 +++---- src/user-federation/shared/SettingsCache.tsx | 6 ++--- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/cypress/integration/user_fed_kerberos_test.spec.ts b/cypress/integration/user_fed_kerberos_test.spec.ts index cfaa34091f..c147136bf3 100644 --- a/cypress/integration/user_fed_kerberos_test.spec.ts +++ b/cypress/integration/user_fed_kerberos_test.spec.ts @@ -41,7 +41,7 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get("[data-cy=kerberos-card]").click(); + cy.get("[data-testid=kerberos-card]").click(); providersPage.fillKerberosRequiredData( firstKerberosName, @@ -60,7 +60,7 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); @@ -81,7 +81,7 @@ describe("User Fed Kerberos tests", () => { sidebarPage.goToUserFederation(); cy.wait(1000); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); @@ -95,7 +95,7 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); @@ -113,7 +113,7 @@ describe("User Fed Kerberos tests", () => { providersPage.cancel(); cy.wait(1000); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); @@ -133,7 +133,7 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); @@ -158,7 +158,7 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); @@ -196,8 +196,8 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get('[data-cy="my-kerberos-2-dropdown"]').click(); - cy.get('[data-cy="card-delete"]').click(); + cy.get('[data-testid="my-kerberos-2-dropdown"]').click(); + cy.get('[data-testid="card-delete"]').click(); modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); @@ -209,13 +209,13 @@ describe("User Fed Kerberos tests", () => { loginPage.logIn(); sidebarPage.goToUserFederation(); - cy.get('[data-cy="keycloak-card-title"]') + cy.get('[data-testid="keycloak-card-title"]') .contains(firstKerberosName) .click(); cy.wait(1000); cy.get('[data-testid="action-dropdown"]').click(); - cy.get('[data-cy="delete-provider-cmd"]').click(); + cy.get('[data-testid="delete-provider-cmd"]').click(); modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); diff --git a/cypress/support/pages/admin_console/manage/providers/CreateKerberosProviderPage.ts b/cypress/support/pages/admin_console/manage/providers/CreateKerberosProviderPage.ts index 32b8319aa1..251b76cea1 100644 --- a/cypress/support/pages/admin_console/manage/providers/CreateKerberosProviderPage.ts +++ b/cypress/support/pages/admin_console/manage/providers/CreateKerberosProviderPage.ts @@ -19,10 +19,10 @@ export default class CreateKerberosProviderPage { cancelBtn: string; constructor() { - this.kerberosNameInput = "data-cy=kerberos-name"; - this.kerberosRealmInput = "data-cy=kerberos-realm"; - this.kerberosPrincipalInput = "data-cy=kerberos-principal"; - this.kerberosKeytabInput = "data-cy=kerberos-keytab"; + this.kerberosNameInput = "data-testid=kerberos-name"; + this.kerberosRealmInput = "data-testid=kerberos-realm"; + this.kerberosPrincipalInput = "data-testid=kerberos-principal"; + this.kerberosKeytabInput = "data-testid=kerberos-keytab"; this.kerberosEnabledInput = "#Kerberos-switch"; @@ -35,8 +35,8 @@ export default class CreateKerberosProviderPage { this.kerberosCachePolicyInput = "#kc-cache-policy"; this.kerberosCachePolicyList = "#kc-cache-policy + ul"; - this.saveBtn = "data-cy=kerberos-save"; - this.cancelBtn = "data-cy=kerberos-cancel"; + this.saveBtn = "data-testid=kerberos-save"; + this.cancelBtn = "data-testid=kerberos-cancel"; } //#region Required Settings diff --git a/src/components/keycloak-card/KeycloakCard.tsx b/src/components/keycloak-card/KeycloakCard.tsx index 163869b592..93cc5aae48 100644 --- a/src/components/keycloak-card/KeycloakCard.tsx +++ b/src/components/keycloak-card/KeycloakCard.tsx @@ -58,7 +58,7 @@ export const KeycloakCard = ({ {dropdownItems && ( } @@ -68,7 +68,7 @@ export const KeycloakCard = ({ /> )} - {title} + {title} diff --git a/src/user-federation/UserFederationKerberosSettings.tsx b/src/user-federation/UserFederationKerberosSettings.tsx index 2ea8b81e8e..82877c8dbe 100644 --- a/src/user-federation/UserFederationKerberosSettings.tsx +++ b/src/user-federation/UserFederationKerberosSettings.tsx @@ -60,7 +60,7 @@ const KerberosSettingsHeader = ({ toggleDeleteDialog()} - data-cy="delete-provider-cmd" + data-testid="delete-provider-cmd" > {t("deleteProvider")} , @@ -174,13 +174,13 @@ export const UserFederationKerberosSettings = () => {
- diff --git a/src/user-federation/UserFederationSection.tsx b/src/user-federation/UserFederationSection.tsx index 3705c1b1f9..f8dd9f2019 100644 --- a/src/user-federation/UserFederationSection.tsx +++ b/src/user-federation/UserFederationSection.tsx @@ -113,7 +113,7 @@ export const UserFederationSection = () => { onClick={() => { toggleDeleteForCard(userFederation.id!); }} - data-cy="card-delete" + data-testid="card-delete" > {t("common:delete")} , @@ -179,7 +179,7 @@ export const UserFederationSection = () => { history.push(`${url}/kerberos/new`)} - data-cy="kerberos-card" + data-testid="kerberos-card" > diff --git a/src/user-federation/kerberos/KerberosSettingsRequired.tsx b/src/user-federation/kerberos/KerberosSettingsRequired.tsx index e53e6c0259..bbe0143bb7 100644 --- a/src/user-federation/kerberos/KerberosSettingsRequired.tsx +++ b/src/user-federation/kerberos/KerberosSettingsRequired.tsx @@ -107,7 +107,7 @@ export const KerberosSettingsRequired = ({ message: `${t("validateName")}`, }, })} - data-cy="kerberos-name" + data-testid="kerberos-name" /> {form.errors.name && (
{form.errors.name.message}
@@ -137,7 +137,7 @@ export const KerberosSettingsRequired = ({ message: `${t("validateRealm")}`, }, })} - data-cy="kerberos-realm" + data-testid="kerberos-realm" /> {form.errors.config && form.errors.config.kerberosRealm && @@ -171,7 +171,7 @@ export const KerberosSettingsRequired = ({ message: `${t("validateServerPrincipal")}`, }, })} - data-cy="kerberos-principal" + data-testid="kerberos-principal" /> {form.errors.config && form.errors.config.serverPrincipal && @@ -205,7 +205,7 @@ export const KerberosSettingsRequired = ({ message: `${t("validateKeyTab")}`, }, })} - data-cy="kerberos-keytab" + data-testid="kerberos-keytab" /> {form.errors.config && form.errors.config.keyTab && diff --git a/src/user-federation/shared/SettingsCache.tsx b/src/user-federation/shared/SettingsCache.tsx index 2e15db8d68..58d345874f 100644 --- a/src/user-federation/shared/SettingsCache.tsx +++ b/src/user-federation/shared/SettingsCache.tsx @@ -126,7 +126,7 @@ export const SettingsCache = ({ }} selections={value} variant={SelectVariant.single} - data-cy="kerberos-cache-policy" + data-testid="kerberos-cache-policy" > @@ -156,7 +156,7 @@ export const SettingsCache = ({ control={form.control} render={({ onChange, value }) => (