Skip to content
Snippets Groups Projects
Commit 347634f8 authored by OZGCloud's avatar OZGCloud
Browse files

E2E fix test

parent 5769850d
No related branches found
No related tags found
No related merge requests found
......@@ -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,
);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment