Skip to content

Commit

Permalink
[Tests-Only] Refactor webUISharingNotifications to use Shares folder
Browse files Browse the repository at this point in the history
  • Loading branch information
haribhandari07 committed Sep 30, 2020
1 parent 0e72ee6 commit 6733871
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ config = {
'webUISharingFilePermissionMultipleUsers': 'SharingFilePermissionMultipleUsers',
'webUISharingFolderPermissionMultipleUsers': 'SharingFolderPermissionMultipleUsers',
'webUISharingFolderAdvancedPermissionMultipleUsers': 'SharingFolderAdvancedPermissionMU',
'webUISharingNotifications': 'SharingNotifications',
'webUISharingNotificationsToRoot': 'SharingNotificationsRoot',
'webUISharingNotificationsToShares': 'SharingNotificationsShares',
'webUIAccount': 'Account',
'webUIMoveFilesFolders': 'Move',
'WebUIPreview': 'Preview'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@app-required @notifications-app-required @skipOnOCIS @ocis-reva-issue-64
@app-required @notifications-app-required @skipOnOCIS
Feature: Display notifications when receiving a share and follow embedded links
As a user
I want to use the notification header as a link
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@app-required @notifications-app-required @skipOnOCIS @ocis-reva-issue-64
@app-required @notifications-app-required @skipOnOCIS
Feature: Sharing files and folders with internal groups
As a user
I want to share files and folders with groups
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@app-required @notifications-app-required @skipOnOCIS @ocis-reva-issue-64
@app-required @notifications-app-required @skipOnOCIS
Feature: Sharing files and folders with internal users
As a user
I want to share files and folders with other users
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@app-required @notifications-app-required @ocis-reva-issue-64
Feature: Display notifications when receiving a share and follow embedded links
As a user
I want to use the notification header as a link
So that I will be redirected to the most appropriate screen

Background:
Given app "notifications" has been enabled
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
And user "user2" has logged in using the webUI

@smokeTest
@skip @yetToImplement
Scenario: notification link redirection in case a share is pending
Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been disabled
And user "user1" has shared folder "/simple-folder" with user "user2"
When the user follows the link of the first notification on the webUI
Then the user should be redirected to a webUI page with the title "Shared with you - %productname%"
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@app-required @notifications-app-required @ocis-reva-issue-64
Feature: Sharing files and folders with internal groups
As a user
I want to share files and folders with groups
So that those groups can access the files and folders

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"
And app "notifications" has been enabled
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
| user3 |
And these groups have been created:
| groupname |
| grp1 |
And user "user1" has been added to group "grp1"
And user "user2" has been added to group "grp1"
And user "user2" has logged in using the webUI

Scenario: notifications about new share is displayed
Given user "user3" has shared folder "/simple-folder" with group "grp1"
And user "user3" has shared folder "/data.zip" with group "grp1"
When the user reloads the current page of the webUI
Then the user should see the notification bell on the webUI
And the user should see 2 notifications on the webUI with these details
| title |
| "User Three" shared "simple-folder" with you |
| "User Three" shared "data.zip" with you |
When the user re-logs in as "user1" using the webUI
Then the user should see 2 notifications on the webUI with these details
| title |
| "User Three" shared "simple-folder" with you |
| "User Three" shared "data.zip" with you |

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@app-required @notifications-app-required @ocis-reva-issue-64
Feature: Sharing files and folders with internal users
As a user
I want to share files and folders with other users
So that those users can access the files and folders

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"
And app "notifications" has been enabled
And these users have been created with default attributes:
| username |
| user1 |
| user2 |

@smokeTest
Scenario: notifications about new share is displayed when auto-accepting is disabled
Given user "user1" has shared folder "simple-folder" with user "user2"
And user "user1" has shared folder "data.zip" with user "user2"
When user "user2" logs in using the webUI
Then the user should see the notification bell on the webUI
And the user should see 2 notifications on the webUI with these details
| title |
| "User One" shared "simple-folder" with you |
| "User One" shared "data.zip" with you |

@smokeTest
Scenario: Notification is gone after accepting a share
Given user "user1" has shared folder "simple-folder" with user "user2"
And user "user1" has shared folder "simple-empty-folder" with user "user2"
When user "user2" logs in using the webUI
And the user accepts all shares displayed in the notifications on the webUI
Then the user should have no notifications

@smokeTest
Scenario: accept an offered share
Given user "user1" has shared folder "simple-folder" with user "user2"
And user "user1" has shared folder "simple-empty-folder" with user "user2"
When user "user2" logs in using the webUI
And the user accepts all shares displayed in the notifications on the webUI
And the user browses to the folder "Shares" on the files page
Then folder "simple-folder" should be listed on the webUI
And folder "simple-empty-folder" should be listed on the webUI
When the user browses to the shared-with-me page using the webUI
Then folder "simple-folder" shared by "User One" should be in "Accepted" state on the webUI
And folder "simple-empty-folder" shared by "User One" should be in "Accepted" state on the webUI

@smokeTest
Scenario: reject an offered share
Given user "user1" has shared folder "simple-folder" with user "user2"
And user "user1" has shared folder "simple-empty-folder" with user "user2"
When user "user2" logs in using the webUI
And the user declines all shares displayed in the notifications on the webUI
Then folder "Shares" should not be listed on the webUI
And folder "simple-folder (2)" should not be listed on the webUI
And folder "simple-empty-folder (2)" should not be listed on the webUI
When the user browses to the shared-with-me page using the webUI
Then folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI
And folder "simple-empty-folder" shared by "User One" should be in "Declined" state on the webUI

0 comments on commit 6733871

Please sign in to comment.