diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 2b63ad7e5c..0631ee4066 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -205,6 +205,7 @@ default: - FilesVersionsContext: - SettingsContext: - OcisConfigContext: + - PublicWebDavContext: extensions: rdx\behatvars\BehatVariablesExtension: ~ diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index 01d36c53f1..d8e0266a74 100644 --- a/tests/acceptance/features/apiAntivirus/antivirus.feature +++ b/tests/acceptance/features/apiAntivirus/antivirus.feature @@ -4,7 +4,6 @@ Feature: antivirus I want to protect myself and others from known viruses So that I can prevent files with viruses from being uploaded - Background: Given user "Alice" has been created with default attributes and without skeleton files @@ -26,6 +25,7 @@ Feature: antivirus | new | | spaces | + Scenario Outline: upload a file with virus Given using DAV path When user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/aFileWithVirus.txt" using the WebDAV API @@ -84,3 +84,46 @@ Feature: antivirus | dav-path-version | | old | | spaces | + + + Scenario Outline: upload a file with the virus to a public share + Given using DAV path + And user "Alice" has created folder "/uploadFolder" + And user "Alice" has created a public link share with settings + | path | /uploadFolder | + | name | sharedlink | + | permissions | change | + | expireDate | 2040-01-01T23:59:59+0100 | + When user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt" using the WebDAV API + Then the HTTP status code should be "201" + And user "Alice" should get a notification with subject "Virus found" and message: + | message | + | Virus found in virusFile.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | + And as "Alice" file "/uploadFolder/virusFile.txt" should not exist + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + + Scenario Outline: upload a file with the virus to a password-protected public share + Given using DAV path + And user "Alice" has created folder "/uploadFolder" + And user "Alice" has created a public link share with settings + | path | /uploadFolder | + | name | sharedlink | + | permissions | change | + | password | newpasswd | + | expireDate | 2040-01-01T23:59:59+0100 | + When user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt" using the WebDAV API + Then the HTTP status code should be "201" + And user "Alice" should get a notification with subject "Virus found" and message: + | message | + | Virus found in virusFile.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | + And as "Alice" file "/uploadFolder/virusFile.txt" should not exist + Examples: + | dav-path-version | + | old | + | new | + | spaces |