From 7697c354d5821afe9f33920517604490ee12893e Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Wed, 20 Nov 2024 12:07:17 +0545 Subject: [PATCH] merge similar test scenraios in antivirus test --- .../expected-failures-without-remotephp.md | 6 +- .../features/apiAntivirus/antivirus.feature | 119 ++---------------- 2 files changed, 11 insertions(+), 114 deletions(-) diff --git a/tests/acceptance/expected-failures-without-remotephp.md b/tests/acceptance/expected-failures-without-remotephp.md index 281c884fa..fdd7e7074 100644 --- a/tests/acceptance/expected-failures-without-remotephp.md +++ b/tests/acceptance/expected-failures-without-remotephp.md @@ -224,9 +224,9 @@ - [apiAntivirus/antivirus.feature:143](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L143) - [apiAntivirus/antivirus.feature:144](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L144) - [apiAntivirus/antivirus.feature:145](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L145) -- [apiAntivirus/antivirus.feature:402](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L402) -- [apiAntivirus/antivirus.feature:403](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L403) -- [apiAntivirus/antivirus.feature:404](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L404) +- [apiAntivirus/antivirus.feature:356](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L356) +- [apiAntivirus/antivirus.feature:357](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L357) +- [apiAntivirus/antivirus.feature:358](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L358) - [apiCollaboration/wopi.feature:956](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCollaboration/wopi.feature#L956) - [apiCollaboration/wopi.feature:957](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCollaboration/wopi.feature#L957) - [apiCollaboration/wopi.feature:958](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCollaboration/wopi.feature#L958) diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index 8e4f8de48..a82fd6b90 100644 --- a/tests/acceptance/features/apiAntivirus/antivirus.feature +++ b/tests/acceptance/features/apiAntivirus/antivirus.feature @@ -169,30 +169,8 @@ Feature: antivirus | old | eicar_com.zip | virusFile2.zip | | new | eicar.com | virusFile1.txt | | new | eicar_com.zip | virusFile2.zip | - - - Scenario Outline: upload a file with virus to a user share using spaces dav endpoint - Given using spaces DAV path - And user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "uploadFolder" - And user "Alice" has sent the following resource share invitation: - | resource | uploadFolder | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Editor | - And user "Brian" has a share "uploadFolder" synced - When user "Brian" uploads a file "filesForUpload/filesWithVirus/" to "/uploadFolder/" in space "Shares" using the WebDAV API - Then the HTTP status code should be "201" - And user "Brian" should get a notification with subject "Virus found" and message: - | message | - | Virus found in . Upload not possible. Virus: Win.Test.EICAR_HDB-1 | - And as "Brian" file "/Shares/uploadFolder/" should not exist - And as "Alice" file "/uploadFolder/" should not exist - Examples: - | file-name | new-file-name | - | eicar.com | virusFile1.txt | - | eicar_com.zip | virusFile2.zip | + | spaces | eicar.com | virusFile1.txt | + | spaces | eicar_com.zip | virusFile2.zip | Scenario Outline: upload a file with virus to a group share @@ -221,32 +199,8 @@ Feature: antivirus | old | eicar_com.zip | virusFile2.zip | | new | eicar.com | virusFile1.txt | | new | eicar_com.zip | virusFile2.zip | - - - Scenario Outline: upload a file with virus to a group share using spaces dav endpoint - Given using spaces DAV path - And user "Brian" has been created with default attributes and without skeleton files - And group "group1" has been created - And user "Brian" has been added to group "group1" - And user "Alice" has created folder "uploadFolder" - And user "Alice" has sent the following resource share invitation: - | resource | uploadFolder | - | space | Personal | - | sharee | group1 | - | shareType | group | - | permissionsRole | Editor | - And user "Brian" has a share "uploadFolder" synced - When user "Brian" uploads a file "filesForUpload/filesWithVirus/" to "/uploadFolder/" in space "Shares" using the WebDAV API - Then the HTTP status code should be "201" - And user "Brian" should get a notification with subject "Virus found" and message: - | message | - | Virus found in . Upload not possible. Virus: Win.Test.EICAR_HDB-1 | - And as "Brian" file "/Shares/uploadFolder/" should not exist - And as "Alice" file "/uploadFolder/" should not exist - Examples: - | file-name | new-file-name | - | eicar.com | virusFile1.txt | - | eicar_com.zip | virusFile2.zip | + | spaces | eicar.com | virusFile1.txt | + | spaces | eicar_com.zip | virusFile2.txt | Scenario Outline: upload a file with virus to a project space @@ -418,8 +372,8 @@ Feature: antivirus | shareType | group | | permissionsRole | File Editor | And user "Brian" has a share "test.txt" synced - When user "Brian" uploads file with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" to "test.txt" using the WebDAV API - Then the HTTP status code should be "201" + When user "Brian" uploads file with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" to "Shares/test.txt" using the WebDAV API + Then the HTTP status code should be "204" And user "Brian" should get a notification with subject "Virus found" and message: | message | | Virus found in test.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | @@ -429,29 +383,7 @@ Feature: antivirus | dav-path-version | | old | | new | - - - Scenario: try to overwrite a file with the virus content in group share using spaces dav endpoint - Given using spaces DAV path - And user "Brian" has been created with default attributes and without skeleton files - And group "group1" has been created - And user "Brian" has been added to group "group1" - And user "Alice" has been added to group "group1" - And user "Alice" has uploaded file with content "hello" to "/test.txt" - And user "Alice" has sent the following resource share invitation: - | resource | test.txt | - | space | Personal | - | sharee | group1 | - | shareType | group | - | permissionsRole | File Editor | - And user "Brian" has a share "test.txt" synced - When user "Brian" uploads a file "filesForUpload/filesWithVirus/eicar.com" to "/test.txt" in space "Shares" using the WebDAV API - Then the HTTP status code should be "204" - And user "Brian" should get a notification with subject "Virus found" and message: - | message | - | Virus found in test.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | - And for user "Brian" the content of the file "/test.txt" of the space "Shares" should be "hello" - And the content of file "/test.txt" for user "Alice" should be "hello" + | spaces | Scenario Outline: try to overwrite a file with the virus content in user share @@ -492,42 +424,7 @@ Feature: antivirus | dav-path-version | | old | | new | - - - Scenario: try to overwrite a file with the virus content in user share using spaces dav endpoint - Given using spaces DAV path - And user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "uploadFolder" - And user "Alice" has uploaded file with content "this is a test file." to "uploadFolder/test.txt" - And user "Alice" has sent the following resource share invitation: - | resource | uploadFolder | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Editor | - And user "Brian" has a share "uploadFolder" synced - And user "Alice" has uploaded file with content "this is a test file." to "/test.txt" - And user "Alice" has sent the following resource share invitation: - | resource | test.txt | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | File Editor | - And user "Brian" has a share "test.txt" synced - When user "Brian" uploads a file "filesForUpload/filesWithVirus/eicar.com" to "/uploadFolder/test.txt" in space "Shares" using the WebDAV API - Then the HTTP status code should be "204" - And user "Brian" should get a notification for resource "test.txt" with subject "Virus found" and message: - | message | - | Virus found in test.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | - And for user "Brian" the content of the file "/uploadFolder/test.txt" of the space "Shares" should be "this is a test file." - And the content of file "uploadFolder/test.txt" for user "Alice" should be "this is a test file." - When user "Brian" uploads a file "filesForUpload/filesWithVirus/eicar.com" to "/test.txt" in space "Shares" using the WebDAV API - Then the HTTP status code should be "204" - And user "Brian" should get a notification for resource "test.txt" with subject "Virus found" and message: - | message | - | Virus found in test.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | - And for user "Brian" the content of the file "/test.txt" of the space "Shares" should be "this is a test file." - And the content of file "/test.txt" for user "Alice" should be "this is a test file." + | spaces | Scenario: try to overwrite the .space/readme.md file