-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests-Only] Add api trashbin tests (#1123)
- Loading branch information
1 parent
c0f54e1
commit 6cf7912
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
tests/acceptance/features/apiOcisSpecific/apiTrashbin-trashbinDelete.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@api @files_trashbin-app-required | ||
Feature: files and folders can be deleted from the trashbin | ||
As a user | ||
I want to delete files and folders from the trashbin | ||
So that I can control my trashbin space and which files are kept in that space | ||
|
||
Background: | ||
Given user "Alice" has been created with default attributes and without skeleton files | ||
And user "Alice" has uploaded file with content "to delete" to "/textfile0.txt" | ||
And user "Alice" has uploaded file with content "to delete" to "/textfile1.txt" | ||
And user "Alice" has created folder "PARENT" | ||
And user "Alice" has created folder "PARENT/CHILD" | ||
And user "Alice" has uploaded file with content "to delete" to "/PARENT/parent.txt" | ||
And user "Alice" has uploaded file with content "to delete" to "/PARENT/CHILD/child.txt" | ||
|
||
@smokeTest | ||
@issue-product-139 | ||
@issue-product-178 | ||
@issue-product-179 | ||
Scenario Outline: Trashbin cannot be emptied | ||
# after fixing all issues delete this Scenario and use the one from oC10 core | ||
Given user "Alice" has uploaded file with content "file with comma" to "sample,0.txt" | ||
And user "Alice" has uploaded file with content "file with comma" to "sample,1.txt" | ||
And using <dav-path> DAV path | ||
And user "Alice" has deleted file "<filename1>" | ||
And user "Alice" has deleted file "<filename2>" | ||
And as "Alice" file "<filename1>" should exist in the trashbin | ||
And as "Alice" file "<filename2>" should exist in the trashbin | ||
When user "Alice" empties the trashbin using the trashbin API | ||
Then as "Alice" the file with original path "<filename1>" should exist in the trashbin | ||
And as "Alice" the file with original path "<filename2>" should exist in the trashbin | ||
Examples: | ||
| dav-path | filename1 | filename2 | | ||
| old | textfile0.txt | textfile1.txt | | ||
| old | sample,0.txt | sample,1.txt | | ||
| new | textfile0.txt | textfile1.txt | | ||
| new | sample,0.txt | sample,1.txt | | ||
|
||
@smokeTest | ||
@issue-ocis-reva-118 | ||
@issue-product-179 | ||
# after fixing all issues delete this Scenario and use the one from oC10 core | ||
Scenario: delete a single file from the trashbin | ||
Given user "Alice" has deleted file "/textfile0.txt" | ||
And user "Alice" has deleted file "/textfile1.txt" | ||
And user "Alice" has deleted file "/PARENT/parent.txt" | ||
And user "Alice" has deleted file "/PARENT/CHILD/child.txt" | ||
When user "Alice" deletes the file with original path "textfile1.txt" from the trashbin using the trashbin API | ||
Then the HTTP status code should be "405" | ||
And as "Alice" the file with original path "/textfile1.txt" should exist in the trashbin | ||
But 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 |
36 changes: 36 additions & 0 deletions
36
tests/acceptance/features/apiOcisSpecific/apiTrashbin-trashbinFilesFolders.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@api @files_trashbin-app-required | ||
Feature: files and folders exist in the trashbin after being deleted | ||
As a user | ||
I want deleted files and folders to be available in the trashbin | ||
So that I can recover data easily | ||
|
||
Background: | ||
Given user "Alice" has been created with default attributes and skeleton files | ||
|
||
@smokeTest | ||
@issue-product-178 | ||
# after fixing all issues delete this Scenario and use the one from oC10 core | ||
Scenario: deleting a file moves it to trashbin | ||
Given using old DAV path | ||
When user "Alice" deletes file "/textfile0.txt" using the WebDAV API | ||
And using new DAV path | ||
When user "Alice" deletes file "/textfile1.txt" using the WebDAV API | ||
Then as "Alice" the file with original path "/textfile0.txt" should exist in the trashbin | ||
And as "Alice" the file with original path "/textfile1.txt" should exist in the trashbin | ||
And as "Alice" file "/textfile0.txt" should not exist | ||
And as "Alice" file "/textfile1.txt" should not exist | ||
|
||
@smokeTest | ||
@issue-product-178 | ||
# after fixing all issues delete this Scenario and use the one from oC10 core | ||
Scenario: deleting a folder moves it to trashbin | ||
Given user "Alice" has created folder "/tmp1" | ||
And user "Alice" has created folder "/tmp2" | ||
And using old DAV path | ||
When user "Alice" deletes folder "/tmp1" using the WebDAV API | ||
And using new DAV path | ||
When user "Alice" deletes folder "/tmp2" using the WebDAV API | ||
Then as "Alice" the folder with original path "/tmp1" should exist in the trashbin | ||
And as "Alice" the folder with original path "/tmp2" should exist in the trashbin | ||
And as "Alice" folder "/tmp1" should not exist | ||
And as "Alice" folder "/tmp2" should not exist |