ApiTest. download files (#3809)
* add tests download file * added ability to download different versions of files * fix after review
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
@api @skipOnOcV10
|
||||
Feature: Download file in project space
|
||||
As a user, I want to be able to download files
|
||||
|
||||
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
|
||||
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
|
||||
|
||||
Background:
|
||||
Given these users have been created with default attributes and without skeleton files:
|
||||
| username |
|
||||
| Alice |
|
||||
| Brian |
|
||||
And the administrator has given "Alice" the role "Admin" using the settings api
|
||||
And user "Alice" has created a space "download file" with the default quota using the GraphApi
|
||||
And user "Alice" has uploaded a file inside space "download file" with content "some content" to "file.txt"
|
||||
|
||||
|
||||
Scenario: An user downloads a file in the project space
|
||||
When user "Alice" downloads the file "file.txt" of the space "download file" using the WebDAV API
|
||||
Then the HTTP status code should be "200"
|
||||
And the following headers should be set
|
||||
| header | value |
|
||||
| Content-Length | 12 |
|
||||
|
||||
|
||||
Scenario: An user downloads an old version of the file in the project space
|
||||
Given user "Alice" has uploaded a file inside space "download file" with content "new content" to "file.txt"
|
||||
And user "Alice" has uploaded a file inside space "download file" with content "newest content" to "file.txt"
|
||||
When user "Alice" downloads version of the file "file.txt" with the index "1" of the space "download file" using the WebDAV API
|
||||
Then the HTTP status code should be "200"
|
||||
And the following headers should be set
|
||||
| header | value |
|
||||
| Content-Length | 11 |
|
||||
When user "Alice" downloads version of the file "file.txt" with the index "2" of the space "download file" using the WebDAV API
|
||||
Then the HTTP status code should be "200"
|
||||
And the following headers should be set
|
||||
| header | value |
|
||||
| Content-Length | 12 |
|
||||
@@ -54,11 +54,11 @@ Feature: List and create spaces
|
||||
When user "Alice" creates a space "Project Mars" of type "project" with the default quota using the GraphApi
|
||||
Then the HTTP status code should be "201"
|
||||
And the json responded should contain a space "Project Mars" with these key and value pairs:
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| driveAlias | project/project-mars |
|
||||
| name | Project Mars |
|
||||
| quota@@@total | 1000000000 |
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| driveAlias | project/project-mars |
|
||||
| name | Project Mars |
|
||||
| quota@@@total | 1000000000 |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
|
||||
Scenario: An admin user can create a Space via the Graph API with certain quota
|
||||
@@ -66,25 +66,25 @@ Feature: List and create spaces
|
||||
When user "Alice" creates a space "Project Venus" of type "project" with quota "2000" using the GraphApi
|
||||
Then the HTTP status code should be "201"
|
||||
And the json responded should contain a space "Project Venus" with these key and value pairs:
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| name | Project Venus |
|
||||
| quota@@@total | 2000 |
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| name | Project Venus |
|
||||
| quota@@@total | 2000 |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
|
||||
Scenario: A user can list his personal space via multiple endpoints
|
||||
When user "Alice" lists all available spaces via the GraphApi with query "$filter=driveType eq 'personal'"
|
||||
Then the json responded should contain a space "Alice Hansen" owned by "Alice" with these key and value pairs:
|
||||
| key | value |
|
||||
| driveType | personal |
|
||||
| name | Alice Hansen |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
| owner@@@user@@@id | %user_id% |
|
||||
| key | value |
|
||||
| driveType | personal |
|
||||
| name | Alice Hansen |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
| owner@@@user@@@id | %user_id% |
|
||||
When user "Alice" looks up the single space "Alice Hansen" via the GraphApi by using its id
|
||||
Then the json responded should contain a space "Alice Hansen" with these key and value pairs:
|
||||
| key | value |
|
||||
| driveType | personal |
|
||||
| name | Alice Hansen |
|
||||
| key | value |
|
||||
| driveType | personal |
|
||||
| name | Alice Hansen |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
|
||||
Scenario: A user can list his created spaces via multiple endpoints
|
||||
@@ -92,17 +92,17 @@ Feature: List and create spaces
|
||||
When user "Alice" creates a space "Project Venus" of type "project" with quota "2000" using the GraphApi
|
||||
Then the HTTP status code should be "201"
|
||||
And the json responded should contain a space "Project Venus" with these key and value pairs:
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| driveAlias | project/project-venus |
|
||||
| name | Project Venus |
|
||||
| quota@@@total | 2000 |
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| driveAlias | project/project-venus |
|
||||
| name | Project Venus |
|
||||
| quota@@@total | 2000 |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
When user "Alice" looks up the single space "Project Venus" via the GraphApi by using its id
|
||||
Then the json responded should contain a space "Project Venus" with these key and value pairs:
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| driveAlias | project/project-venus |
|
||||
| name | Project Venus |
|
||||
| quota@@@total | 2000 |
|
||||
| key | value |
|
||||
| driveType | project |
|
||||
| driveAlias | project/project-venus |
|
||||
| name | Project Venus |
|
||||
| quota@@@total | 2000 |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
|
||||
Reference in New Issue
Block a user