From 09b9410baf78cc3ce77796b22330c37e6f3c8f74 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Mon, 23 Jan 2023 14:39:27 +0100
Subject: [PATCH] OZG-3262 fix e2e tests

---
 .../anhang-herunterladen.e2e-spec.ts               | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-anhang/anhang-herunterladen.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-anhang/anhang-herunterladen.e2e-spec.ts
index 7fd792af0f..d703beaa05 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-anhang/anhang-herunterladen.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-anhang/anhang-herunterladen.e2e-spec.ts
@@ -99,7 +99,7 @@ describe('Vorgang Anhänge', () => {
 			attachmentContainer.getList().getItem(jpgAttachmentName).getRoot().click();
 			waitForSpinnerToDisappear();
 
-			exist(readFileFromDownloads(jpgAttachmentName));
+			exist(readFileFromDownloads(buildDownloadFileName(jpgAttachmentName)));
 		})
 
 		it('should download pdf', () => {
@@ -107,7 +107,7 @@ describe('Vorgang Anhänge', () => {
 			attachmentContainer.getList().getItem(convertToDataTestId(pdfAttachmentName)).getRoot().click();
 			waitForSpinnerToDisappear();
 
-			exist(readFileFromDownloads(pdfAttachmentName));
+			exist(readFileFromDownloads(buildDownloadFileName(pdfAttachmentName)));
 		})
 
 		it('should navigate to vorganglist on back button', () => {
@@ -146,7 +146,7 @@ describe('Vorgang Anhänge', () => {
 			attachmentContainer.getList().getItem(xmlRepresentation.name).getRoot().click();
 			waitForSpinnerToDisappear();
 
-			exist(readFileFromDownloads(xmlRepresentation.name));
+			exist(readFileFromDownloads(buildDownloadFileName(xmlRepresentation.name)));
 		})
 
 		it('should navigate to vorganglist on back button', () => {
@@ -156,4 +156,12 @@ describe('Vorgang Anhänge', () => {
 			exist(vorgangList.getRoot());
 		})
 	})
+
+	function buildDownloadFileName(fileName: string): string{
+		return `${getFileNamePrefix()}_${fileName}`;
+	}
+
+	function getFileNamePrefix(): string {
+		return vorgangAnhangVorhanden.nummer;
+	}
 })
\ No newline at end of file
-- 
GitLab