From 0bd628a9562949b5fa416c344c7c932372c2ecf1 Mon Sep 17 00:00:00 2001 From: Sabin Panta <64484313+S-Panta@users.noreply.github.com> Date: Thu, 15 Jun 2023 14:32:34 +0545 Subject: [PATCH] scenerio added only for Deutsch and Spanish language (#6523) --- .../features/apiAntivirus/antivirus.feature | 21 ++++++++++++++++++- .../bootstrap/NotificationContext.php | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index a74dd31ddd..549f099884 100644 --- a/tests/acceptance/features/apiAntivirus/antivirus.feature +++ b/tests/acceptance/features/apiAntivirus/antivirus.feature @@ -293,4 +293,23 @@ Feature: antivirus | dav-path-version | | old | | new | - | spaces | \ No newline at end of file + | spaces | + + @issue-enterprise-5706 + Scenario Outline: upload a file with virus and get notification in different languages + Given user "Alice" has switched the system language to "" + And using DAV path + When user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/aFileWithVirus.txt" using the WebDAV API + Then the HTTP status code should be "201" + And user "Alice" should get a notification with subject "" and message: + | message | + | | + And as "Alice" file "/aFileWithVirus.txt" should not exist + Examples: + | dav-path-version | language | subject | message | + | old | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Win.Test.EICAR_HDB-1 | + | new | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Win.Test.EICAR_HDB-1 | + | spaces | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Win.Test.EICAR_HDB-1 | + | old | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 | + | new | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 | + | spaces | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 | diff --git a/tests/acceptance/features/bootstrap/NotificationContext.php b/tests/acceptance/features/bootstrap/NotificationContext.php index fda104f3e8..235371448b 100644 --- a/tests/acceptance/features/bootstrap/NotificationContext.php +++ b/tests/acceptance/features/bootstrap/NotificationContext.php @@ -202,7 +202,7 @@ class NotificationContext implements Context { public function userShouldGetANotificationWithMessage(string $user, string $subject, TableNode $table):void { $this->userListAllNotifications($user); $this->featureContext->theHTTPStatusCodeShouldBe(200); - $actualMessage = $this->filterResponseAccordingToNotificationSubject($subject)->message; + $actualMessage = str_replace(["\r", "\n"], " ", $this->filterResponseAccordingToNotificationSubject($subject)->message); $expectedMessage = $table->getColumnsHash()[0]['message']; Assert::assertSame( $expectedMessage,