Skip to content

Commit

Permalink
Merge pull request #39826 from owncloud/improve-then-steps-in-apiWebd…
Browse files Browse the repository at this point in the history
…avOperations

[tests-only][full-ci]Add then step to suite apiWebdavOperations
  • Loading branch information
phil-davis authored Feb 28, 2022
2 parents 9287840 + 7e5b2cf commit 554186c
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ Feature: delete folder
And user "Brian" should be able to delete folder "/Top"
Examples:
| dav_version | share_folder |
| old | /ReceivedShares |
| new | /ReceivedShares |
| old | ReceivedShares |
| old | /ReceivedShares |
| new | ReceivedShares |
| new | /ReceivedShares |

@files_sharing-app-required @notToImplementOnOCIS
Scenario Outline: delete a folder when there is a default folder for received shares that is a multi-level path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Feature: delete folder contents
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/FOLDER/fileToDelete.txt"
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/FOLDER/SUBFOLDER/textfile0.txt"
When user "Alice" deletes everything from folder "/FOLDER/" using the WebDAV API
Then user "Alice" should see the following elements
Then the HTTP status code should be "204"
And user "Alice" should see the following elements
| /FOLDER/ |
| /PARENT/ |
| /textfile0.txt |
Expand Down
53 changes: 32 additions & 21 deletions tests/acceptance/features/apiWebdavOperations/downloadFile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Feature: download file
Scenario Outline: download a file
Given using <dav_version> DAV path
When user "Alice" downloads file "/textfile0.txt" using the WebDAV API
Then the downloaded content should be "ownCloud test text file 0"
Then the HTTP status code should be "200"
And the downloaded content should be "ownCloud test text file 0"
Examples:
| dav_version |
| old |
Expand All @@ -28,7 +29,8 @@ Feature: download file
Scenario Outline: download a file with range
Given using <dav_version> DAV path
When user "Alice" downloads file "/welcome.txt" with range "bytes=24-50" using the WebDAV API
Then the downloaded content should be "example file for developers"
Then the HTTP status code should be "206"
And the downloaded content should be "example file for developers"
Examples:
| dav_version |
| old |
Expand All @@ -44,7 +46,8 @@ Feature: download file
Given using <dav_version> DAV path
And user "Alice" has uploaded file "/file9000000.txt" ending with "text at end of file" of size 9000000 bytes
When user "Alice" downloads file "/file9000000.txt" using the WebDAV API
Then the size of the downloaded file should be 9000000 bytes
Then the HTTP status code should be "200"
And the size of the downloaded file should be 9000000 bytes
And the downloaded content should end with "text at end of file"
Examples:
| dav_version |
Expand All @@ -60,7 +63,8 @@ Feature: download file
Scenario Outline: Downloading a file should serve security headers
Given using <dav_version> DAV path
When user "Alice" downloads file "/welcome.txt" using the WebDAV API
Then the following headers should be set
Then the HTTP status code should be "200"
And the following headers should be set
| header | value |
| Content-Disposition | attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt" |
| Content-Security-Policy | default-src 'none'; |
Expand All @@ -81,8 +85,8 @@ Feature: download file
Given using <dav_version> DAV path
And user "Alice" has logged in to a web-style session
When the client sends a "GET" to "/remote.php/dav/files/%username%/welcome.txt" of user "Alice" without requesttoken
Then the downloaded content should start with "Welcome"
And the HTTP status code should be "200"
Then the HTTP status code should be "200"
And the downloaded content should start with "Welcome"
Examples:
| dav_version |
| old |
Expand All @@ -93,8 +97,8 @@ Feature: download file
Given using <dav_version> DAV path
And user "Alice" has logged in to a web-style session
When the client sends a "GET" to "/remote.php/dav/files/%username%/welcome.txt" of user "Alice" with requesttoken
Then the downloaded content should start with "Welcome"
And the HTTP status code should be "200"
Then the HTTP status code should be "200"
And the downloaded content should start with "Welcome"
Examples:
| dav_version |
| old |
Expand Down Expand Up @@ -123,7 +127,8 @@ Feature: download file
Given using <dav_version> DAV path
And user "Alice" has uploaded file "filesForUpload/simple.pdf" to "/simple.pdf"
When user "Alice" downloads file "/simple.pdf" using the WebDAV API
Then the following headers should be set
Then the HTTP status code should be "200"
And the following headers should be set
| header | value |
| Content-Length | 9622 |
Examples:
Expand All @@ -141,7 +146,8 @@ Feature: download file
Given using <dav_version> DAV path
And user "Alice" has uploaded file "filesForUpload/testavatar.png" to "/testavatar.png"
When user "Alice" downloads file "/testavatar.png" using the WebDAV API
Then the following headers should be set
Then the HTTP status code should be "200"
And the following headers should be set
| header | value |
| Content-Length | 35323 |
Examples:
Expand All @@ -159,7 +165,8 @@ Feature: download file
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "file with comma in filename" to <filename>
When user "Alice" downloads file <filename> using the WebDAV API
Then the downloaded content should be "file with comma in filename"
Then the HTTP status code should be "200"
And the downloaded content should be "file with comma in filename"
Examples:
| dav_version | filename |
| old | "sample,1.txt" |
Expand Down Expand Up @@ -275,19 +282,22 @@ Feature: download file
| spaces |


Scenario Outline: download a hidden file
Scenario Outline: download hidden files
Given using <dav_version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has uploaded the following files with content "hidden file"
| path |
| .hidden_file |
| /FOLDER/.hidden_file |
When user "Alice" downloads file ".hidden_file" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "hidden file"
When user "Alice" downloads file "./FOLDER/.hidden_file" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "hidden file"
When user "Alice" downloads the following files using the WebDAV API
| path |
| .hidden_file |
| /FOLDER/.hidden_file |
Then the HTTP status code of responses on all endpoints should be "200"
And the content of the following files for user "Alice" should be "hidden file"
| path |
| .hidden_file |
| /FOLDER/.hidden_file |
Examples:
| dav_version |
| old |
Expand All @@ -302,7 +312,8 @@ Feature: download file
Scenario Outline: Downloading a file should serve security headers
Given using <dav_version> DAV path
When user "Alice" downloads file "/welcome.txt" using the WebDAV API
Then the following headers should be set
Then the HTTP status code should be "200"
And the following headers should be set
| header | value |
| Content-Disposition | attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt" |
| Content-Security-Policy | default-src 'none'; |
Expand All @@ -327,5 +338,5 @@ Feature: download file
Scenario: download a zero byte size file
Given user "Alice" has uploaded file "filesForUpload/zerobyte.txt" to "/zerobyte.txt"
When user "Alice" downloads file "/zerobyte.txt" using the WebDAV API
Then the size of the downloaded file should be 0 bytes
And the HTTP status code should be "200"
Then the HTTP status code should be "200"
And the size of the downloaded file should be 0 bytes
Loading

0 comments on commit 554186c

Please sign in to comment.