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(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get("[data-cy=kerberos-card]").click(); cy.get("[data-testid=kerberos-card]").click();
providersPage.fillKerberosRequiredData( providersPage.fillKerberosRequiredData(
firstKerberosName, firstKerberosName,
@ -60,7 +60,7 @@ describe("User Fed Kerberos tests", () => {
loginPage.logIn(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
@ -81,7 +81,7 @@ describe("User Fed Kerberos tests", () => {
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.wait(1000); cy.wait(1000);
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
@ -95,7 +95,7 @@ describe("User Fed Kerberos tests", () => {
loginPage.logIn(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
@ -113,7 +113,7 @@ describe("User Fed Kerberos tests", () => {
providersPage.cancel(); providersPage.cancel();
cy.wait(1000); cy.wait(1000);
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
@ -133,7 +133,7 @@ describe("User Fed Kerberos tests", () => {
loginPage.logIn(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
@ -158,7 +158,7 @@ describe("User Fed Kerberos tests", () => {
loginPage.logIn(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
@ -196,8 +196,8 @@ describe("User Fed Kerberos tests", () => {
loginPage.logIn(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get('[data-cy="my-kerberos-2-dropdown"]').click(); cy.get('[data-testid="my-kerberos-2-dropdown"]').click();
cy.get('[data-cy="card-delete"]').click(); cy.get('[data-testid="card-delete"]').click();
modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); modalUtils.checkModalTitle(deleteModalTitle).confirmModal();
@ -209,13 +209,13 @@ describe("User Fed Kerberos tests", () => {
loginPage.logIn(); loginPage.logIn();
sidebarPage.goToUserFederation(); sidebarPage.goToUserFederation();
cy.get('[data-cy="keycloak-card-title"]') cy.get('[data-testid="keycloak-card-title"]')
.contains(firstKerberosName) .contains(firstKerberosName)
.click(); .click();
cy.wait(1000); cy.wait(1000);
cy.get('[data-testid="action-dropdown"]').click(); 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(); modalUtils.checkModalTitle(deleteModalTitle).confirmModal();

View file

@ -19,10 +19,10 @@ export default class CreateKerberosProviderPage {
cancelBtn: string; cancelBtn: string;
constructor() { constructor() {
this.kerberosNameInput = "data-cy=kerberos-name"; this.kerberosNameInput = "data-testid=kerberos-name";
this.kerberosRealmInput = "data-cy=kerberos-realm"; this.kerberosRealmInput = "data-testid=kerberos-realm";
this.kerberosPrincipalInput = "data-cy=kerberos-principal"; this.kerberosPrincipalInput = "data-testid=kerberos-principal";
this.kerberosKeytabInput = "data-cy=kerberos-keytab"; this.kerberosKeytabInput = "data-testid=kerberos-keytab";
this.kerberosEnabledInput = "#Kerberos-switch"; this.kerberosEnabledInput = "#Kerberos-switch";
@ -35,8 +35,8 @@ export default class CreateKerberosProviderPage {
this.kerberosCachePolicyInput = "#kc-cache-policy"; this.kerberosCachePolicyInput = "#kc-cache-policy";
this.kerberosCachePolicyList = "#kc-cache-policy + ul"; this.kerberosCachePolicyList = "#kc-cache-policy + ul";
this.saveBtn = "data-cy=kerberos-save"; this.saveBtn = "data-testid=kerberos-save";
this.cancelBtn = "data-cy=kerberos-cancel"; this.cancelBtn = "data-testid=kerberos-cancel";
} }
//#region Required Settings //#region Required Settings

View file

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

View file

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

View file

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

View file

@ -107,7 +107,7 @@ export const KerberosSettingsRequired = ({
message: `${t("validateName")}`, message: `${t("validateName")}`,
}, },
})} })}
data-cy="kerberos-name" data-testid="kerberos-name"
/> />
{form.errors.name && ( {form.errors.name && (
<div className="error">{form.errors.name.message}</div> <div className="error">{form.errors.name.message}</div>
@ -137,7 +137,7 @@ export const KerberosSettingsRequired = ({
message: `${t("validateRealm")}`, message: `${t("validateRealm")}`,
}, },
})} })}
data-cy="kerberos-realm" data-testid="kerberos-realm"
/> />
{form.errors.config && {form.errors.config &&
form.errors.config.kerberosRealm && form.errors.config.kerberosRealm &&
@ -171,7 +171,7 @@ export const KerberosSettingsRequired = ({
message: `${t("validateServerPrincipal")}`, message: `${t("validateServerPrincipal")}`,
}, },
})} })}
data-cy="kerberos-principal" data-testid="kerberos-principal"
/> />
{form.errors.config && {form.errors.config &&
form.errors.config.serverPrincipal && form.errors.config.serverPrincipal &&
@ -205,7 +205,7 @@ export const KerberosSettingsRequired = ({
message: `${t("validateKeyTab")}`, message: `${t("validateKeyTab")}`,
}, },
})} })}
data-cy="kerberos-keytab" data-testid="kerberos-keytab"
/> />
{form.errors.config && {form.errors.config &&
form.errors.config.keyTab && form.errors.config.keyTab &&

View file

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