diff --git a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/user-profile/user-profile-icon-assign-unassign.cy.ts b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/user-profile/user-profile-icon-assign-unassign.cy.ts index c1c79e720ee8b57d483e70b000906259be6e79ed..fbcd2ba7850d363047117b9158bdbdec3e501e94 100644 --- a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/user-profile/user-profile-icon-assign-unassign.cy.ts +++ b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/user-profile/user-profile-icon-assign-unassign.cy.ts @@ -26,20 +26,11 @@ import { VorgangListItemE2EComponent } from '../../../components/vorgang/vorgang import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component'; import { UserE2E } from '../../../model/user'; import { VorgangE2E } from '../../../model/vorgang'; -import { - MainPage, - waitForSpinnerToDisappear, - waitforSpinnerToAppear, -} from '../../../page-objects/main.po'; +import { MainPage, waitForSpinnerToDisappear, waitforSpinnerToAppear } from '../../../page-objects/main.po'; import { VorgangPage } from '../../../page-objects/vorgang.po'; import { dropCollections, wait } from '../../../support/cypress-helper'; -import { enter, exist, haveText, notExist } from '../../../support/cypress.util'; -import { - getUserDorothea, - getUserSabine, - initUsermanagerUsers, - loginAsSabine, -} from '../../../support/user-util'; +import { enterWith, exist, haveText, notExist } from '../../../support/cypress.util'; +import { getUserDorothea, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { createVorgang, initVorgang } from '../../../support/vorgang-util'; describe('User Profile im ausgewählten Vorgang', () => { @@ -47,9 +38,7 @@ describe('User Profile im ausgewählten Vorgang', () => { const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList(); const vorgangPage: VorgangPage = new VorgangPage(); - const userProfileContainer: UserProfileE2EComponent = vorgangPage - .getVorgangDetailHeader() - .getUserContainer(); + const userProfileContainer: UserProfileE2EComponent = vorgangPage.getVorgangDetailHeader().getUserContainer(); const vorgang: VorgangE2E = createVorgang(); @@ -98,15 +87,16 @@ describe('User Profile im ausgewählten Vorgang', () => { describe('fill formular', () => { it('should show error on enter wrong input', () => { - userProfileContainer.getSearchContainer().getInput().clear().type('Clark Kent'); - enter(userProfileContainer.getSearchContainer().getInput()); + enterWith(userProfileContainer.getSearchContainer().getInput(), 'Clark Kent'); + cy.wait(1000); exist(userProfileContainer.getSearchContainer().getError()); exist(userProfileContainer.getIconContainer().getUnassignedIcon()); }); it('should show error on enter empty field', () => { - enter(userProfileContainer.getSearchContainer().getInput()); + enterWith(userProfileContainer.getSearchContainer().getInput(), 'Clark Kent', 500); + cy.wait(1000); exist(userProfileContainer.getSearchContainer().getError()); exist(userProfileContainer.getIconContainer().getUnassignedIcon()); @@ -138,11 +128,7 @@ describe('User Profile im ausgewählten Vorgang', () => { exist(vorgangList.getListItem(vorgang.name).getUserProfile().getRoot()); haveText( - vorgangList - .getListItem(vorgang.name) - .getUserProfile() - .getIconContainer() - .getAssignedIcon(), + vorgangList.getListItem(vorgang.name).getUserProfile().getIconContainer().getAssignedIcon(), userSabine.initials, ); }); @@ -168,10 +154,7 @@ describe('User Profile im ausgewählten Vorgang', () => { it('should hide formular', () => { userProfileContainer.getSearchContainer().getInput().clear().type(userDorothea.name); exist(userProfileContainer.getSearchContainer().getSearchOption(userDorothea.dataTestId)); - userProfileContainer - .getSearchContainer() - .getSearchOption(userDorothea.dataTestId) - .click(); + userProfileContainer.getSearchContainer().getSearchOption(userDorothea.dataTestId).click(); waitforSpinnerToAppear(); waitForSpinnerToDisappear(); @@ -184,10 +167,7 @@ describe('User Profile im ausgewählten Vorgang', () => { // WORKAROUND Hier muss aufs Verarbeiten im Backend gewartet werden - oder: wait(500) wait(500); exist(userProfileContainer.getIconContainer().getAssignedIcon()); - haveText( - userProfileContainer.getIconContainer().getAssignedIcon(), - userDorothea.initials, - ); + haveText(userProfileContainer.getIconContainer().getAssignedIcon(), userDorothea.initials); }); }); }); @@ -201,11 +181,7 @@ describe('User Profile im ausgewählten Vorgang', () => { exist(vorgangList.getListItem(vorgang.name).getUserProfile().getRoot()); haveText( - vorgangList - .getListItem(vorgang.name) - .getUserProfile() - .getIconContainer() - .getAssignedIcon(), + vorgangList.getListItem(vorgang.name).getUserProfile().getIconContainer().getAssignedIcon(), userDorothea.initials, ); });