1
0

dav-v2.feature 4.4 KB

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