-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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] Adds api tests for renaming received shares #38262
Conversation
3928966
to
fcd75b5
Compare
Scenario: receiver renames a received share to different name on the same folder | ||
Given user "Alice" has shared folder "PARENT" with user "Brian" | ||
And user "Brian" has accepted share "/PARENT" offered by user "Alice" | ||
When user "Brian" moves folder "/Shares/PARENT" to "/Shares/myFolder" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" folder "/Shares/myFolder" should exist | ||
But as "Alice" folder "myFolder" should not exist | ||
|
||
Scenario: receiver renames a received file share to different name on the same folder | ||
Given user "Alice" has shared file "textfile0.txt" with user "Brian" | ||
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" | ||
When user "Brian" moves file "/Shares/textfile0.txt" to "/Shares/newFile.txt" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" file "/Shares/newFile.txt" should exist | ||
But as "Alice" file "newFile.txt" should not exist | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make these two scenarios into a single scenario like here
core/tests/acceptance/features/apiFederationToShares2/federated.feature
Lines 192 to 193 in 83017e5
When user "Brian" moves folder "/Shares/RandomFolder/sub-folder" to "/Shares/RandomFolder/renamed-sub-folder" using the WebDAV API | |
And user "Brian" moves file "/Shares/RandomFolder/file-to-share" to "/Shares/RandomFolder/renamedFile" using the WebDAV API |
Scenario: receiver renames a received share to different name on the same folder for group sharing | ||
Given group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has shared folder "PARENT" with group "grp1" | ||
And user "Brian" has accepted share "/PARENT" offered by user "Alice" | ||
When user "Brian" moves folder "/Shares/PARENT" to "/Shares/myFolder" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" folder "/Shares/myFolder" should exist | ||
But as "Alice" folder "myFolder" should not exist | ||
|
||
Scenario: receiver renames a received file share to different name on the same folder for group sharing | ||
Given group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has shared file "textfile0.txt" with group "grp1" | ||
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" | ||
When user "Brian" moves file "/Shares/textfile0.txt" to "/Shares/newFile.txt" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" file "/Shares/newFile.txt" should exist | ||
But as "Alice" file "newFile.txt" should not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@@ -99,3 +99,115 @@ Feature: sharing | |||
And as "Brian" file "/myFolder/renamedFile" should not exist | |||
But as "Brian" file "/myFolder/fileInside" should exist | |||
|
|||
Scenario: receiver renames a received share to different name on the same folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenario: receiver renames a received share to different name on the same folder | |
Scenario: receiver renames a received folder share to a different name on the same folder |
Then the HTTP status code should be "403" | ||
And as "Brian" file "/myFolder/renamedFile" should not exist | ||
But as "Brian" file "/myFolder/parent.txt" should exist | ||
But as "Alice" file "/PARENT/parent.txt" should exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And
When user "Alice" shares folder "<sharer_folder>" with user "Brian" using the sharing API | ||
And user "Brian" accepts share "/<sharer_folder>" offered by user "Alice" using the sharing API | ||
And user "Brian" moves folder "/Shares/<sharer_folder>" to "/Shares/<receiver_folder>" using the WebDAV API | ||
Then the HTTP status code should be "201" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Given
steps? 🤔
And as "Brian" folder "Shares/PARENT/new-folder" should exist | ||
And as "Alice" folder "PARENT/new-folder" should exist | ||
But as "Alice" folder "PARENT/CHILD" should not exist | ||
When user "Brian" moves file "/Shares/PARENT/parent.txt" to "/Shares/PARENT/newFile.txt" using the WebDAV API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split scenarios for file and folder. in this case, if the move fails for the folder, the file move wouldn't get a chance to be checkded
7e9b8a3
to
c5bdaa2
Compare
c5bdaa2
to
1cc6b4c
Compare
Scenario: receiver renames a received share to different name on the same folder for group sharing | ||
Given group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has shared folder "PARENT" with group "grp1" | ||
And user "Brian" has accepted share "/PARENT" offered by user "Alice" | ||
And user "Alice" has shared file "textfile0.txt" with group "grp1" | ||
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" | ||
When user "Brian" moves folder "/Shares/PARENT" to "/Shares/myFolder" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" folder "/Shares/myFolder" should exist | ||
But as "Alice" folder "myFolder" should not exist | ||
When user "Brian" moves file "/Shares/textfile0.txt" to "/Shares/newFile.txt" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" file "/Shares/newFile.txt" should exist | ||
But as "Alice" file "newFile.txt" should not exist | ||
|
||
Scenario: receiver renames a received share with share, read, change permissions in group sharing | ||
Given group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has shared folder "PARENT" with group "grp1" with permissions "share,read,change" | ||
And user "Brian" has accepted share "/PARENT" offered by user "Alice" | ||
When user "Brian" moves folder "/Shares/PARENT" to "myFolder" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" folder "myFolder" should exist | ||
But as "Alice" folder "myFolder" should not exist | ||
When user "Brian" moves file "/myFolder/parent.txt" to "/myFolder/renamedFile" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" file "/myFolder/renamedFile" should exist | ||
And as "Alice" file "/PARENT/renamedFile" should exist | ||
But as "Alice" file "/PARENT/parent.txt" should not exist | ||
|
||
Scenario: receiver tries to rename a received share with share, read permissions in group sharing | ||
Given group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has shared folder "PARENT" with group "grp1" with permissions "share,read" | ||
And user "Brian" has accepted share "/PARENT" offered by user "Alice" | ||
When user "Brian" moves folder "/Shares/PARENT" to "/myFolder" using the WebDAV API | ||
Then the HTTP status code should be "201" | ||
And as "Brian" folder "myFolder" should exist | ||
But as "Alice" folder "myFolder" should not exist | ||
When user "Brian" moves file "/myFolder/parent.txt" to "/myFolder/renamedFile" using the WebDAV API | ||
Then the HTTP status code should be "403" | ||
And as "Brian" file "/myFolder/renamedFile" should not exist | ||
And as "Brian" file "/myFolder/parent.txt" should exist | ||
And as "Alice" file "/PARENT/parent.txt" should exist | ||
But as "Alice" file "/PARENT/renamedFile" should not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these all scenarios should be separated for files and folders.
1cc6b4c
to
56a02f8
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Description
Adds tests for renaming received shares
Related Issue
How Has This Been Tested?
🤖
Screenshots (if appropriate):
Types of changes
Checklist: