@@ -107,9 +107,17 @@ export default {
enforced: expireDate.enforced === '1'
}
},
-
$_tooltipTextLink () {
return `title: ${this.$gettext('Click to open the link')}; pos: bottom`
+ },
+ $_deleteButtonLabel () {
+ return this.$gettext('Delete public link')
+ },
+ $_editButtonLabel () {
+ return this.$gettext('Edit public link')
+ },
+ $_copyButtonLabel () {
+ return this.$gettext('Copy link url')
}
},
methods: {
diff --git a/tests/acceptance/features/webUISharingPublic/shareByPublicLink.feature b/tests/acceptance/features/webUISharingPublic/shareByPublicLink.feature
index df3ed655fe6..15ffc69bd12 100644
--- a/tests/acceptance/features/webUISharingPublic/shareByPublicLink.feature
+++ b/tests/acceptance/features/webUISharingPublic/shareByPublicLink.feature
@@ -68,7 +68,7 @@ Feature: Share by public link
Scenario: public link share shows up on shared-with-others page
Given user "user1" has logged in using the webUI
- And user "user1" has created a new public link for resource "simple-folder"
+ And user "user1" has shared folder "simple-folder" with link with "read" permissions
When the user browses to the shared-with-others page using the webUI
Then folder "simple-folder" should be listed on the webUI
But file "data.zip" should not be listed on the webUI
@@ -289,20 +289,17 @@ Feature: Share by public link
When the public uses the webUI to access the last public link created by user "user1" with password "pass123"
Then file "lorem.txt" should be listed on the webUI
- @skip @yetToImplement
Scenario: public should not be able to access a public link with wrong password
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | password | pass123 |
- And the public tries to access the last created public link with wrong password "pass12" using the webUI
+ Given user "user1" has shared folder "simple-folder" with link with "read" permissions and password "pass123"
+ When the public uses the webUI to access the last public link created by user "user1" with password "pass12"
Then the public should not get access to the publicly shared file
- @skip @yetToImplement
Scenario: user shares a public link with folder longer than 64 chars and shorter link name
- Given user "user1" has moved folder "simple-folder" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
- And the user has reloaded the current page of the webUI
+ Given user "user1" has renamed folder "simple-folder" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
+ And user "user1" has logged in using the webUI
When the user creates a new public link for folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" using the webUI with
| name | short_linkname |
- And the public accesses the last created public link using the webUI
+ And the public uses the webUI to access the last public link created by user "user1"
Then file "lorem.txt" should be listed on the webUI
Scenario: user tries to create a public link with Viewer role without entering share password while enforce password on read only public share is enforced
@@ -349,17 +346,22 @@ Feature: Share by public link
| path | /simple-folder |
| name | Public link |
- @skip @yetToImplement
+ @yetToImplement
Scenario: public should be able to access the shared file through public link
- When the user creates a new public link for file 'lorem.txt' using the webUI
- And the public accesses the last created public link using the webUI
- Then the text preview of the public link should contain "Lorem ipsum dolor sit amet, consectetur"
- And the content of the file shared by the last public link should be the same as "lorem.txt"
+ Given user "user1" has logged in using the webUI
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | Public link |
+ When the public uses the webUI to access the last public link created by user "user1"
+ Then file "lorem.txt" should be listed on the webUI
+# Then the text preview of the public link should contain "Lorem ipsum dolor sit amet, consectetur"
+# And the content of the file shared by the last public link should be the same as "lorem.txt"
@skip @yetToImplement
Scenario: user shares a public link via email
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And user "user1" has logged in using the webUI
+ And the user reloads the current page of the webUI
When the user creates a new public link for folder "simple-folder" using the webUI with
| email | foo@bar.co |
Then the email address "foo@bar.co" should have received an email with the body containing
@@ -370,8 +372,8 @@ Feature: Share by public link
@skip @yetToImplement
Scenario: user shares a public link via email and sends a copy to self
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And the user reloads the current page of the webUI
When the user creates a new public link for folder "simple-folder" using the webUI with
| email | foo@bar.co |
| emailToSelf | true |
@@ -388,8 +390,8 @@ Feature: Share by public link
@skip @yetToImplement
Scenario: user shares a public link via email with multiple addresses
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And the user reloads the current page of the webUI
When the user creates a new public link for folder "simple-folder" using the webUI with
| email | foo@bar.co, foo@barr.co |
Then the email address "foo@bar.co" should have received an email with the body containing
@@ -405,8 +407,8 @@ Feature: Share by public link
@skip @yetToImplement
Scenario: user shares a public link via email with a personal message
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And the user reloads the current page of the webUI
When the user creates a new public link for folder "simple-folder" using the webUI with
| email | foo@bar.co |
| personalMessage | lorem ipsum |
@@ -422,8 +424,8 @@ Feature: Share by public link
@skip @yetToImplement
Scenario: user shares a public link via email adding few addresses before and then removing some addresses afterwards
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And the user reloads the current page of the webUI
When the user opens the share dialog for folder "simple-folder" using the webUI
And the user opens the public link share tab
And the user opens the create public link share popup
@@ -451,17 +453,18 @@ Feature: Share by public link
But the email address "foo1234@bar.co" should not have received an email
And the email address "foo5678@barr.co" should not have received an email
- @skip @yetToImplement
+ @yetToImplement
Scenario: user edits a public link and does not save the changes
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
- And the user has created a new public link for folder "simple-folder" using the webUI with
- | email | foo1234@bar.co |
- | password | pass123 |
- When the user opens the edit public link share popup for the link named "Public link"
- And the user enters the password "qwertyui" on the edit public link share popup for the link
- And the user does not save any changes in the edit public link share popup
- And the public tries to access the last created public link with wrong password "qwertyui" using the webUI
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And user "user1" has logged in using the webUI
+ And user "user1" has created a public link with following settings
+ | path | simple-folder |
+ | name | test_public_link |
+ | password | pass123 |
+# | email | foo1234@bar.co |
+ When the user edits the public link named "test_public_link" of folder "simple-folder" changing following but not saving
+ | password | qwertyui |
+ And the public uses the webUI to access the last public link created by user "user1" with password "qwertyui"
Then the public should not get access to the publicly shared file
@skip @yetToImplement
@@ -481,53 +484,52 @@ Feature: Share by public link
"""
And the email address "foo@bar.co" should have received an email containing the last shared public link
- @skip @yetToImplement
Scenario: user edits a name of an already existing public link
- Given the user has created a new public link for folder "simple-folder" using the webUI
- And the user has opened the public link share tab
- When the user renames the public link name from "Public link" to "simple-folder Share"
- And the public accesses the last created public link using the webUI
+ Given user "user1" has logged in using the webUI
+ And user "user1" has shared folder "simple-folder" with link with "read" permissions and password "pass123"
+ When the user edits the public link named "{}" of folder "simple-folder" changing following
+ | name | simple-folder Share |
+ And the public uses the webUI to access the last public link created by user "user1" with password "pass123"
Then file "lorem.txt" should be listed on the webUI
- @skip @yetToImplement
- Scenario: user shares a file through public link and then it appears in a Shared by link page
- Given parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
- And the user has reloaded the current page of the webUI
- And the user has created a new public link for folder "simple-folder" using the webUI
- When the user browses to the shared-by-link page
+ Scenario: user shares a file through public link and then it appears in a shared-with-others page
+ Given the setting "shareapi_allow_public_notification" of app "core" has been set to "yes"
+ And user "user1" has shared folder "simple-folder" with link with "read, change, create, delete" permissions
+ And user "user1" has logged in using the webUI
+ When the user browses to the shared-with-others page
Then folder "simple-folder" should be listed on the webUI
- @skip @yetToImplement
Scenario: user edits the password of an already existing public link
- Given the user has created a new public link for folder "simple-folder" using the webUI with
- | password | pass123 |
- When the user changes the password of the public link named "Public link" to "pass1234"
- And the public accesses the last created public link with password "pass1234" using the webUI
+ Given user "user1" has shared folder "simple-folder" with link with "read, change, create, delete" permissions and password "pass123"
+ And user "user1" has logged in using the webUI
+ When the user edits the public link named "{}" of folder "simple-folder" changing following
+ | password | qwertyui |
+ And the public uses the webUI to access the last public link created by user "user1" with password "qwertyui"
Then file "lorem.txt" should be listed on the webUI
- @skip @yetToImplement
Scenario: user edits the password of an already existing public link and tries to access with old password
- Given the user has created a new public link for folder "simple-folder" using the webUI with
- | password | pass123 |
- When the user changes the password of the public link named "Public link" to "pass1234"
- And the public tries to access the last created public link with wrong password "pass123" using the webUI
+ Given user "user1" has shared folder "simple-folder" with link with "read, change, create, delete" permissions and password "pass123"
+ And user "user1" has logged in using the webUI
+ And the user edits the public link named "{}" of folder "simple-folder" changing following
+ | password | qwertyui |
+ When the public uses the webUI to access the last public link created by user "user1" with password "pass123"
Then the public should not get access to the publicly shared file
- @skip @yetToImplement
Scenario: user edits the permission of an already existing public link from read-write to read
- Given the user has created a new public link for folder "simple-folder" using the webUI with
- | permission | read-write |
- When the user changes the permission of the public link named "Public link" to "read"
- And the public accesses the last created public link using the webUI
+ Given user "user1" has shared folder "simple-folder" with link with "read, change, create, delete" permissions
+ And user "user1" has logged in using the webUI
+ When the user edits the public link named "{}" of folder "simple-folder" changing following
+ | role | Viewer |
+ And the public uses the webUI to access the last public link created by user "user1"
Then file "lorem.txt" should be listed on the webUI
And it should not be possible to delete file "lorem.txt" using the webUI
- @skip @yetToImplement
Scenario: user edits the permission of an already existing public link from read to read-write
- Given the user has created a new public link for folder "simple-folder" using the webUI with
- | permission | read |
- When the user changes the permission of the public link named "Public link" to "read-write"
- And the public accesses the last created public link using the webUI
+ Given user "user1" has shared folder "simple-folder" with link with "read" permissions
+ And user "user1" has logged in using the webUI
+ When the user edits the public link named "{}" of folder "simple-folder" changing following
+ | role | Editor |
+ And the public uses the webUI to access the last public link created by user "user1"
And the user deletes the following elements using the webUI
| name |
| simple-empty-folder |
@@ -535,30 +537,26 @@ Feature: Share by public link
Then the deleted elements should not be listed on the webUI
And the deleted elements should not be listed on the webUI after a page reload
- @skip @yetToImplement
Scenario: user changes the expiration date of an already existing public link using webUI
- Given user "user1" has created a share with settings
- | path | lorem.txt |
- | name | Public link |
- | expireDate | 14-10-2038 |
- | shareType | 3 |
- When the user changes the expiration of the public link named "Public link" of file "lorem.txt" to "21-07-2038"
- And the user gets the info of the last share using the sharing API
- Then the fields of the last response should include
- | expiration | 21-07-2038 |
+ Given user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | Public link |
+ | expireDate | 2038-10-14 |
+ And user "user1" has logged in using the webUI
+ When the user edits the public link named "Public link" of file "lorem.txt" changing following
+ | expireDate | 2038-July-21 |
+ Then the fields of the last public link share response of user "user1" should include
+ | expireDate | 2038-07-21 |
- @skip @yetToImplement
Scenario: user tries to change the expiration date of the public link to past date using webUI
- Given user "user1" has created a share with settings
- | path | lorem.txt |
- | name | Public link |
- | expireDate | 14-10-2038 |
- | shareType | 3 |
- When the user changes the expiration of the public link named "Public link" of file "lorem.txt" to "14-09-2017"
- And the user gets the info of the last share using the sharing API
- Then the user should see an error message on the public link share dialog saying "Expiration date is in the past"
- And the fields of the last response should include
- | expiration | 14-10-2038 |
+ Given user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | Public link |
+ | expireDate | 2038-10-14 |
+ And user "user1" has logged in using the webUI
+ When the user tries to edit expiration of the public link named "Public link" of file "lorem.txt" to past date "2019-Oct-10"
+ Then the fields of the last public link share response of user "user1" should include
+ | expireDate | 2038-10-14 |
@skip @yetToImplement
Scenario: share two file with same name but different paths by public link
@@ -570,11 +568,11 @@ Feature: Share by public link
Then file "lorem.txt" with path "" should be listed in the shared with others page on the webUI
And file "lorem.txt" with path "/simple-folder" should be listed in the shared with others page on the webUI
- @skip @yetToImplement
- Scenario: user removes the public link of a file
- Given the user has created a new public link for file "lorem.txt" using the webUI
- When the user removes the public link of file "lorem.txt" using the webUI
- Then the public should see an error message "File not found" while accessing last created public link using the webUI
+ Scenario: user removes the public link of a file using webUI
+ Given user "user1" has logged in using the webUI
+ And user "user1" has shared file "lorem.txt" with link with "read" permissions
+ When the user "user1" removes the public link named "{}" of file "lorem.txt" using the webUI
+ Then user "user1" should not have any public link
@skip @yetToImplement
Scenario: user cancel removes operation for the public link of a file
@@ -583,41 +581,53 @@ Feature: Share by public link
And the public accesses the last created public link using the webUI
Then the content of the file shared by the last public link should be the same as "lorem.txt"
- @skip @yetToImplement
Scenario: user creates a multiple public link of a file and delete the first link
- Given the user has created a new public link for file "lorem.txt" using the webUI with
- | name | first-link |
- And the user has created a new public link for file "lorem.txt" using the webUI with
- | name | second-link |
- And the user has created a new public link for file "lorem.txt" using the webUI with
- | name | third-link |
- When the user removes the public link at position 1 of file "lorem.txt" using the webUI
- Then the public link with name "first-link" should not be in the public links list
- And the number of public links should be 2
+ Given user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | first-name |
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | second-name |
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | third-name |
+ And user "user1" has logged in using the webUI
+ When the user "user1" removes the public link named "first-name" of file "lorem.txt" using the webUI
+ Then public link named "first-name" should not be listed on the public links list on the webUI
+ And a link named "second-name" should be listed with role "Viewer" in the public link list of file "lorem.txt" on the webUI
+ And a link named "third-name" should be listed with role "Viewer" in the public link list of folder "lorem.txt" on the webUI
- @skip @yetToImplement
Scenario: user creates a multiple public link of a file and delete the second link
- Given the user has created a new public link for file "lorem.txt" using the webUI with
- | name | first-link |
- And the user has created a new public link for file "lorem.txt" using the webUI with
- | name | second-link |
- And the user has created a new public link for file "lorem.txt" using the webUI with
- | name | third-link |
- When the user removes the public link at position 2 of file "lorem.txt" using the webUI
- Then the public link with name "second-link" should not be in the public links list
- And the number of public links should be 2
+ Given user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | first-name |
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | second-name |
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | third-name |
+ And user "user1" has logged in using the webUI
+ When the user "user1" removes the public link named "second-name" of file "lorem.txt" using the webUI
+ Then public link named "second-name" should not be listed on the public links list on the webUI
+ And a link named "first-name" should be listed with role "Viewer" in the public link list of file "lorem.txt" on the webUI
+ And a link named "third-name" should be listed with role "Viewer" in the public link list of folder "lorem.txt" on the webUI
- @skip @yetToImplement
Scenario: user creates a multiple public link of a file and delete the third link
- Given the user has created a new public link for file "lorem.txt" using the webUI with
- | name | first-link |
- And the user has created a new public link for file "lorem.txt" using the webUI with
- | name | second-link |
- And the user has created a new public link for file "lorem.txt" using the webUI with
- | name | third-link |
- When the user removes the public link at position 3 of file "lorem.txt" using the webUI
- Then the public link with name "third-link" should not be in the public links list
- And the number of public links should be 2
+ Given user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | first-name |
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | second-name |
+ And user "user1" has created a public link with following settings
+ | path | lorem.txt |
+ | name | third-name |
+ And user "user1" has logged in using the webUI
+ When the user "user1" removes the public link named "third-name" of file "lorem.txt" using the webUI
+ Then public link named "third-name" should not be listed on the public links list on the webUI
+ And a link named "first-name" should be listed with role "Viewer" in the public link list of file "lorem.txt" on the webUI
+ And a link named "second-name" should be listed with role "Viewer" in the public link list of folder "lorem.txt" on the webUI
@skip @yetToImplement
Scenario: user creates public link with view and upload feature
diff --git a/tests/acceptance/helpers/sharingHelper.js b/tests/acceptance/helpers/sharingHelper.js
index 2f4be6e0a6f..4450083e93e 100644
--- a/tests/acceptance/helpers/sharingHelper.js
+++ b/tests/acceptance/helpers/sharingHelper.js
@@ -67,73 +67,84 @@ module.exports = {
return fetch(apiURL, { method: 'GET', headers: headers })
.then(res => res.json())
.then(function (sharesResult) {
- if (sharesResult.ocs.meta.statuscode === 200) {
- const shares = sharesResult.ocs.data
- let found
- for (var shareI = 0; shareI < shares.length; shareI++) {
- const share = shares[shareI]
- found = true
- for (var expectedDetailsI = 0; expectedDetailsI < expectedDetailsTable.hashes().length; expectedDetailsI++) {
- const expectedDetail = expectedDetailsTable.hashes()[expectedDetailsI]
- if (expectedDetail.field === 'permissions') {
- expectedDetail.value = sharingHelper.humanReadablePermissionsToBitmask(expectedDetail.value).toString()
- } else if (expectedDetail.field === 'share_type') {
- expectedDetail.value = sharingHelper.humanReadableShareTypeToNumber(expectedDetail.value).toString()
- }
- if (!(expectedDetail.field in share) || share[expectedDetail.field].toString() !== expectedDetail.value) {
- found = false
- break
- }
+ httpHelper.checkOCSStatus(sharesResult, 'Could not get shares. Message: ' + sharesResult.ocs.meta.message)
+ const shares = sharesResult.ocs.data
+ let found
+ for (const share of shares) {
+ found = true
+ for (const expectedDetail of expectedDetailsTable.hashes()) {
+ if (expectedDetail.field === 'permissions') {
+ expectedDetail.value = sharingHelper.humanReadablePermissionsToBitmask(expectedDetail.value).toString()
+ } else if (expectedDetail.field === 'share_type') {
+ expectedDetail.value = sharingHelper.humanReadableShareTypeToNumber(expectedDetail.value).toString()
}
- if (found === true) {
+ if (!(expectedDetail.field in share) || share[expectedDetail.field].toString() !== expectedDetail.value) {
+ found = false
break
}
}
- assert.strictEqual(
- found, true, 'could not find expected share in "' + JSON.stringify(sharesResult, null, 2) + '"'
- )
- return this
- } else {
- throw Error('Could not get shares. Message: ' + sharesResult.ocs.meta.message)
+ if (found) {
+ break
+ }
}
+ assert.strictEqual(
+ found, true, 'could not find expected share in "' + JSON.stringify(sharesResult, null, 2) + '"'
+ )
+ return this
})
},
-
/**
* Asynchronously fetches the last public link created by the given link creator
*
* @async
- * @param {string[]} linkCreator link creator
+ * @param {string} linkCreator link creator
* @return {Promise