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] Refactor restrict sharing and auto completion tests #4108

Merged
merged 2 commits into from
Sep 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Feature: disable sharing
So that users cannot share files

Background:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
Given user "user1" has been created with default attributes
Comment on lines +8 to 10
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
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
Given user "user1" has been created with default attributes
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And user "user1" has been created with default attributes


@smokeTest
Expand All @@ -26,15 +28,18 @@ Feature: disable sharing
Scenario: Check file presence in shared-with-me page when sharing is disabled
Given user "user2" has been created with default attributes
And user "user2" has shared file "lorem.txt" with user "user1"
And user "user1" has accepted the share "lorem.txt" offered by user "user2"
And user "user2" has shared folder "simple-folder" with user "user1"
And user "user1" has accepted the share "simple-folder" offered by user "user2"
And the setting "shareapi_enabled" of app "core" has been set to "no"
When user "user1" logs in using the webUI
Then file "lorem (2).txt" should be listed on the webUI
And folder "simple-folder (2)" should be listed on the webUI
When the user opens folder "Shares" using the webUI
Then file "lorem.txt" should be listed on the webUI
And folder "simple-folder" should be listed on the webUI
# And the link for "shared-with-me" page should not be available in files page menu
When the user browses to the shared-with-me page
Then file "lorem (2).txt" should not be listed on the webUI
And folder "simple-folder (2)" should not be listed on the webUI
Then file "lorem.txt" should not be listed on the webUI
And folder "simple-folder" should not be listed on the webUI

@issue-2459
Scenario: Check file presence in shared-with-others page when Sharing is disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Feature: restrict resharing
I want to be able to forbid a user that received a share from me to share it further

Background:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
Given these users have been created with default attributes:
| username |
Comment on lines +9 to 12
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
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
Given these users have been created with default attributes:
| username |
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |

| user1 |
Expand All @@ -22,22 +24,28 @@ Feature: restrict resharing
Scenario: disable resharing and check if the received resource can be reshared
Given the setting "shareapi_allow_resharing" of app "core" has been set to "no"
And user "user2" has shared folder "simple-folder" with user "user1"
And user "user1" has favorited element "simple-folder (2)"
And user "user1" has accepted the share "simple-folder" offered by user "user2"
And user "user1" has favorited element "/Shares/simple-folder"
When user "user1" logs in using the webUI
Then the user should not be able to share folder "simple-folder (2)" using the webUI
And the user opens folder "Shares" using the webUI
Then the user should not be able to share folder "simple-folder" using the webUI
When the user browses to the shared-with-me page
# Then the user should not be able to share folder "simple-folder (2)" using the webUI
And the user shares folder "simple-folder (2)" with user "User Three" as "Editor" using the webUI
And the user shares folder "simple-folder" with user "User Three" as "Editor" using the webUI
Then the error message with header "Error while sharing." should be displayed on the webUI
And as "user3" folder "simple-folder (2)" should not exist
And as "user3" folder "simple-folder" should not exist
When the user browses to the favorites page
Then the user should not be able to share folder "simple-folder (2)" using the webUI
Then the user should not be able to share folder "Shares/simple-folder" using the webUI

@smokeTest
Scenario: disable resharing and check if the received resource from group share can be reshared
Given the setting "shareapi_allow_resharing" of app "core" has been set to "no"
And user "user3" has shared file "lorem.txt" with group "grp1"
And user "user1" has accepted the share "lorem.txt" offered by user "user3"
And user "user2" has accepted the share "lorem.txt" offered by user "user3"
When user "user1" logs in using the webUI
Then the user should not be able to share file "lorem (2).txt" using the webUI
And the user opens folder "Shares" using the webUI
Then the user should not be able to share file "lorem.txt" using the webUI
When the user re-logs in as "user2" using the webUI
Then the user should not be able to share file "lorem (2).txt" using the webUI
And the user opens folder "Shares" using the webUI
Then the user should not be able to share file "lorem.txt" using the webUI
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Feature: restrict Sharing
So that users can only share files with specific users and groups

Background:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
Given these users have been created with default attributes:
| username |
Comment on lines +9 to 11
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
And the administrator has set the default folder for received shares to "Shares"
Given these users have been created with default attributes:
| username |
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |

| user1 |
Expand Down Expand Up @@ -40,7 +42,8 @@ Feature: restrict Sharing
Scenario: Do not restrict users to only share with groups they are member of
Given the setting "shareapi_only_share_with_membership_groups" of app "core" has been set to "no"
When the user shares folder "simple-folder" with group "grp2" as "Viewer" using the webUI
Then as "user3" folder "simple-folder (2)" should exist
And user "user3" accepts the share "simple-folder" offered by user "user2" using the sharing API
Then as "user3" folder "/Shares/simple-folder" should exist

@smokeTest
Scenario: Forbid sharing with groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Feature: Autocompletion of share-with names
So that I can efficiently share my files with other users or groups

Background:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
# Users that are in the special known users already
Given these users have been created with default attributes but not initialized:
And these users have been created with default attributes but not initialized:
| username |
| user1 |
| user3 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Autocompletion of share-with names
So that I can efficiently share my files with other users or groups

Background:
Given these users have been created with default attributes but not initialized:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes but not initialized:
| username |
| regularuser |
And these users have been created but not initialized:
Expand Down