Skip to content

Commit

Permalink
[Tests-Only] add tests for sharing the shares_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dpakach committed May 27, 2021
1 parent 0752b56 commit a546051
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,7 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUITrashbinDelete/trashbinDelete.feature:106](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L106)
- [webUITrashbinDelete/trashbinDelete.feature:86](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L86)
- [webUITrashbinDelete/trashbinDelete.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L50)

### [Trying to create a (public) link share of the Shares folder throws an error](https://github.com/owncloud/web/issues/5152)
- [webUISharingInternalUsers/shareWithUsers.feature:364](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L364)
- [webUISharingPublicBasic/publicLinkCreate.feature:195](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L195)
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Feature: Sharing files and folders with internal users
When the user re-logs in as "Brian" using the webUI
Then folder "new-simple-folder" should be listed on the webUI
And the content of file "new-simple-folder/lorem.txt" for user "Brian" should be "text file"

@issue-product-270
Scenario: share a folder with another internal user and prohibit deleting
Given user "Brian" has created file "simple-folder/lorem.txt"
Expand Down Expand Up @@ -358,4 +358,13 @@ Feature: Sharing files and folders with internal users
When the user deletes "Brian Murphy" as collaborator for the current file using the webUI
Then user "Brian Murphy" should not be listed in the collaborators list on the webUI
And file "lorem.txt" should not be listed in shared-with-others page on the webUI
And as "Brian" file "Shares/lorem.txt" should not exist
And as "Brian" file "Shares/lorem.txt" should not exist


Scenario: Sharing the share_folder to user is not possible
Given user "Carol" has been created with default attributes and without skeleton files
And user "Brian" has shared folder "simple-folder" with user "Alice"
And user "Alice" has accepted the share "simple-folder" offered by user "Brian"
And user "Alice" has logged in using the webUI
When the user opens the share dialog for file "Shares" using the webUI
Then the share permission denied message should be displayed in the sharing dialog on the webUI
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,18 @@ Feature: Create public link shares
"""
Public link created
Public link has been successfully created and copied into your clipboard.
"""
"""


Scenario: Sharing the share_folder as public link is not possible
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 "Brian" has been created with default attributes and without skeleton files
And user "Brian" has created folder "simple-folder"
And user "Carol" has been created with default attributes and without skeleton files
And user "Brian" has shared folder "simple-folder" with user "Alice"
And user "Alice" has accepted the share "simple-folder" offered by user "Brian"
And user "Alice" has logged in using the webUI
When the user creates a new public link for folder "Shares" using the webUI with
| name | link |
Then the user should see an error message on the public link share dialog saying "Path contains files shared with you"
17 changes: 17 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,26 @@ module.exports = {
}
)
return message
},
/**
*
* @returns {Promise<string>}
*/
getSharePermissionMessage: async function() {
let message
await this.waitForElementVisible('@sharingPermissionDisabledMessage').getText(
this.elements.sharingPermissionDisabledMessage.selector,
function(result) {
message = result.value
}
)
return message
}
},
elements: {
sharingPermissionDisabledMessage: {
selector: '.files-collaborators-no-reshare-permissions-message'
},
collaboratorErrorAlert: {
selector: '//div[contains(@class, "collaborator-error-alert")]',
locateStrategy: 'xpath'
Expand Down
10 changes: 10 additions & 0 deletions tests/acceptance/stepDefinitions/sharingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,16 @@ Then('{string} {string} should be listed in the autocomplete list on the webUI',
)
})

Then(
'the share permission denied message should be displayed in the sharing dialog on the webUI',
async function() {
const permissionDeniedMessage = "You don't have permission to share this folder."
const dialogMessage = await client.page.FilesPageElement.sharingDialog().getSharePermissionMessage()

return assert.strictEqual(dialogMessage, permissionDeniedMessage)
}
)

When('the user opens the share dialog for file/folder/resource {string} using the webUI', function(
file
) {
Expand Down

0 comments on commit a546051

Please sign in to comment.