diff --git a/cypress/e2e/users_spec/user_manage.cy.ts b/cypress/e2e/users_spec/user_manage.cy.ts index 56ae429f740..347d573200a 100644 --- a/cypress/e2e/users_spec/user_manage.cy.ts +++ b/cypress/e2e/users_spec/user_manage.cy.ts @@ -38,7 +38,7 @@ describe("Manage User", () => { userPage.typeInSearchInput(usernameforworkinghour); userPage.checkUsernameText(usernameforworkinghour); manageUserPage.clicklinkedskillbutton(); - manageUserPage.selectFacilityFromDropdown(linkedskill); + manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); cy.wait(5000); @@ -59,7 +59,7 @@ describe("Manage User", () => { userPage.typeInSearchInput(usernametolinkskill); userPage.checkUsernameText(usernametolinkskill); manageUserPage.clicklinkedskillbutton(); - manageUserPage.selectFacilityFromDropdown(linkedskill); + manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); cy.wait(5000); // temporary hack to fix the failure @@ -67,7 +67,7 @@ describe("Manage User", () => { manageUserPage.assertSkillInAddedUserSkills(linkedskill); manageUserPage.clickUnlinkSkill(); manageUserPage.clickSubmit(); - manageUserPage.selectFacilityFromDropdown(linkedskill); + manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); // verifying the doctor connect @@ -104,6 +104,8 @@ describe("Manage User", () => { manageUserPage.clickFacilitiesTab(); manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); manageUserPage.clickLinkFacility(); + manageUserPage.clickCloseSlideOver(); + manageUserPage.clickFacilitiesTab(); manageUserPage.assertLinkedFacility(facilitytolinkusername); // Verify in the already linked facility are not present in droplist manageUserPage.assertFacilityNotInDropdown(facilitytolinkusername); diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index 8d0ec1077ed..b0b466e3f13 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -8,10 +8,13 @@ export class ManageUserPage { } selectFacilityFromDropdown(facilityName) { - cy.wait(2000); cy.searchAndSelectOption("input[name='facility']", facilityName); } + selectSkillFromDropdown(skill) { + cy.searchAndSelectOption("input[name='skill']", skill); + } + clickLinkFacility() { cy.get("#link-facility").click(); }