trashbin.feature 3.6 KB

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