app-files-sharing.feature 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. Feature: app-files-sharing
  2. Scenario: share a file with another user
  3. Given I act as John
  4. And I am logged in as the admin
  5. And I act as Jane
  6. And I am logged in
  7. And I act as John
  8. And I rename "welcome.txt" to "farewell.txt"
  9. And I see that the file list contains a file named "farewell.txt"
  10. When I share "farewell.txt" with "user0"
  11. And I see that the file is shared with "user0"
  12. And I act as Jane
  13. # The Files app is open again to reload the file list
  14. And I open the Files app
  15. Then I see that the file list contains a file named "farewell.txt"
  16. And I open the details view for "farewell.txt"
  17. And I see that the details view is open
  18. And I open the "Sharing" tab in the details view
  19. And I see that the "Sharing" tab in the details view is eventually loaded
  20. And I see that the file is shared with me by "admin"
  21. Scenario: share a file with another user that needs to accept shares
  22. Given I act as John
  23. And I am logged in as the admin
  24. And I act as Jane
  25. And I am logged in
  26. And I visit the settings page
  27. And I open the "Sharing" section
  28. And I disable accepting the shares by default
  29. And I see that shares are not accepted by default
  30. And I act as John
  31. And I rename "welcome.txt" to "farewell.txt"
  32. And I see that the file list contains a file named "farewell.txt"
  33. When I share "farewell.txt" with "user0"
  34. And I see that the file is shared with "user0"
  35. And I act as Jane
  36. And I open the Files app
  37. And I see that the file list does not contain a file named "farewell.txt"
  38. And I accept the share for "/farewell.txt" in the notifications
  39. # The Files app is open again to reload the file list
  40. And I open the Files app
  41. Then I see that the file list contains a file named "farewell.txt"
  42. And I open the details view for "farewell.txt"
  43. And I see that the details view is open
  44. And I open the "Sharing" tab in the details view
  45. And I see that the "Sharing" tab in the details view is eventually loaded
  46. And I see that the file is shared with me by "admin"
  47. Scenario: share a file with another user who already has a file with that name
  48. Given I act as John
  49. And I am logged in as the admin
  50. And I act as Jane
  51. And I am logged in
  52. And I act as John
  53. When I share "welcome.txt" with "user0"
  54. And I see that the file is shared with "user0"
  55. And I act as Jane
  56. # The Files app is open again to reload the file list
  57. And I open the Files app
  58. Then I see that the file list contains a file named "welcome (2).txt"
  59. And I open the details view for "welcome (2).txt"
  60. And I see that the details view is open
  61. And I open the "Sharing" tab in the details view
  62. And I see that the "Sharing" tab in the details view is eventually loaded
  63. And I see that the file is shared with me by "admin"
  64. Scenario: share a skeleton file with another user before first login
  65. # If a file is shared with a user before her first login the skeleton would
  66. # not have been created, so if the shared file has the same name as one from
  67. # the skeleton the shared file will take its place and the skeleton file
  68. # will not be added.
  69. Given I act as John
  70. And I am logged in as the admin
  71. When I share "welcome.txt" with "user0"
  72. And I see that the file is shared with "user0"
  73. And I act as Jane
  74. And I am logged in
  75. Then I see that the file list contains a file named "welcome.txt"
  76. And I open the details view for "welcome.txt"
  77. And I see that the details view is open
  78. And I open the "Sharing" tab in the details view
  79. And I see that the "Sharing" tab in the details view is eventually loaded
  80. And I see that the file is shared with me by "admin"
  81. Scenario: reshare a file with another user
  82. Given I act as John
  83. And I am logged in as the admin
  84. And I act as Jane
  85. And I am logged in
  86. And I act as Jim
  87. And I am logged in as "user1"
  88. And I act as John
  89. And I rename "welcome.txt" to "farewell.txt"
  90. And I see that the file list contains a file named "farewell.txt"
  91. And I share "farewell.txt" with "user0"
  92. And I see that the file is shared with "user0"
  93. And I act as Jane
  94. # The Files app is open again to reload the file list
  95. And I open the Files app
  96. When I share "farewell.txt" with "user1"
  97. And I see that the file is shared with "user1"
  98. And I act as Jim
  99. # The Files app is open again to reload the file list
  100. And I open the Files app
  101. Then I see that the file list contains a file named "farewell.txt"
  102. And I open the details view for "farewell.txt"
  103. And I see that the details view is open
  104. And I open the "Sharing" tab in the details view
  105. And I see that the "Sharing" tab in the details view is eventually loaded
  106. And I see that the file is shared with me by "user0"
  107. Scenario: owner sees reshares with other users
  108. Given I act as John
  109. And I am logged in as the admin
  110. And I act as Jane
  111. And I am logged in
  112. And I act as John
  113. And I rename "welcome.txt" to "farewell.txt"
  114. And I see that the file list contains a file named "farewell.txt"
  115. And I share "farewell.txt" with "user0"
  116. And I see that the file is shared with "user0"
  117. And I act as Jane
  118. # The Files app is open again to reload the file list
  119. And I open the Files app
  120. And I share "farewell.txt" with "user1"
  121. And I see that the file is shared with "user1"
  122. When I act as John
  123. # The Files app is open again to reload the file list and the shares
  124. And I open the Files app
  125. And I open the details view for "farewell.txt"
  126. And I see that the details view is open
  127. And I open the "Sharing" tab in the details view
  128. And I see that the "Sharing" tab in the details view is eventually loaded
  129. Then I see that the file is shared with "user0"
  130. And I see that the file is shared with "user1"
  131. Scenario: share an empty folder with another user
  132. Given I act as John
  133. And I am logged in as the admin
  134. And I act as Jane
  135. And I am logged in
  136. And I act as John
  137. And I create a new folder named "Shared folder"
  138. And I see that the file list contains a file named "Shared folder"
  139. When I share "Shared folder" with "user0"
  140. And I see that the file is shared with "user0"
  141. And I act as Jane
  142. # The Files app is open again to reload the file list
  143. And I open the Files app
  144. Then I see that the file list contains a file named "Shared folder"
  145. And I open the details view for "Shared folder"
  146. And I see that the details view is open
  147. And I open the "Sharing" tab in the details view
  148. And I see that the "Sharing" tab in the details view is eventually loaded
  149. And I see that the file is shared with me by "admin"
  150. Scenario: sharee sees a folder created by the owner in a shared folder
  151. Given I act as John
  152. And I am logged in as the admin
  153. And I act as Jane
  154. And I am logged in
  155. And I act as John
  156. And I create a new folder named "Shared folder"
  157. And I see that the file list contains a file named "Shared folder"
  158. And I share "Shared folder" with "user0"
  159. And I see that the file is shared with "user0"
  160. And I enter in the folder named "Shared folder"
  161. And I create a new folder named "Subfolder"
  162. And I see that the file list contains a file named "Subfolder"
  163. When I act as Jane
  164. # The Files app is open again to reload the file list
  165. And I open the Files app
  166. And I enter in the folder named "Shared folder"
  167. Then I see that the file list contains a file named "Subfolder"
  168. Scenario: owner sees a folder created by the sharee in a shared folder
  169. Given I act as John
  170. And I am logged in as the admin
  171. And I act as Jane
  172. And I am logged in
  173. And I act as John
  174. And I create a new folder named "Shared folder"
  175. And I see that the file list contains a file named "Shared folder"
  176. And I share "Shared folder" with "user0"
  177. And I see that the file is shared with "user0"
  178. And I act as Jane
  179. # The Files app is open again to reload the file list
  180. And I open the Files app
  181. And I enter in the folder named "Shared folder"
  182. And I create a new folder named "Subfolder"
  183. And I see that the file list contains a file named "Subfolder"
  184. When I act as John
  185. And I enter in the folder named "Shared folder"
  186. Then I see that the file list contains a file named "Subfolder"
  187. Scenario: resharee sees a folder created by the owner in a shared folder
  188. Given I act as John
  189. And I am logged in as the admin
  190. And I act as Jane
  191. And I am logged in
  192. And I act as Jim
  193. And I am logged in as "user1"
  194. And I act as John
  195. And I create a new folder named "Shared folder"
  196. And I see that the file list contains a file named "Shared folder"
  197. And I share "Shared folder" with "user0"
  198. And I see that the file is shared with "user0"
  199. And I act as Jane
  200. # The Files app is open again to reload the file list
  201. And I open the Files app
  202. And I share "Shared folder" with "user1"
  203. And I act as John
  204. And I enter in the folder named "Shared folder"
  205. And I create a new folder named "Subfolder"
  206. And I see that the file list contains a file named "Subfolder"
  207. When I act as Jim
  208. # The Files app is open again to reload the file list
  209. And I open the Files app
  210. And I enter in the folder named "Shared folder"
  211. Then I see that the file list contains a file named "Subfolder"
  212. Scenario: owner sees a folder created by the resharee in a shared folder
  213. Given I act as John
  214. And I am logged in as the admin
  215. And I act as Jane
  216. And I am logged in
  217. And I act as Jim
  218. And I am logged in as "user1"
  219. And I act as John
  220. And I create a new folder named "Shared folder"
  221. And I see that the file list contains a file named "Shared folder"
  222. And I share "Shared folder" with "user0"
  223. And I see that the file is shared with "user0"
  224. And I act as Jane
  225. # The Files app is open again to reload the file list
  226. And I open the Files app
  227. And I share "Shared folder" with "user1"
  228. And I act as Jim
  229. # The Files app is open again to reload the file list
  230. And I open the Files app
  231. And I enter in the folder named "Shared folder"
  232. And I create a new folder named "Subfolder"
  233. And I see that the file list contains a file named "Subfolder"
  234. When I act as John
  235. And I enter in the folder named "Shared folder"
  236. Then I see that the file list contains a file named "Subfolder"
  237. Scenario: sharer does not see resharing option for a folder if resharing is disabled in the settings after the share is created
  238. Given I am logged in as the admin
  239. And I create a new folder named "Shared folder"
  240. And I see that the file list contains a file named "Shared folder"
  241. And I share "Shared folder" with "user0"
  242. And I see that the file is shared with "user0"
  243. When I visit the admin settings page
  244. And I open the "Sharing" section of the "Administration" group
  245. And I disable resharing
  246. And I see that resharing is disabled
  247. Then I open the Files app
  248. And I open the details view for "Shared folder"
  249. And I see that the details view is open
  250. And I open the "Sharing" tab in the details view
  251. And I see that the "Sharing" tab in the details view is eventually loaded
  252. And I see that resharing for "user0" is not available
  253. Scenario: sharee can not reshare a folder if resharing is disabled in the settings after the share is created
  254. Given I act as John
  255. And I am logged in as the admin
  256. And I act as Jane
  257. And I am logged in
  258. And I act as John
  259. And I create a new folder named "Shared folder"
  260. And I see that the file list contains a file named "Shared folder"
  261. And I share "Shared folder" with "user0"
  262. And I see that the file is shared with "user0"
  263. And I visit the admin settings page
  264. And I open the "Sharing" section of the "Administration" group
  265. And I disable resharing
  266. And I see that resharing is disabled
  267. When I act as Jane
  268. # The Files app is open again to reload the file list
  269. And I open the Files app
  270. Then I see that the file list contains a file named "Shared folder"
  271. And I open the details view for "Shared folder"
  272. And I see that the details view is open
  273. And I open the "Sharing" tab in the details view
  274. And I see that the "Sharing" tab in the details view is eventually loaded
  275. And I see that the file is shared with me by "admin"
  276. And I see that resharing the file is not allowed
  277. Scenario: sharee can unshare a folder if resharing is disabled in the settings after the share is created
  278. Given I act as John
  279. And I am logged in as the admin
  280. And I act as Jane
  281. And I am logged in
  282. And I act as John
  283. And I create a new folder named "Shared folder"
  284. And I see that the file list contains a file named "Shared folder"
  285. And I share "Shared folder" with "user0"
  286. And I see that the file is shared with "user0"
  287. And I act as Jane
  288. # The Files app is open again to reload the file list
  289. And I open the Files app
  290. And I share "Shared folder" with "user1"
  291. And I act as John
  292. And I visit the admin settings page
  293. And I open the "Sharing" section of the "Administration" group
  294. And I disable resharing
  295. And I see that resharing is disabled
  296. When I act as Jane
  297. # The Files app is open again to reload the file list
  298. And I open the Files app
  299. Then I see that the file list contains a file named "Shared folder"
  300. And I open the details view for "Shared folder"
  301. And I see that the details view is open
  302. And I open the "Sharing" tab in the details view
  303. And I see that the "Sharing" tab in the details view is eventually loaded
  304. And I see that the file is shared with me by "admin"
  305. And I unshare the share with "user1"
  306. And I see that the file is not shared with "user1"
  307. Scenario: resharee sees a folder created by the owner in a shared folder if resharing is disabled in the settings after the share is created
  308. Given I act as John
  309. And I am logged in as the admin
  310. And I act as Jane
  311. And I am logged in
  312. And I act as Jim
  313. And I am logged in as "user1"
  314. And I act as John
  315. And I create a new folder named "Shared folder"
  316. And I see that the file list contains a file named "Shared folder"
  317. And I share "Shared folder" with "user0"
  318. And I see that the file is shared with "user0"
  319. And I act as Jane
  320. # The Files app is open again to reload the file list
  321. And I open the Files app
  322. And I share "Shared folder" with "user1"
  323. And I act as John
  324. And I visit the admin settings page
  325. And I open the "Sharing" section of the "Administration" group
  326. And I disable resharing
  327. And I see that resharing is disabled
  328. And I open the Files app
  329. And I enter in the folder named "Shared folder"
  330. And I create a new folder named "Subfolder"
  331. And I see that the file list contains a file named "Subfolder"
  332. When I act as Jim
  333. # The Files app is open again to reload the file list
  334. And I open the Files app
  335. And I enter in the folder named "Shared folder"
  336. Then I see that the file list contains a file named "Subfolder"
  337. Scenario: sharee can not reshare a folder if the sharer disables it
  338. Given I act as John
  339. And I am logged in as the admin
  340. And I act as Jane
  341. And I am logged in
  342. And I act as John
  343. And I create a new folder named "Shared folder"
  344. And I see that the file list contains a file named "Shared folder"
  345. And I share "Shared folder" with "user0"
  346. And I see that the file is shared with "user0"
  347. And I set the share with "user0" as not reshareable
  348. And I see that "user0" can not reshare the share
  349. When I act as Jane
  350. # The Files app is open again to reload the file list
  351. And I open the Files app
  352. Then I see that the file list contains a file named "Shared folder"
  353. And I open the details view for "Shared folder"
  354. And I see that the details view is open
  355. And I open the "Sharing" tab in the details view
  356. And I see that the "Sharing" tab in the details view is eventually loaded
  357. And I see that the file is shared with me by "admin"
  358. And I see that resharing the file is not allowed
  359. Scenario: sharee can not reshare a subfolder if the sharer disables it for the parent folder
  360. Given I act as John
  361. And I am logged in as the admin
  362. And I act as Jane
  363. And I am logged in
  364. And I act as John
  365. And I create a new folder named "Shared folder"
  366. And I see that the file list contains a file named "Shared folder"
  367. And I share "Shared folder" with "user0"
  368. And I see that the file is shared with "user0"
  369. And I set the share with "user0" as not reshareable
  370. And I see that "user0" can not reshare the share
  371. And I enter in the folder named "Shared folder"
  372. And I create a new folder named "Subfolder"
  373. And I see that the file list contains a file named "Subfolder"
  374. When I act as Jane
  375. # The Files app is open again to reload the file list
  376. And I open the Files app
  377. And I enter in the folder named "Shared folder"
  378. Then I see that the file list contains a file named "Subfolder"
  379. And I open the details view for "Subfolder"
  380. And I see that the details view is open
  381. And I open the "Sharing" tab in the details view
  382. And I see that the "Sharing" tab in the details view is eventually loaded
  383. And I see that resharing the file is not allowed
  384. Scenario: sharee can not reshare a file with edit permission if the sharer disables it
  385. Given I act as John
  386. And I am logged in as the admin
  387. And I act as Jane
  388. And I am logged in
  389. And I act as John
  390. And I rename "welcome.txt" to "farewell.txt"
  391. And I see that the file list contains a file named "farewell.txt"
  392. And I share "farewell.txt" with "user0"
  393. And I see that the file is shared with "user0"
  394. And I set the share with "user0" as not editable
  395. And I see that "user0" can not edit the share
  396. When I act as Jane
  397. # The Files app is open again to reload the file list
  398. And I open the Files app
  399. And I share "farewell.txt" with "user1"
  400. Then I see that the file is shared with "user1"
  401. And I see that "user1" can not edit the share
  402. And I see that "user1" can not be allowed to edit the share
  403. # TODO: disabled unreliable test
  404. # Scenario: sharee can not reshare a folder with create permission if the sharer disables it
  405. # Given I act as John
  406. # And I am logged in as the admin
  407. # And I act as Jane
  408. # And I am logged in
  409. # And I act as John
  410. # And I create a new folder named "Shared folder"
  411. # And I see that the file list contains a file named "Shared folder"
  412. # And I share "Shared folder" with "user0"
  413. # And I see that the file is shared with "user0"
  414. # And I set the share with "user0" as not creatable
  415. # And I see that "user0" can not create in the share
  416. # When I act as Jane
  417. # # The Files app is open again to reload the file list
  418. # And I open the Files app
  419. # And I share "Shared folder" with "user1"
  420. # Then I see that the file is shared with "user1"
  421. # And I see that "user1" can not create in the share
  422. # And I see that "user1" can not be allowed to create in the share
  423. # TODO: disabled unreliable test
  424. # Scenario: sharee can revoke create permission from reshare after the sharer disabled it
  425. # Given I act as John
  426. # And I am logged in as the admin
  427. # And I act as Jane
  428. # And I am logged in
  429. # And I act as Jim
  430. # And I am logged in as "user1"
  431. # And I act as John
  432. # And I create a new folder named "Shared folder"
  433. # And I see that the file list contains a file named "Shared folder"
  434. # And I share "Shared folder" with "user0"
  435. # And I see that the file is shared with "user0"
  436. # And I act as Jane
  437. # # The Files app is open again to reload the file list
  438. # And I open the Files app
  439. # And I share "Shared folder" with "user1"
  440. # And I see that the file is shared with "user1"
  441. # And I act as John
  442. # And I set the share with "user0" as not creatable
  443. # And I see that "user0" can not create in the share
  444. # And I act as Jim
  445. # # The Files app is open again to reload the file list
  446. # And I open the Files app
  447. # And I enter in the folder named "Shared folder"
  448. # # Creation is still allowed in already created reshares
  449. # And I create a new folder named "Subfolder"
  450. # And I see that the file list contains a file named "Subfolder"
  451. # When I act as Jane
  452. # # The Files app is open again to reload the file list
  453. # And I open the Files app
  454. # And I open the details view for "Shared folder"
  455. # And I see that the details view is open
  456. # And I open the "Sharing" tab in the details view
  457. # And I see that the "Sharing" tab in the details view is eventually loaded
  458. # And I set the share with "user1" as not creatable
  459. # Then I see that "user1" can not create in the share
  460. # And I see that "user1" can not be allowed to create in the share
  461. # And I act as Jim
  462. # # The Files app is open again to reload the file list
  463. # And I open the Files app
  464. # And I enter in the folder named "Shared folder"
  465. # And I see that it is not possible to create new files