From 4b3eb4a9e4c9f560ea2d9ca565efbb29d0107bf7 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 30 Nov 2022 09:38:04 -0500 Subject: [PATCH] Fixed broken tests (#3895) --- .../manage/clients/CreateClientPage.ts | 4 ++-- .../manage/realm_settings/RealmSettingsPage.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/admin-ui/cypress/support/pages/admin_console/manage/clients/CreateClientPage.ts b/apps/admin-ui/cypress/support/pages/admin_console/manage/clients/CreateClientPage.ts index bb849ca84f..2d96c96415 100644 --- a/apps/admin-ui/cypress/support/pages/admin_console/manage/clients/CreateClientPage.ts +++ b/apps/admin-ui/cypress/support/pages/admin_console/manage/clients/CreateClientPage.ts @@ -28,7 +28,7 @@ export default class CreateClientPage extends CommonPage { private rootUrlInput = "#kc-root-url"; private homeUrlInput = "#kc-home-url"; private firstValidRedirectUrlInput = "redirectUris0"; - private firstWebOriginsInput = "#webOrigins0"; + private firstWebOriginsInput = "webOrigins0"; private adminUrlInput = "#kc-admin-url"; private loginThemeDrpDwn = "#loginTheme"; @@ -233,7 +233,7 @@ export default class CreateClientPage extends CommonPage { cy.get(this.rootUrlInput).should("not.be.disabled"); cy.get(this.homeUrlInput).should("not.be.disabled"); cy.findByTestId(this.firstValidRedirectUrlInput).should("not.be.disabled"); - cy.get(this.firstWebOriginsInput).should("not.be.disabled"); + cy.findByTestId(this.firstWebOriginsInput).should("not.be.disabled"); cy.get(this.adminUrlInput).should("not.be.disabled"); return this; diff --git a/apps/admin-ui/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts b/apps/admin-ui/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts index 2d7ff265c4..ce86578694 100644 --- a/apps/admin-ui/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts +++ b/apps/admin-ui/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts @@ -222,7 +222,7 @@ export default class RealmSettingsPage extends CommonPage { private eventListenersDrwDwnSelect = ".pf-c-button.pf-c-select__toggle-button.pf-m-plain"; private eventListenerRemove = '[data-ouia-component-id="Remove"]'; - private roleSelect = "#config\\.roles0"; + private roleSelect = "config.roles0"; private selectScopeButton = "addValue"; private deleteClientRolesConditionBtn = "delete-client-roles-condition"; private deleteClientScopesConditionBtn = "delete-client-scopes-condition"; @@ -1068,7 +1068,7 @@ export default class RealmSettingsPage extends CommonPage { cy.findByTestId(this.addConditionDrpDwnOption) .contains("client-roles") .click(); - cy.get(this.roleSelect).clear().type("manage-realm"); + cy.findByTestId(this.roleSelect).clear().type("manage-realm"); cy.findByTestId(this.addConditionSaveBtn).click(); cy.get(this.alertMessage).should( @@ -1079,11 +1079,11 @@ export default class RealmSettingsPage extends CommonPage { } addClientScopes() { - cy.get("#config\\.scopes0").clear().type("one"); + cy.findByTestId("config.scopes0").clear().type("one"); cy.findByTestId(this.selectScopeButton).click(); - cy.get("#config\\.scopes1").clear().type("two"); + cy.findByTestId("config.scopes1").clear().type("two"); cy.findByTestId(this.selectScopeButton).click(); - cy.get("#config\\.scopes2").clear().type("three"); + cy.findByTestId("config.scopes2").clear().type("three"); } shouldAddClientScopesCondition() { @@ -1109,8 +1109,8 @@ export default class RealmSettingsPage extends CommonPage { cy.findByTestId(this.clientRolesConditionLink).click(); - cy.get(this.roleSelect).should("have.value", "manage-realm"); - cy.get(this.roleSelect).clear().type("admin"); + cy.findByTestId(this.roleSelect).should("have.value", "manage-realm"); + cy.findByTestId(this.roleSelect).clear().type("admin"); cy.findByTestId(this.addConditionSaveBtn).click(); cy.get(this.alertMessage).should( @@ -1124,7 +1124,7 @@ export default class RealmSettingsPage extends CommonPage { cy.findByTestId(this.clientScopesConditionLink).click(); - cy.get("#config\\.scopes0").clear().type("edit"); + cy.findByTestId("config.scopes0").clear().type("edit"); cy.findByTestId(this.addConditionSaveBtn).click(); cy.get(this.alertMessage).should(