1
0

dav-v2.feature 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Feature: dav-v2
  2. Background:
  3. Given using api version "1"
  4. Scenario: moving a file new endpoint way
  5. Given using new dav path
  6. And As an "admin"
  7. And user "user0" exists
  8. When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  9. Then the HTTP status code should be "201"
  10. Scenario: download a file with range using new endpoint
  11. Given using new dav path
  12. And As an "admin"
  13. And user "user0" exists
  14. And As an "user0"
  15. When Downloading file "/welcome.txt" with range "bytes=52-78"
  16. Then Downloaded content should be "example file for developers"
  17. Scenario: Downloading a file on the new endpoint should serve security headers
  18. Given using new dav path
  19. And As an "admin"
  20. When Downloading file "/welcome.txt"
  21. Then The following headers should be set
  22. |Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
  23. |Content-Security-Policy|default-src 'none';|
  24. |X-Content-Type-Options |nosniff|
  25. |X-Frame-Options|SAMEORIGIN|
  26. |X-Permitted-Cross-Domain-Policies|none|
  27. |X-Robots-Tag|noindex, nofollow|
  28. |X-XSS-Protection|1; mode=block|
  29. And Downloaded content should start with "Welcome to your Nextcloud account!"
  30. Scenario: Doing a GET with a web login should work without CSRF token on the new backend
  31. Given Logging in using web as "admin"
  32. When Sending a "GET" to "/remote.php/dav/files/admin/welcome.txt" without requesttoken
  33. Then Downloaded content should start with "Welcome to your Nextcloud account!"
  34. Then the HTTP status code should be "200"
  35. Scenario: Doing a GET with a web login should work with CSRF token on the new backend
  36. Given Logging in using web as "admin"
  37. When Sending a "GET" to "/remote.php/dav/files/admin/welcome.txt" with requesttoken
  38. Then Downloaded content should start with "Welcome to your Nextcloud account!"
  39. Then the HTTP status code should be "200"
  40. Scenario: Doing a PROPFIND with a web login should not work without CSRF token on the new backend
  41. Given Logging in using web as "admin"
  42. When Sending a "PROPFIND" to "/remote.php/dav/files/admin/welcome.txt" without requesttoken
  43. Then the HTTP status code should be "401"
  44. Scenario: Doing a PROPFIND with a web login should work with CSRF token on the new backend
  45. Given Logging in using web as "admin"
  46. When Sending a "PROPFIND" to "/remote.php/dav/files/admin/welcome.txt" with requesttoken
  47. Then the HTTP status code should be "207"
  48. Scenario: Uploading a file having 0B as quota
  49. Given using new dav path
  50. And As an "admin"
  51. And user "user0" exists
  52. And user "user0" has a quota of "0 B"
  53. And As an "user0"
  54. When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
  55. Then the HTTP status code should be "507"
  56. Scenario: Uploading a file as recipient using webdav new endpoint having quota
  57. Given using new dav path
  58. And As an "admin"
  59. And user "user0" exists
  60. And user "user1" exists
  61. And user "user0" has a quota of "10 MB"
  62. And user "user1" has a quota of "10 MB"
  63. And As an "user1"
  64. And user "user1" created a folder "/testquota"
  65. And as "user1" creating a share with
  66. | path | testquota |
  67. | shareType | 0 |
  68. | permissions | 31 |
  69. | shareWith | user0 |
  70. And user "user0" accepts last share
  71. And As an "user0"
  72. When User "user0" uploads file "data/textfile.txt" to "/testquota/asdf.txt"
  73. Then the HTTP status code should be "201"
  74. Scenario: Create a search query on image
  75. Given using new dav path
  76. And As an "admin"
  77. And user "user0" exists
  78. And As an "user0"
  79. When User "user0" uploads file "data/textfile.txt" to "/testquota/asdf.txt"
  80. Then Image search should work
  81. And the response should be empty
  82. When User "user0" uploads file "data/green-square-256.png" to "/image.png"
  83. Then Image search should work
  84. And the single response should contain a property "{DAV:}getcontenttype" with value "image/png"
  85. Scenario: Create a search query on favorite
  86. Given using new dav path
  87. And As an "admin"
  88. And user "user0" exists
  89. And As an "user0"
  90. When User "user0" uploads file "data/green-square-256.png" to "/fav_image.png"
  91. Then Favorite search should work
  92. And the response should be empty
  93. When user "user0" favorites element "/fav_image.png"
  94. Then Favorite search should work
  95. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"