change existing ids to data-testid

This commit is contained in:
mfrances 2021-02-19 16:22:05 -05:00
parent 65ea88383b
commit b5f7405fce
7 changed files with 31 additions and 31 deletions

View file

@ -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();

View file

@ -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

View file

@ -58,7 +58,7 @@ export const KeycloakCard = ({
<CardActions>
{dropdownItems && (
<Dropdown
data-cy={`${title}-dropdown`}
data-testid={`${title}-dropdown`}
isPlain
position={"right"}
toggle={<KebabToggle onToggle={onDropdownToggle} />}
@ -68,7 +68,7 @@ export const KeycloakCard = ({
/>
)}
</CardActions>
<CardTitle data-cy="keycloak-card-title">{title}</CardTitle>
<CardTitle data-testid="keycloak-card-title">{title}</CardTitle>
</CardHeader>
<CardBody />
<CardFooter>

View file

@ -60,7 +60,7 @@ const KerberosSettingsHeader = ({
<DropdownItem
key="delete"
onClick={() => toggleDeleteDialog()}
data-cy="delete-provider-cmd"
data-testid="delete-provider-cmd"
>
{t("deleteProvider")}
</DropdownItem>,
@ -174,13 +174,13 @@ export const UserFederationKerberosSettings = () => {
<SettingsCache form={form} showSectionHeading />
<Form onSubmit={form.handleSubmit(save)}>
<ActionGroup>
<Button variant="primary" type="submit" data-cy="kerberos-save">
<Button variant="primary" type="submit" data-testid="kerberos-save">
{t("common:save")}
</Button>
<Button
variant="link"
onClick={() => history.push(`/${realm}/user-federation`)}
data-cy="kerberos-cancel"
data-testid="kerberos-cancel"
>
{t("common:cancel")}
</Button>

View file

@ -113,7 +113,7 @@ export const UserFederationSection = () => {
onClick={() => {
toggleDeleteForCard(userFederation.id!);
}}
data-cy="card-delete"
data-testid="card-delete"
>
{t("common:delete")}
</DropdownItem>,
@ -179,7 +179,7 @@ export const UserFederationSection = () => {
<Card
isHoverable
onClick={() => history.push(`${url}/kerberos/new`)}
data-cy="kerberos-card"
data-testid="kerberos-card"
>
<CardTitle>
<Split hasGutter>

View file

@ -107,7 +107,7 @@ export const KerberosSettingsRequired = ({
message: `${t("validateName")}`,
},
})}
data-cy="kerberos-name"
data-testid="kerberos-name"
/>
{form.errors.name && (
<div className="error">{form.errors.name.message}</div>
@ -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 &&

View file

@ -126,7 +126,7 @@ export const SettingsCache = ({
}}
selections={value}
variant={SelectVariant.single}
data-cy="kerberos-cache-policy"
data-testid="kerberos-cache-policy"
>
<SelectOption key={0} value={["DEFAULT"]} isPlaceholder />
<SelectOption key={1} value={["EVICT_DAILY"]} />
@ -156,7 +156,7 @@ export const SettingsCache = ({
control={form.control}
render={({ onChange, value }) => (
<Select
data-cy="cache-day"
data-testid="cache-day"
toggleId="kc-eviction-day"
required
onToggle={() =>
@ -294,7 +294,7 @@ export const SettingsCache = ({
id="kc-max-lifespan"
name="config.maxLifespan[0]"
ref={form.register}
data-cy="kerberos-cache-lifespan"
data-testid="kerberos-cache-lifespan"
/>
</FormGroup>
) : (