Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] test trashbin with multi level folders #38225

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tests/acceptance/features/apiTrashbin/trashbinDelete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,35 @@ Feature: files and folders can be deleted from the trashbin
And as "Alice" the file with original path "/textfile0.txt" should exist in the trashbin
And as "Alice" the file with original path "/PARENT/parent.txt" should exist in the trashbin
And as "Alice" the file with original path "/PARENT/CHILD/child.txt" should exist in the trashbin


Scenario: delete a folder that contains a file from the trashbin
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created folder "FOLDER/CHILD"
And user "Alice" has uploaded file with content "to delete" to "/FOLDER/parent.txt"
And user "Alice" has uploaded file with content "to delete" to "/FOLDER/CHILD/child.txt"
And user "Alice" has deleted folder "/PARENT"
And user "Alice" has deleted folder "/FOLDER"
When user "Alice" deletes the folder with original path "/PARENT" from the trashbin using the trashbin API
Then the HTTP status code should be "204"
And as "Alice" the file with original path "/PARENT/parent.txt" should not exist in the trashbin
And as "Alice" the file with original path "/PARENT/CHILD/child.txt" should not exist in the trashbin
And as "Alice" the folder with original path "/PARENT/CHILD/" should not exist in the trashbin
But as "Alice" the file with original path "/FOLDER/parent.txt" should exist in the trashbin
And as "Alice" the file with original path "/FOLDER/CHILD/child.txt" should exist in the trashbin


Scenario: delete a subfolder from a deleted folder from the trashbin
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created folder "FOLDER/CHILD"
And user "Alice" has uploaded file with content "to delete" to "/FOLDER/parent.txt"
And user "Alice" has uploaded file with content "to delete" to "/FOLDER/CHILD/child.txt"
And user "Alice" has deleted folder "/PARENT"
And user "Alice" has deleted folder "/FOLDER"
When user "Alice" deletes the folder with original path "/PARENT/CHILD" from the trashbin using the trashbin API
Then the HTTP status code should be "204"
And as "Alice" the file with original path "/PARENT/CHILD/child.txt" should not exist in the trashbin
And as "Alice" the folder with original path "/PARENT/CHILD/" should not exist in the trashbin
But as "Alice" the file with original path "/PARENT/parent.txt" should exist in the trashbin
But as "Alice" the file with original path "/FOLDER/parent.txt" should exist in the trashbin
And as "Alice" the file with original path "/FOLDER/CHILD/child.txt" should exist in the trashbin
15 changes: 15 additions & 0 deletions tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,18 @@ Feature: files and folders exist in the trashbin after being deleted
| dav-path |
| old |
| new |


Scenario Outline: deleting a folder moves all its content to the trashbin
Given using <dav-path> DAV path
And user "Alice" has created folder "/new-folder"
And user "Alice" has moved file "/textfile0.txt" to "/new-folder/new-file.txt"
When user "Alice" deletes folder "/new-folder/" using the WebDAV API
Then as "Alice" the file with original path "/new-folder/new-file.txt" should exist in the trashbin
Then as "Alice" the folder with original path "/new-folder/" should exist in the trashbin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then as "Alice" the folder with original path "/new-folder/" should exist in the trashbin
And as "Alice" the folder with original path "/new-folder/" should exist in the trashbin

And as "Alice" file "/new-folder/new-file.txt" should exist in the trashbin
But as "Alice" file "/new-folder/new-file.txt" should not exist
Examples:
| dav-path |
| old |
| new |
55 changes: 55 additions & 0 deletions tests/acceptance/features/apiTrashbin/trashbinRestore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,58 @@ Feature: Restore deleted files/folders
| dav-path |
| old |
| new |


Scenario Outline: A deleted multi level folder can be restored including the content
Given using <dav-path> DAV path
And user "Alice" has created folder "/new-folder"
And user "Alice" has created folder "/new-folder/folder1/"
And user "Alice" has created folder "/new-folder/folder1/folder2/"
And user "Alice" has moved file "/textfile0.txt" to "/new-folder/folder1/folder2/new-file.txt"
And user "Alice" has deleted folder "/new-folder/"
When user "Alice" restores the folder with original path "/new-folder/" using the trashbin API
Then the HTTP status code should be "201"
And as "Alice" the file with original path "/new-folder/folder1/folder2/new-file.txt" should not exist in the trashbin
And as "Alice" file "/new-folder/folder1/folder2/new-file.txt" should exist
Examples:
| dav-path |
| old |
| new |


Scenario Outline: A subfolder from a deleted multi level folder can be restored including the content
Given using <dav-path> DAV path
And user "Alice" has created folder "/new-folder"
And user "Alice" has created folder "/new-folder/folder1/"
And user "Alice" has created folder "/new-folder/folder1/folder2/"
And user "Alice" has moved file "/textfile0.txt" to "/new-folder/folder1/folder2/new-file.txt"
And user "Alice" has deleted folder "/new-folder/"
When user "Alice" restores the folder with original path "/new-folder/folder1" to "/folder1" using the trashbin API
Then the HTTP status code should be "201"
And as "Alice" the file with original path "/new-folder/folder1/folder2/new-file.txt" should not exist in the trashbin
And as "Alice" the folder with original path "/new-folder/folder1/" should not exist in the trashbin
And as "Alice" file "/folder1/folder2/new-file.txt" should exist
But as "Alice" the folder with original path "/new-folder/" should exist in the trashbin
Examples:
| dav-path |
| old |
| new |


Scenario Outline: A file from a deleted multi level sub-folder can be restored
Given using <dav-path> DAV path
And user "Alice" has created folder "/new-folder"
And user "Alice" has created folder "/new-folder/folder1/"
And user "Alice" has created folder "/new-folder/folder1/folder2/"
And user "Alice" has moved file "/textfile0.txt" to "/new-folder/folder1/folder2/new-file.txt"
And user "Alice" has uploaded file with content "to delete" to "/new-folder/folder1/folder2/not-restored.txt"
And user "Alice" has deleted folder "/new-folder/"
When user "Alice" restores the file with original path "/new-folder/folder1/folder2/new-file.txt" to "new-file.txt" using the trashbin API
Then the HTTP status code should be "201"
And as "Alice" the file with original path "/new-folder/folder1/folder2/new-file.txt" should not exist in the trashbin
And as "Alice" file "/new-file.txt" should exist
But as "Alice" the file with original path "/new-folder/folder1/folder2/not-restored.txt" should exist in the trashbin
Examples:
| dav-path |
| old |
| new |