From 07d1202d1c7462b7d495bb3b56447f45cd49315d Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 24 Mar 2022 10:11:35 +0100 Subject: [PATCH] use the listing page for searching fixing these (#2330) * use the listing page for searching fixing these * fixed text --- .../realm_settings_user_profile_tab.spec.ts | 2 +- .../manage/realm_settings/RealmSettingsPage.ts | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/cypress/integration/realm_settings_user_profile_tab.spec.ts b/cypress/integration/realm_settings_user_profile_tab.spec.ts index 839ecab09d..56a8356a39 100644 --- a/cypress/integration/realm_settings_user_profile_tab.spec.ts +++ b/cypress/integration/realm_settings_user_profile_tab.spec.ts @@ -43,7 +43,7 @@ describe("User profile tabs", () => { getUserProfileTab(); getAttributesTab(); clickCreateAttributeButton(); - cy.get("p").should("have.text", "Create attribute"); + cy.get("p").should("have.text", "Create a new attribute"); }); }); diff --git a/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts b/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts index af3d7f0c47..e845e58a44 100644 --- a/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts +++ b/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts @@ -180,8 +180,6 @@ export default class RealmSettingsPage { private createClientDrpDwn = ".pf-c-dropdown.pf-m-align-right"; private clientPolicyDrpDwn = '[data-testid="action-dropdown"] button'; private deleteclientPolicyDrpDwn = "deleteClientPolicyDropdown"; - private searchFld = "[id^=realm-settings][id$=profilesinput]"; - private searchFldPolicies = "[id^=realm-settings][id$=clientPoliciesinput]"; private clientProfileOne = 'a[href*="realm-settings/clientPolicies/Test/edit-profile"]'; private clientProfileTwo = @@ -617,9 +615,7 @@ export default class RealmSettingsPage { } shouldSearchClientProfile() { - cy.get(this.searchFld).click({ force: true }).type("Test").click(); - cy.get("table").should("be.visible").contains("td", "Test"); - cy.get(this.searchFld).click({ force: true }).clear(); + new ListingPage().searchItem("Test", false).itemExist("Test"); return this; } @@ -912,16 +908,12 @@ export default class RealmSettingsPage { } searchClientPolicy(name: string) { - cy.get(this.searchFldPolicies).click({ force: true }).type(name).click(); - cy.get("table").should("be.visible").contains("td", name); - cy.get(this.searchFldPolicies).click({ force: true }).clear(); + new ListingPage().searchItem(name, false).itemExist(name); return this; } searchClientProfile(name: string) { - cy.get(this.searchFld).click({ force: true }).type(name).click(); - cy.get("table").should("be.visible").contains("td", name); - cy.get(this.searchFld).click({ force: true }).clear(); + new ListingPage().searchItem(name, false).itemExist(name); return this; }