Skip to content

Commit

Permalink
Improved then step to apiWebdavOperations suite
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Feb 24, 2022
1 parent 8203cf2 commit 8f1841e
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 29 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
123 changes: 118 additions & 5 deletions tests/acceptance/features/apiWebdavOperations/listFiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: list files
| simple-folder/simple-folder1/simple-folder2/welcome.txt |


Scenario Outline: Get the list of resources in the root folder
Scenario Outline: Get the list of resources in the root folder with depth 0
Given using <dav_version> DAV path
When user "Alice" lists the resources in "/" with depth "0" using the WebDAV API
Then the HTTP status code should be "207"
Expand All @@ -37,6 +37,19 @@ Feature: list files
| simple-folder/textfile0.txt |
| simple-folder/simple-empty-folder |
| simple-folder/simple-folder1 |
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario Outline: Get the list of resources in the root folder with depth 1
Given using <dav_version> DAV path
When user "Alice" lists the resources in "/" with depth 1 using the WebDAV API
Then the HTTP status code should be "207"
And the last DAV response for user "Alice" should contain these nodes
Expand All @@ -50,6 +63,18 @@ Feature: list files
| simple-folder/textfile0.txt |
| simple-folder/simple-empty-folder |
| simple-folder/simple-folder1 |
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |

Scenario Outline: Get the list of resources in the root folder with depth infinity
Given using <dav_version> DAV path
When user "Alice" lists the resources in "/" with depth "infinity" using the WebDAV API
Then the HTTP status code should be "207"
And the last DAV response for user "Alice" should contain these nodes
Expand Down Expand Up @@ -77,7 +102,7 @@ Feature: list files
| spaces |


Scenario Outline: Get the list of resources in a folder
Scenario Outline: Get the list of resources in a folder with depth 0
Given using <dav_version> DAV path
When user "Alice" lists the resources in "/simple-folder" with depth "0" using the WebDAV API
Then the HTTP status code should be "207"
Expand All @@ -90,6 +115,19 @@ Feature: list files
| simple-folder/textfile0.txt |
| simple-folder/simple-empty-folder |
| simple-folder/simple-folder1 |
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario Outline: Get the list of resources in a folder with depth 1
Given using <dav_version> DAV path
When user "Alice" lists the resources in "/simple-folder" with depth 1 using the WebDAV API
Then the HTTP status code should be "207"
And the last DAV response for user "Alice" should contain these nodes
Expand All @@ -105,6 +143,19 @@ Feature: list files
| simple-folder/simple-folder1/welcome.txt |
| simple-folder/simple-folder1/simple-folder2/textfile0.txt |
| simple-folder/simple-folder1/simple-folder2/welcome.txt |
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario Outline: Get the list of resources in a folder with depth infinity
Given using <dav_version> DAV path
When user "Alice" lists the resources in "/simple-folder" with depth "infinity" using the WebDAV API
Then the HTTP status code should be "207"
And the last DAV response for user "Alice" should contain these nodes
Expand All @@ -128,7 +179,7 @@ Feature: list files
| spaces |


Scenario Outline: Get the list of resources in a folder shared through public link
Scenario Outline: Get the list of resources in a folder shared through public link with depth 0
Given using <dav_version> DAV path
And user "Alice" has created the following folders
| path |
Expand All @@ -149,6 +200,22 @@ Feature: list files
| /simple-folder1/simple-folder2/welcome.txt |
| /simple-folder1/simple-folder2/simple-folder3 |
| /simple-folder1/simple-folder2/simple-folder3/simple-folder4 |
@notToImplementOnOCIS @issue-ocis-2079
Examples:
| dav_version |
| old |

Examples:
| dav_version |
| new |

Scenario Outline: Get the list of resources in a folder shared through public link with depth 1
Given using <dav_version> DAV path
And user "Alice" has created the following folders
| path |
| /simple-folder/simple-folder1/simple-folder2/simple-folder3 |
| /simple-folder/simple-folder1/simple-folder2/simple-folder3/simple-folder4 |
And user "Alice" has created a public link share of folder "simple-folder"
When the public lists the resources in the last created public link with depth 1 using the WebDAV API
Then the HTTP status code should be "207"
And the last public link DAV response should contain these nodes
Expand All @@ -165,6 +232,22 @@ Feature: list files
| /simple-folder1/simple-folder2 |
| /simple-folder1/textfile0.txt |
| /simple-folder1/simple-folder2/simple-folder3/simple-folder4 |
@notToImplementOnOCIS @issue-ocis-2079
Examples:
| dav_version |
| old |

Examples:
| dav_version |
| new |

Scenario Outline: Get the list of resources in a folder shared through public link with depth infinity
Given using <dav_version> DAV path
And user "Alice" has created the following folders
| path |
| /simple-folder/simple-folder1/simple-folder2/simple-folder3 |
| /simple-folder/simple-folder1/simple-folder2/simple-folder3/simple-folder4 |
And user "Alice" has created a public link share of folder "simple-folder"
When the public lists the resources in the last created public link with depth infinity using the WebDAV API
Then the HTTP status code should be "207"
And the last public link DAV response should contain these nodes
Expand All @@ -190,8 +273,8 @@ Feature: list files
| new |


Scenario: Get the list of files in a folder in the trashbin
Given using new DAV path
Scenario Outline: Get the list of files in a folder in the trashbin with depth 0
Given using <dav_version> DAV path
And user "Alice" has deleted the following resources
| path |
| textfile0.txt |
Expand All @@ -210,6 +293,19 @@ Feature: list files
| simple-folder/simple-folder1/welcome.txt |
| simple-folder/simple-folder1/simple-folder2/textfile0.txt |
| simple-folder/simple-folder1/simple-folder2/welcome.txt |
Examples:
| dav_version |
| old |
| new |


Scenario Outline: Get the list of files in a folder in the trashbin with depth 1
Given using <dav_version> DAV path
And user "Alice" has deleted the following resources
| path |
| textfile0.txt |
| welcome.txt |
| simple-folder/ |
When user "Alice" lists the resources in the trashbin path "/" with depth 1 using the WebDAV API
Then the HTTP status code should be "207"
And the trashbin DAV response should contain these nodes
Expand All @@ -225,6 +321,19 @@ Feature: list files
| simple-folder/simple-folder1/welcome.txt |
| simple-folder/simple-folder1/simple-folder2/textfile0.txt |
| simple-folder/simple-folder1/simple-folder2/welcome.txt |
Examples:
| dav_version |
| old |
| new |


Scenario Outline: Get the list of files in a folder in the trashbin with depth infinity
Given using <dav_version> DAV path
And user "Alice" has deleted the following resources
| path |
| textfile0.txt |
| welcome.txt |
| simple-folder/ |
When user "Alice" lists the resources in the trashbin path "/" with depth infinity using the WebDAV API
Then the HTTP status code should be "207"
And the trashbin DAV response should contain these nodes
Expand All @@ -238,3 +347,7 @@ Feature: list files
| simple-folder/simple-folder1/welcome.txt |
| simple-folder/simple-folder1/simple-folder2/textfile0.txt |
| simple-folder/simple-folder1/simple-folder2/welcome.txt |
Examples:
| dav_version |
| old |
| new |
Loading

0 comments on commit 8f1841e

Please sign in to comment.