diff --git a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/vorgang-anhang/vorgang-anhang-herunterladen.cy.ts b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/vorgang-anhang/vorgang-anhang-herunterladen.cy.ts index 5a6865e5a8a4793b7b9f8cc93410277c7889c7f5..f2dd9e0c5d7154ae951368e83bbc4011fd94003f 100644 --- a/alfa-client/apps/alfa-e2e/src/e2e/main-tests/vorgang-anhang/vorgang-anhang-herunterladen.cy.ts +++ b/alfa-client/apps/alfa-e2e/src/e2e/main-tests/vorgang-anhang/vorgang-anhang-herunterladen.cy.ts @@ -61,15 +61,17 @@ describe('Vorgang Anhänge', () => { const vorgangHeader: VorgangDetailHeaderE2EComponent = vorgangPage.getVorgangDetailHeader(); const subnavigation: VorgangSubnavigationE2EComponent = vorgangPage.getSubnavigation(); const attachmentContainer: AttachmentContainerE2EComponent = vorgangPage.getAttachmentContainer(); + const attachmentList: AttachmentListE2EComponent = new AttachmentListE2EComponent(); const formularDatenContainer: VorgangFormularDatenE2EComponent = vorgangPage.getFormularDatenContainer(); - const vorgangDatenFormular: VorgangFormularDatenE2EComponent = vorgangPage.getFormularDatenContainer(); const xmlRepresentation: FileDataE2E = createXmlRepresentation(); + const jpgAttachment: FileDataE2E = createJpgAttachment(); + const pdfAttachment: FileDataE2E = createPdfAttachment(); const sonstigeAttachment = { name: 'datei_sonstiges', - files: [createJpgAttachment(), createPdfAttachment()], + files: [jpgAttachment, pdfAttachment], }; const vorgangKeinAnhang: VorgangE2E = createVorgang(); @@ -97,6 +99,7 @@ describe('Vorgang Anhänge', () => { after(() => { dropCollections(); + deleteDownloadFolder(); }); describe('Download Attachment', () => { @@ -115,32 +118,32 @@ describe('Vorgang Anhänge', () => { }); it('should download jpg', () => { - const jpgAttachmentName: string = getJpgAttachment().name; - attachmentContainer.getList().getItem(jpgAttachmentName).getRoot().click(); + attachmentContainer.getList().getItem(jpgAttachment.name).getRoot().click(); waitForSpinnerToDisappear(); - exist(readFileFromDownloads(buildDownloadFileName(jpgAttachmentName))); + exist(readFileFromDownloads(buildDownloadFileName(jpgAttachment.name))); }); it('should download pdf', () => { - const pdfAttachmentName: string = getPdfAttachment().name; - attachmentContainer.getList().getItem(convertToDataTestId(pdfAttachmentName)).getRoot().click(); + attachmentContainer.getList().getItem(convertToDataTestId(pdfAttachment.name)).getRoot().click(); waitForSpinnerToDisappear(); - exist(readFileFromDownloads(buildDownloadFileName(pdfAttachmentName))); + exist(readFileFromDownloads(buildDownloadFileName(pdfAttachment.name))); }); it('should download attachment zip file', () => { - deleteDownloadFolder().then(() => { - attachmentList.downloadAttachments(); - }); + attachmentList.downloadAttachments(); + + waitForSpinnerToDisappear(); + + exist(readFileFromDownloads(`${vorgangAnhangVorhanden.nummer}_Anhaenge.zip`)); }); it('should unzip attachment file', () => { getDownloadFiles().then((files) => { unzipDownloadFile(files[0]).then(() => { countDownloadFiles().then((count) => { - expect(count).to.eq(3); + expect(count).to.eq(5); }); }); }); @@ -152,14 +155,6 @@ describe('Vorgang Anhänge', () => { exist(vorgangList.getRoot()); }); - - function getJpgAttachment(): FileDataE2E { - return sonstigeAttachment.files[1]; - } - - function getPdfAttachment(): FileDataE2E { - return sonstigeAttachment.files[0]; - } }); describe('Download Representation', () => {