diff --git a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/postfach-mail/postfach-nachrichten.cy.ts b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/postfach-mail/postfach-nachrichten.cy.ts index bdd036c582a27259769c9ea691ddbbce7e9225b8..7eed88e1044e9855d8411557f4f12a9f1035f705 100644 --- a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/postfach-mail/postfach-nachrichten.cy.ts +++ b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/postfach-mail/postfach-nachrichten.cy.ts @@ -40,18 +40,12 @@ import { deleteDownloadFolder, dropCollections, interceptWithResponse, - wait, } from '../../../support/cypress-helper'; import { exist, notExist } from '../../../support/cypress.util'; import { LinkRelE2E } from '../../../support/linkrels'; import { removeLinkFromResource } from '../../../support/tech.util'; import { initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; -import { - buildVorgang, - createVorgang, - initVorgaenge, - objectIds, -} from '../../../support/vorgang-util'; +import { buildVorgang, createVorgang, initVorgaenge, objectIds } from '../../../support/vorgang-util'; describe('Postfach Nachrichten', () => { const vorgangList: VorgangListE2EComponent = new MainPage().getVorgangList(); @@ -89,9 +83,7 @@ describe('Postfach Nachrichten', () => { }); function modifyResponse(req: CyHttpMessages.IncomingHttpRequest): void { - req.reply((res) => - res.send(removeLinkFromResource(res.body, LinkRelE2E.POSTFACH_NACHRICHTEN)), - ); + req.reply((res) => res.send(removeLinkFromResource(res.body, LinkRelE2E.POSTFACH_NACHRICHTEN))); } it('navigate to vorgangDetail', () => { @@ -116,25 +108,23 @@ describe('Postfach Nachrichten', () => { exist(postfachMailContainer.getDownloadButtonWithLabel()); }); - it( - 'should have 1 file in download folder after click on download', - { defaultCommandTimeout: 30000 }, - () => { - deleteDownloadFolder(); - postfachMailContainer.getDownloadButtonWithLabel().click(); - waitForSpinnerToDisappear(); - - countDownloadFiles().then((count) => { - expect(count).to.eq(1); - }); - }, - ); + it('should delete download folder and click download', { defaultCommandTimeout: 30000 }, () => { + deleteDownloadFolder(); + postfachMailContainer.getDownloadButtonWithLabel().click(); + waitForSpinnerToDisappear(); + }); + + it('should have 1 file in download folder', () => { + countDownloadFiles().then((count) => { + expect(count).to.eq(1); + }); + }); }); describe('by download button on nachrichten details page', () => { it('should show an overview of all nachrichten after clicking on nachricht', () => { postfachMailContainer.getList().click(); - wait(3000); + waitForSpinnerToDisappear(); exist(postfachMailPage.getRoot()); }); @@ -143,19 +133,17 @@ describe('Postfach Nachrichten', () => { exist(postfachMailPage.getDownloadButton()); }); - it( - 'should have 1 file in download folder after click on download', - { defaultCommandTimeout: 30000 }, - () => { - deleteDownloadFolder(); - postfachMailPage.getDownloadButton().click(); - wait(3000); - - countDownloadFiles().then((count) => { - expect(count).to.eq(1); - }); - }, - ); + it('should delete download folder and click download', { defaultCommandTimeout: 30000 }, () => { + deleteDownloadFolder(); + postfachMailPage.getDownloadButton().click(); + waitForSpinnerToDisappear(); + }); + + it('should have 1 file in download folder', () => { + countDownloadFiles().then((count) => { + expect(count).to.eq(1); + }); + }); }); }); });