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] add tests for sharing the shares_folder #5156

Merged
merged 1 commit into from
May 31, 2021
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 @@ -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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not getting this from feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that part of the ui doens't shows any other type of message. Its only for the permission denied (as far as I have seen) so it makes more sense to make specific step for that.

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