2016-02-24 09:39:04 +00:00
|
|
|
Feature: webdav-related
|
2015-11-20 11:56:05 +00:00
|
|
|
Background:
|
|
|
|
Given using api version "1"
|
|
|
|
|
|
|
|
Scenario: moving a file old way
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
|
|
|
|
Then the HTTP status code should be "201"
|
2015-11-20 11:26:52 +00:00
|
|
|
|
2015-11-30 14:07:02 +00:00
|
|
|
Scenario: download a file with range
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
When Downloading file "/welcome.txt" with range "bytes=51-77"
|
|
|
|
Then Downloaded content should be "example file for developers"
|
|
|
|
|
2015-12-01 12:36:55 +00:00
|
|
|
Scenario: Upload forbidden if quota is 0
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user0" has a quota of "0"
|
|
|
|
When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
|
|
|
|
Then the HTTP status code should be "507"
|
2015-11-18 11:09:34 +00:00
|
|
|
|
2016-02-24 09:39:04 +00:00
|
|
|
Scenario: Retrieving folder quota when no quota is set
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
When user "user0" has unlimited quota
|
|
|
|
Then as "user0" gets properties of folder "/" with
|
|
|
|
|{DAV:}quota-available-bytes|
|
|
|
|
And the single response should contain a property "{DAV:}quota-available-bytes" with value "-3"
|
|
|
|
|
|
|
|
Scenario: Retrieving folder quota when quota is set
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
When user "user0" has a quota of "10 MB"
|
|
|
|
Then as "user0" gets properties of folder "/" with
|
|
|
|
|{DAV:}quota-available-bytes|
|
|
|
|
And the single response should contain a property "{DAV:}quota-available-bytes" with value "10485429"
|
|
|
|
|
|
|
|
Scenario: Retrieving folder quota of shared folder with quota when no quota is set for recipient
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user1" exists
|
|
|
|
And user "user0" has unlimited quota
|
|
|
|
And user "user1" has a quota of "10 MB"
|
|
|
|
And As an "user1"
|
|
|
|
And user "user1" created a folder "/testquota"
|
|
|
|
And as "user1" creating a share with
|
|
|
|
| path | testquota |
|
|
|
|
| shareType | 0 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | user0 |
|
|
|
|
Then as "user0" gets properties of folder "/testquota" with
|
|
|
|
|{DAV:}quota-available-bytes|
|
|
|
|
And the single response should contain a property "{DAV:}quota-available-bytes" with value "10485429"
|
|
|
|
|
2015-12-03 09:46:00 +00:00
|
|
|
Scenario: download a public shared file with range
|
|
|
|
Given user "user0" exists
|
|
|
|
And As an "user0"
|
|
|
|
When creating a share with
|
|
|
|
| path | welcome.txt |
|
|
|
|
| shareType | 3 |
|
|
|
|
And Downloading last public shared file with range "bytes=51-77"
|
|
|
|
Then Downloaded content should be "example file for developers"
|
|
|
|
|
2016-04-13 14:43:55 +00:00
|
|
|
Scenario: download a public shared file inside a folder with range
|
|
|
|
Given user "user0" exists
|
|
|
|
And As an "user0"
|
|
|
|
When creating a share with
|
|
|
|
| path | PARENT |
|
|
|
|
| shareType | 3 |
|
|
|
|
And Downloading last public shared file inside a folder "/parent.txt" with range "bytes=1-7"
|
|
|
|
Then Downloaded content should be "wnCloud"
|
|
|
|
|
2016-02-23 10:54:22 +00:00
|
|
|
Scenario: Downloading a file on the old endpoint should serve security headers
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And As an "admin"
|
|
|
|
When Downloading file "/welcome.txt"
|
|
|
|
Then The following headers should be set
|
2016-06-09 09:29:20 +00:00
|
|
|
|Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
|
2016-04-12 11:30:37 +00:00
|
|
|
|Content-Security-Policy|default-src 'none';|
|
2016-02-23 10:54:22 +00:00
|
|
|
|X-Content-Type-Options |nosniff|
|
|
|
|
|X-Download-Options|noopen|
|
|
|
|
|X-Frame-Options|Sameorigin|
|
|
|
|
|X-Permitted-Cross-Domain-Policies|none|
|
|
|
|
|X-Robots-Tag|none|
|
|
|
|
|X-XSS-Protection|1; mode=block|
|
|
|
|
And Downloaded content should start with "Welcome to your ownCloud account!"
|
|
|
|
|
2016-02-25 16:19:24 +00:00
|
|
|
Scenario: Doing a GET with a web login should work without CSRF token on the old backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "GET" to "/remote.php/webdav/welcome.txt" without requesttoken
|
|
|
|
Then Downloaded content should start with "Welcome to your ownCloud account!"
|
|
|
|
Then the HTTP status code should be "200"
|
2015-11-18 11:09:34 +00:00
|
|
|
|
2016-02-25 16:19:24 +00:00
|
|
|
Scenario: Doing a GET with a web login should work with CSRF token on the old backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
|
|
|
|
Then Downloaded content should start with "Welcome to your ownCloud account!"
|
|
|
|
Then the HTTP status code should be "200"
|
2015-11-18 11:09:34 +00:00
|
|
|
|
2016-02-25 16:19:24 +00:00
|
|
|
Scenario: Doing a PROPFIND with a web login should not work without CSRF token on the old backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" without requesttoken
|
|
|
|
Then the HTTP status code should be "401"
|
|
|
|
|
|
|
|
Scenario: Doing a PROPFIND with a web login should work with CSRF token on the old backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" with requesttoken
|
|
|
|
Then the HTTP status code should be "207"
|
2016-03-07 19:55:49 +00:00
|
|
|
|
|
|
|
Scenario: Upload chunked file asc
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
|
|
|
|
And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
|
|
|
|
And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
|
|
|
|
When As an "user0"
|
|
|
|
And Downloading file "/myChunkedFile.txt"
|
|
|
|
Then Downloaded content should be "AAAAABBBBBCCCCC"
|
|
|
|
|
|
|
|
Scenario: Upload chunked file desc
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
|
|
|
|
And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
|
|
|
|
And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
|
|
|
|
When As an "user0"
|
|
|
|
And Downloading file "/myChunkedFile.txt"
|
|
|
|
Then Downloaded content should be "AAAAABBBBBCCCCC"
|
|
|
|
|
|
|
|
Scenario: Upload chunked file random
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
|
|
|
|
And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
|
|
|
|
And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
|
|
|
|
When As an "user0"
|
|
|
|
And Downloading file "/myChunkedFile.txt"
|
|
|
|
Then Downloaded content should be "AAAAABBBBBCCCCC"
|
2016-03-17 14:50:33 +00:00
|
|
|
|
|
|
|
Scenario: A file that is not shared does not have a share-types property
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user0" created a folder "/test"
|
|
|
|
When as "user0" gets properties of folder "/test" with
|
|
|
|
|{http://owncloud.org/ns}share-types|
|
|
|
|
Then the response should contain an empty property "{http://owncloud.org/ns}share-types"
|
|
|
|
|
|
|
|
Scenario: A file that is shared to a user has a share-types property
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user1" exists
|
|
|
|
And user "user0" created a folder "/test"
|
|
|
|
And as "user0" creating a share with
|
|
|
|
| path | test |
|
|
|
|
| shareType | 0 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | user1 |
|
|
|
|
When as "user0" gets properties of folder "/test" with
|
|
|
|
|{http://owncloud.org/ns}share-types|
|
|
|
|
Then the response should contain a share-types property with
|
|
|
|
| 0 |
|
|
|
|
|
|
|
|
Scenario: A file that is shared to a group has a share-types property
|
|
|
|
Given user "user0" exists
|
|
|
|
And group "group1" exists
|
|
|
|
And user "user0" created a folder "/test"
|
|
|
|
And as "user0" creating a share with
|
|
|
|
| path | test |
|
|
|
|
| shareType | 1 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | group1 |
|
|
|
|
When as "user0" gets properties of folder "/test" with
|
|
|
|
|{http://owncloud.org/ns}share-types|
|
|
|
|
Then the response should contain a share-types property with
|
|
|
|
| 1 |
|
|
|
|
|
|
|
|
Scenario: A file that is shared by link has a share-types property
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user0" created a folder "/test"
|
|
|
|
And as "user0" creating a share with
|
|
|
|
| path | test |
|
|
|
|
| shareType | 3 |
|
|
|
|
| permissions | 31 |
|
|
|
|
When as "user0" gets properties of folder "/test" with
|
|
|
|
|{http://owncloud.org/ns}share-types|
|
|
|
|
Then the response should contain a share-types property with
|
|
|
|
| 3 |
|
|
|
|
|
|
|
|
Scenario: A file that is shared by user,group and link has a share-types property
|
|
|
|
Given user "user0" exists
|
|
|
|
And user "user1" exists
|
|
|
|
And group "group2" exists
|
|
|
|
And user "user0" created a folder "/test"
|
|
|
|
And as "user0" creating a share with
|
|
|
|
| path | test |
|
|
|
|
| shareType | 0 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | user1 |
|
|
|
|
And as "user0" creating a share with
|
|
|
|
| path | test |
|
|
|
|
| shareType | 1 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | group2 |
|
|
|
|
And as "user0" creating a share with
|
|
|
|
| path | test |
|
|
|
|
| shareType | 3 |
|
|
|
|
| permissions | 31 |
|
|
|
|
When as "user0" gets properties of folder "/test" with
|
|
|
|
|{http://owncloud.org/ns}share-types|
|
|
|
|
Then the response should contain a share-types property with
|
|
|
|
| 0 |
|
|
|
|
| 1 |
|
|
|
|
| 3 |
|
2016-03-11 15:18:02 +00:00
|
|
|
|
|
|
|
Scenario: Upload chunked file asc with new chunking
|
|
|
|
Given using dav path "remote.php/dav"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user0" creates a new chunking upload with id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
|
|
|
|
And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
|
|
|
|
When As an "user0"
|
|
|
|
And Downloading file "/files/user0/myChunkedFile.txt"
|
|
|
|
Then Downloaded content should be "AAAAABBBBBCCCCC"
|
|
|
|
|
|
|
|
Scenario: Upload chunked file desc with new chunking
|
|
|
|
Given using dav path "remote.php/dav"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user0" creates a new chunking upload with id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
|
|
|
|
And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
|
|
|
|
When As an "user0"
|
|
|
|
And Downloading file "/files/user0/myChunkedFile.txt"
|
|
|
|
Then Downloaded content should be "AAAAABBBBBCCCCC"
|
|
|
|
|
|
|
|
Scenario: Upload chunked file random with new chunking
|
|
|
|
Given using dav path "remote.php/dav"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user0" creates a new chunking upload with id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
|
|
|
|
And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
|
|
|
|
And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
|
|
|
|
When As an "user0"
|
|
|
|
And Downloading file "/files/user0/myChunkedFile.txt"
|
|
|
|
Then Downloaded content should be "AAAAABBBBBCCCCC"
|
2016-04-08 15:06:53 +00:00
|
|
|
|
|
|
|
Scenario: A disabled user cannot use webdav
|
|
|
|
Given user "userToBeDisabled" exists
|
|
|
|
And As an "admin"
|
2016-04-19 09:13:24 +00:00
|
|
|
And assure user "userToBeDisabled" is disabled
|
2016-04-08 15:06:53 +00:00
|
|
|
When Downloading file "/welcome.txt" as "userToBeDisabled"
|
|
|
|
Then the HTTP status code should be "503"
|
|
|
|
|
2016-06-30 10:15:58 +00:00
|
|
|
Scenario: Copying files into a folder with edit permissions
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user1" exists
|
|
|
|
And As an "user1"
|
|
|
|
And user "user1" created a folder "/testcopypermissionsAllowed"
|
|
|
|
And as "user1" creating a share with
|
|
|
|
| path | testcopypermissionsAllowed |
|
|
|
|
| shareType | 0 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | user0 |
|
|
|
|
And User "user0" uploads file with content "copytest" to "/copytest.txt"
|
|
|
|
When User "user0" copies file "/copytest.txt" to "/testcopypermissionsAllowed/copytest.txt"
|
|
|
|
Then the HTTP status code should be "201"
|
|
|
|
|
|
|
|
Scenario: Copying files into a folder without edit permissions
|
|
|
|
Given using dav path "remote.php/webdav"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user1" exists
|
|
|
|
And As an "user1"
|
|
|
|
And user "user1" created a folder "/testcopypermissionsNotAllowed"
|
|
|
|
And as "user1" creating a share with
|
|
|
|
| path | testcopypermissionsNotAllowed |
|
|
|
|
| shareType | 0 |
|
|
|
|
| permissions | 1 |
|
|
|
|
| shareWith | user0 |
|
|
|
|
And User "user0" uploads file with content "copytest" to "/copytest.txt"
|
|
|
|
When User "user0" copies file "/copytest.txt" to "/testcopypermissionsNotAllowed/copytest.txt"
|
|
|
|
Then the HTTP status code should be "403"
|