Skip to content

Commit

Permalink
Merge pull request #36283 from owncloud/test-share-same-group-user
Browse files Browse the repository at this point in the history
Add acceptance tests for checking that share with group and user with same name works
  • Loading branch information
phil-davis authored Oct 17, 2019
2 parents f6688b7 + 29db647 commit 2afd864
Show file tree
Hide file tree
Showing 2 changed files with 168 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1346,3 +1346,95 @@ Feature: sharing
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@issue-35488
Scenario: creating a new share with user and a group having same name
Given these users have been created without skeleton files:
| username |
| user1 |
| user2 |
And group "user1" has been created
And user "user2" has been added to group "user1"
And user "user0" has uploaded file with content "user0 file" to "/randomfile.txt"
And user "user0" has shared file "randomfile.txt" with group "user1"
When user "user0" shares file "randomfile.txt" with user "user1" using the sharing API
# Replace these lines when issue is fixed
# Then the OCS status code should be "100"
# And the HTTP status code should be "200"
Then the OCS status message should be:
"""
Path already shared with this user
"""
Then the OCS status code should be "403"
And the HTTP status code should be "200"
# And user "user1" should see the following elements
# | /randomfile.txt |
And user "user2" should see the following elements
| /randomfile.txt |
# And the content of file "randomfile.txt" for user "user1" should be "user0 file"
And the content of file "randomfile.txt" for user "user2" should be "user0 file"

@issue-35488
Scenario: creating a new share with group and a user having same name
Given these users have been created without skeleton files:
| username |
| user1 |
| user2 |
And group "user1" has been created
And user "user2" has been added to group "user1"
And user "user0" has uploaded file with content "user0 file" to "/randomfile.txt"
And user "user0" has shared file "randomfile.txt" with user "user1"
When user "user0" shares file "randomfile.txt" with group "user1" using the sharing API
# Replace these lines when issue is fixed
# Then the OCS status code should be "100"
# And the HTTP status code should be "200"
Then the OCS status message should be:
"""
Path already shared with this group
"""
Then the OCS status code should be "403"
And the HTTP status code should be "200"
# And user "user2" should see the following elements
# | /randomfile.txt |
And user "user1" should see the following elements
| /randomfile.txt |
# And the content of file "randomfile.txt" for user "user2" should be "user0 file"
And the content of file "randomfile.txt" for user "user1" should be "user0 file"

Scenario: creating a new share with user and a group having same name but different case
Given these users have been created without skeleton files:
| username |
| user1 |
| user2 |
And group "User1" has been created
And user "user2" has been added to group "User1"
And user "user0" has uploaded file with content "user0 file" to "/randomfile.txt"
And user "user0" has shared file "randomfile.txt" with group "User1"
When user "user0" shares file "randomfile.txt" with user "user1" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "user1" should see the following elements
| /randomfile.txt |
And user "user2" should see the following elements
| /randomfile.txt |
And the content of file "randomfile.txt" for user "user1" should be "user0 file"
And the content of file "randomfile.txt" for user "user2" should be "user0 file"

Scenario: creating a new share with group and a user having same name but different case
Given these users have been created without skeleton files:
| username |
| user1 |
| user2 |
And group "User1" has been created
And user "user2" has been added to group "User1"
And user "user0" has uploaded file with content "user0 file" to "/randomfile.txt"
And user "user0" has shared file "randomfile.txt" with user "user1"
When user "user0" shares file "randomfile.txt" with group "User1" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "user2" should see the following elements
| /randomfile.txt |
And user "user1" should see the following elements
| /randomfile.txt |
And the content of file "randomfile.txt" for user "user2" should be "user0 file"
And the content of file "randomfile.txt" for user "user1" should be "user0 file"
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,79 @@ Feature: Sharing files and folders with internal groups
| group |
| ?\?@#%@,; |
| नेपाली |

@issue-35488
Scenario: Share file with a user and a group with same name
Given these users have been created with default attributes and without skeleton files:
| username |
| user1 |
And user "user3" has been created with default attributes and skeleton files
And these groups have been created:
| groupname |
| user1 |
And user "user1" has been added to group "user1"
And user "user3" has logged in using the webUI
When the user shares folder "simple-folder" with user "User One" using the webUI
And the user shares folder "simple-folder" with group "user1" using the webUI
# Remove this after issue is fixed
Then a notification should be displayed on the webUI with the text "Path already shared with this group"
When the user re-logs in as "user1" using the webUI
Then folder "simple-folder" should be marked as shared by "User Three" on the webUI
# Uncomment this line after issue is fixed
# And folder "simple-folder" should be marked as shared with "user1" by "User Three" on the webUI

@issue-35488
Scenario: Share file with a group and a user with same name
Given these users have been created with default attributes and without skeleton files:
| username |
| user1 |
And user "user3" has been created with default attributes and skeleton files
And these groups have been created:
| groupname |
| user1 |
And user "user1" has been added to group "user1"
And user "user3" has logged in using the webUI
When the user shares folder "simple-folder" with group "user1" using the webUI
And the user shares folder "simple-folder" with user "User One" using the webUI
# Remove this after issue is fixed
Then a notification should be displayed on the webUI with the text "Path already shared with this user"
When the user re-logs in as "user1" using the webUI
Then folder "simple-folder" should be marked as shared with "user1" by "User Three" on the webUI
# Uncomment this line after issue is fixed
# And folder "simple-folder" should be marked as shared with "User One" by "User Three" on the webUI

Scenario: Share file with a user and again with a group with same name but different case
Given these users have been created with default attributes and without skeleton files:
| username |
| user1 |
| user2 |
And user "user3" has been created with default attributes and skeleton files
And these groups have been created:
| groupname |
| User1 |
And user "user2" has been added to group "User1"
And user "user3" has logged in using the webUI
When the user shares folder "simple-folder" with user "User One" using the webUI
And the user shares folder "simple-folder" with group "User1" using the webUI
When the user re-logs in as "user1" using the webUI
Then folder "simple-folder" should be marked as shared by "User Three" on the webUI
When the user re-logs in as "user2" using the webUI
And folder "simple-folder" should be marked as shared with "User1" by "User Three" on the webUI

Scenario: Share file with a group and again with a user with same name but different case
Given these users have been created with default attributes and without skeleton files:
| username |
| user1 |
| user2 |
And user "user3" has been created with default attributes and skeleton files
And these groups have been created:
| groupname |
| User1 |
And user "user2" has been added to group "User1"
And user "user3" has logged in using the webUI
When the user shares folder "simple-folder" with group "User1" using the webUI
And the user shares folder "simple-folder" with user "User One" using the webUI
When the user re-logs in as "user1" using the webUI
Then folder "simple-folder" should be marked as shared by "User Three" on the webUI
When the user re-logs in as "user2" using the webUI
Then folder "simple-folder" should be marked as shared with "User1" by "User Three" on the webUI

0 comments on commit 2afd864

Please sign in to comment.