sharing-v1.feature 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. Feature: sharing
  2. Background:
  3. Given using api version "1"
  4. Given using old dav path
  5. Scenario: Creating a new share with user
  6. Given user "user0" exists
  7. And user "user1" exists
  8. And As an "user0"
  9. When sending "POST" to "/apps/files_sharing/api/v1/shares" with
  10. | path | welcome.txt |
  11. | shareWith | user1 |
  12. | shareType | 0 |
  13. Then the OCS status code should be "100"
  14. And the HTTP status code should be "200"
  15. And The following headers should be set
  16. | Content-Security-Policy | default-src 'none';base-uri 'none';manifest-src 'self' |
  17. Scenario: Creating a share with a group
  18. Given user "user0" exists
  19. And user "user1" exists
  20. And group "sharing-group" exists
  21. And As an "user0"
  22. When sending "POST" to "/apps/files_sharing/api/v1/shares" with
  23. | path | welcome.txt |
  24. | shareWith | sharing-group |
  25. | shareType | 1 |
  26. Then the OCS status code should be "100"
  27. And the HTTP status code should be "200"
  28. Scenario: Creating a new share with user who already received a share through their group
  29. Given As an "admin"
  30. And user "user0" exists
  31. And user "user1" exists
  32. And group "sharing-group" exists
  33. And user "user1" belongs to group "sharing-group"
  34. And file "welcome.txt" of user "user0" is shared with group "sharing-group"
  35. And As an "user0"
  36. Then sending "POST" to "/apps/files_sharing/api/v1/shares" with
  37. | path | welcome.txt |
  38. | shareWith | user1 |
  39. | shareType | 0 |
  40. Then the OCS status code should be "100"
  41. And the HTTP status code should be "200"
  42. Scenario: Creating a new room share when Talk is not enabled
  43. Given As an "admin"
  44. And app "spreed" is not enabled
  45. And user "user0" exists
  46. And As an "user0"
  47. When creating a share with
  48. | path | welcome.txt |
  49. | shareWith | a-room-token |
  50. | shareType | 10 |
  51. Then the OCS status code should be "403"
  52. And the HTTP status code should be "401"
  53. Scenario: Creating a new public share
  54. Given user "user0" exists
  55. And As an "user0"
  56. When creating a share with
  57. | path | welcome.txt |
  58. | shareType | 3 |
  59. Then the OCS status code should be "100"
  60. And the HTTP status code should be "200"
  61. And Public shared file "welcome.txt" can be downloaded
  62. Scenario: Creating a new public share with password
  63. Given user "user0" exists
  64. And As an "user0"
  65. When creating a share with
  66. | path | welcome.txt |
  67. | shareType | 3 |
  68. | password | publicpw |
  69. Then the OCS status code should be "100"
  70. And the HTTP status code should be "200"
  71. And Public shared file "welcome.txt" with password "publicpw" can be downloaded
  72. Scenario: Creating a new public share of a folder
  73. Given user "user0" exists
  74. And As an "user0"
  75. When creating a share with
  76. | path | FOLDER |
  77. | shareType | 3 |
  78. | password | publicpw |
  79. | expireDate | +3 days |
  80. | publicUpload | true |
  81. | permissions | 7 |
  82. Then the OCS status code should be "100"
  83. And the HTTP status code should be "200"
  84. And Share fields of last share match with
  85. | id | A_NUMBER |
  86. | permissions | 15 |
  87. | expiration | +3 days |
  88. | url | AN_URL |
  89. | token | A_TOKEN |
  90. | mimetype | httpd/unix-directory |
  91. Scenario: Creating a new public share with password and adding an expiration date
  92. Given user "user0" exists
  93. And As an "user0"
  94. When creating a share with
  95. | path | welcome.txt |
  96. | shareType | 3 |
  97. | password | publicpw |
  98. And Updating last share with
  99. | expireDate | +3 days |
  100. Then the OCS status code should be "100"
  101. And the HTTP status code should be "200"
  102. And Public shared file "welcome.txt" with password "publicpw" can be downloaded
  103. Scenario: Creating a new public share, updating its expiration date and getting its info
  104. Given user "user0" exists
  105. And As an "user0"
  106. When creating a share with
  107. | path | FOLDER |
  108. | shareType | 3 |
  109. And Updating last share with
  110. | expireDate | +3 days |
  111. And the OCS status code should be "100"
  112. And Getting info of last share
  113. Then the OCS status code should be "100"
  114. And the HTTP status code should be "200"
  115. And Share fields of last share match with
  116. | id | A_NUMBER |
  117. | item_type | folder |
  118. | item_source | A_NUMBER |
  119. | share_type | 3 |
  120. | file_source | A_NUMBER |
  121. | file_target | /FOLDER |
  122. | permissions | 1 |
  123. | stime | A_NUMBER |
  124. | expiration | +3 days |
  125. | token | A_TOKEN |
  126. | storage | A_NUMBER |
  127. | mail_send | 0 |
  128. | uid_owner | user0 |
  129. | storage_id | home::user0 |
  130. | file_parent | A_NUMBER |
  131. | displayname_owner | user0 |
  132. | url | AN_URL |
  133. | mimetype | httpd/unix-directory |
  134. Scenario: Creating a new public share, updating its password and getting its info
  135. Given user "user0" exists
  136. And As an "user0"
  137. When creating a share with
  138. | path | FOLDER |
  139. | shareType | 3 |
  140. And Updating last share with
  141. | password | publicpw |
  142. And the OCS status code should be "100"
  143. And Getting info of last share
  144. Then the OCS status code should be "100"
  145. And the HTTP status code should be "200"
  146. And Share fields of last share match with
  147. | id | A_NUMBER |
  148. | item_type | folder |
  149. | item_source | A_NUMBER |
  150. | share_type | 3 |
  151. | file_source | A_NUMBER |
  152. | file_target | /FOLDER |
  153. | permissions | 1 |
  154. | stime | A_NUMBER |
  155. | token | A_TOKEN |
  156. | storage | A_NUMBER |
  157. | mail_send | 0 |
  158. | uid_owner | user0 |
  159. | storage_id | home::user0 |
  160. | file_parent | A_NUMBER |
  161. | displayname_owner | user0 |
  162. | url | AN_URL |
  163. | mimetype | httpd/unix-directory |
  164. Scenario: Creating a new public share, updating its permissions and getting its info
  165. Given user "user0" exists
  166. And As an "user0"
  167. When creating a share with
  168. | path | FOLDER |
  169. | shareType | 3 |
  170. And Updating last share with
  171. | permissions | 7 |
  172. And the OCS status code should be "100"
  173. And Getting info of last share
  174. Then the OCS status code should be "100"
  175. And the HTTP status code should be "200"
  176. And Share fields of last share match with
  177. | id | A_NUMBER |
  178. | item_type | folder |
  179. | item_source | A_NUMBER |
  180. | share_type | 3 |
  181. | file_source | A_NUMBER |
  182. | file_target | /FOLDER |
  183. | permissions | 15 |
  184. | stime | A_NUMBER |
  185. | token | A_TOKEN |
  186. | storage | A_NUMBER |
  187. | mail_send | 0 |
  188. | uid_owner | user0 |
  189. | storage_id | home::user0 |
  190. | file_parent | A_NUMBER |
  191. | displayname_owner | user0 |
  192. | url | AN_URL |
  193. | mimetype | httpd/unix-directory |
  194. Scenario: Creating a new public share, updating its permissions for "hide file list"
  195. Given user "user0" exists
  196. And As an "user0"
  197. When creating a share with
  198. | path | FOLDER |
  199. | shareType | 3 |
  200. And Updating last share with
  201. | permissions | 4 |
  202. And the OCS status code should be "100"
  203. And Getting info of last share
  204. Then the OCS status code should be "100"
  205. And the HTTP status code should be "200"
  206. And Share fields of last share match with
  207. | id | A_NUMBER |
  208. | item_type | folder |
  209. | item_source | A_NUMBER |
  210. | share_type | 3 |
  211. | file_source | A_NUMBER |
  212. | file_target | /FOLDER |
  213. | permissions | 4 |
  214. | stime | A_NUMBER |
  215. | token | A_TOKEN |
  216. | storage | A_NUMBER |
  217. | mail_send | 0 |
  218. | uid_owner | user0 |
  219. | storage_id | home::user0 |
  220. | file_parent | A_NUMBER |
  221. | displayname_owner | user0 |
  222. | url | AN_URL |
  223. | mimetype | httpd/unix-directory |
  224. Scenario: Creating a new public share, updating publicUpload option and getting its info
  225. Given user "user0" exists
  226. And As an "user0"
  227. When creating a share with
  228. | path | FOLDER |
  229. | shareType | 3 |
  230. And Updating last share with
  231. | publicUpload | true |
  232. And the OCS status code should be "100"
  233. And Getting info of last share
  234. Then the OCS status code should be "100"
  235. And the HTTP status code should be "200"
  236. And Share fields of last share match with
  237. | id | A_NUMBER |
  238. | item_type | folder |
  239. | item_source | A_NUMBER |
  240. | share_type | 3 |
  241. | file_source | A_NUMBER |
  242. | file_target | /FOLDER |
  243. | permissions | 15 |
  244. | stime | A_NUMBER |
  245. | token | A_TOKEN |
  246. | storage | A_NUMBER |
  247. | mail_send | 0 |
  248. | uid_owner | user0 |
  249. | storage_id | home::user0 |
  250. | file_parent | A_NUMBER |
  251. | displayname_owner | user0 |
  252. | url | AN_URL |
  253. | mimetype | httpd/unix-directory |
  254. Scenario: getting all shares of a user using that user
  255. Given user "user0" exists
  256. And user "user1" exists
  257. And file "textfile0.txt" of user "user0" is shared with user "user1"
  258. And As an "user0"
  259. When sending "GET" to "/apps/files_sharing/api/v1/shares"
  260. Then the OCS status code should be "100"
  261. And the HTTP status code should be "200"
  262. And File "textfile0.txt" should be included in the response
  263. Scenario: getting all shares of a user using another user
  264. Given user "user0" exists
  265. And user "user1" exists
  266. And file "textfile0.txt" of user "user0" is shared with user "user1"
  267. And As an "admin"
  268. When sending "GET" to "/apps/files_sharing/api/v1/shares"
  269. Then the OCS status code should be "100"
  270. And the HTTP status code should be "200"
  271. And File "textfile0.txt" should not be included in the response
  272. Scenario: getting all shares of a file
  273. Given user "user0" exists
  274. And user "user1" exists
  275. And user "user2" exists
  276. And user "user3" exists
  277. And file "textfile0.txt" of user "user0" is shared with user "user1"
  278. And file "textfile0.txt" of user "user0" is shared with user "user2"
  279. And As an "user0"
  280. When sending "GET" to "/apps/files_sharing/api/v1/shares?path=textfile0.txt"
  281. Then the OCS status code should be "100"
  282. And the HTTP status code should be "200"
  283. And User "user1" should be included in the response
  284. And User "user2" should be included in the response
  285. And User "user3" should not be included in the response
  286. # See sharing-v1-part2.feature