trashbin.feature 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. Feature: trashbin
  2. Background:
  3. Given using api version "1"
  4. And using new dav path
  5. And As an "admin"
  6. And app "files_trashbin" is enabled
  7. Scenario: deleting a file moves it to trashbin
  8. Given As an "admin"
  9. And user "user0" exists
  10. When User "user0" deletes file "/textfile0.txt"
  11. Then user "user0" in trash folder "/" should have 1 element
  12. And user "user0" in trash folder "/" should have the following elements
  13. | textfile0.txt |
  14. Scenario: clearing the trashbin
  15. Given As an "admin"
  16. And user "user0" exists
  17. When User "user0" deletes file "/textfile0.txt"
  18. And User "user0" empties trashbin
  19. Then user "user0" in trash folder "/" should have 0 elements
  20. Scenario: restoring file from trashbin
  21. Given As an "admin"
  22. And user "user0" exists
  23. When User "user0" deletes file "/textfile0.txt"
  24. And user "user0" in restores "/textfile0.txt" from trash
  25. Then user "user0" in trash folder "/" should have 0 elements
  26. And as "user0" the file "/textfile0.txt" exists
  27. Scenario: deleting and restoring a folder
  28. Given As an "admin"
  29. And user "user0" exists
  30. When User "user0" created a folder "/testfolder"
  31. And User "user0" moves file "/textfile0.txt" to "/testfolder/textfile0.txt"
  32. And as "user0" the file "/testfolder/textfile0.txt" exists
  33. And User "user0" deletes file "/testfolder"
  34. And user "user0" in trash folder "/" should have 1 element
  35. And user "user0" in trash folder "/" should have the following elements
  36. | testfolder |
  37. And user "user0" in trash folder "/testfolder" should have 1 element
  38. And user "user0" in trash folder "/testfolder" should have the following elements
  39. | textfile0.txt |
  40. And user "user0" in restores "/testfolder" from trash
  41. Then user "user0" in trash folder "/" should have 0 elements
  42. And as "user0" the file "/testfolder/textfile0.txt" exists
  43. Scenario: deleting a file from a subfolder and restoring it moves it back to the subfolder
  44. Given As an "admin"
  45. And user "user0" exists
  46. When User "user0" created a folder "/testfolder"
  47. And User "user0" moves file "/textfile0.txt" to "/testfolder/textfile0.txt"
  48. And as "user0" the file "/testfolder/textfile0.txt" exists
  49. And User "user0" deletes file "/testfolder/textfile0.txt"
  50. And user "user0" in trash folder "/" should have 1 element
  51. And user "user0" in trash folder "/" should have the following elements
  52. | textfile0.txt |
  53. And user "user0" in restores "/textfile0.txt" from trash
  54. Then user "user0" in trash folder "/" should have 0 elements
  55. And as "user0" the file "/textfile0.txt" does not exist
  56. And as "user0" the file "/testfolder/textfile0.txt" exists
  57. Scenario: deleting and a folder and restoring a file inside it
  58. Given As an "admin"
  59. And user "user0" exists
  60. When User "user0" created a folder "/testfolder"
  61. And User "user0" moves file "/textfile0.txt" to "/testfolder/textfile0.txt"
  62. And as "user0" the file "/testfolder/textfile0.txt" exists
  63. And User "user0" deletes file "/testfolder"
  64. And user "user0" in trash folder "/" should have 1 element
  65. And user "user0" in trash folder "/" should have the following elements
  66. | testfolder |
  67. And user "user0" in trash folder "/testfolder" should have 1 element
  68. And user "user0" in trash folder "/testfolder" should have the following elements
  69. | textfile0.txt |
  70. And user "user0" in restores "/testfolder/textfile0.txt" from trash
  71. Then user "user0" in trash folder "/" should have 1 elements
  72. And user "user0" in trash folder "/testfolder" should have 0 element
  73. And as "user0" the file "/textfile0.txt" exists