diff --git a/changelog/unreleased/enhancement-redesign-link-sharing b/changelog/unreleased/enhancement-redesign-link-sharing
index a853c4ce0ce..66c27f5bffb 100644
--- a/changelog/unreleased/enhancement-redesign-link-sharing
+++ b/changelog/unreleased/enhancement-redesign-link-sharing
@@ -1,6 +1,8 @@
Enhancement: Redesign link sharing
We have redesigned the public link list in the right sidebar. Links now can be edited in-line and have a similiar look-and-feel to people and group shares.
+Additionally, creating new links now is less cumbersome and the default name, while not configurable from the backend anymore, is now translated.
https://github.com/owncloud/web/pull/6749
https://github.com/owncloud/web/pull/6885
+https://github.com/owncloud/web/pull/6961
diff --git a/changelog/unreleased/enhancement-update-ods b/changelog/unreleased/enhancement-update-ods
index f29402cfc9e..dbcc98f576a 100644
--- a/changelog/unreleased/enhancement-update-ods
+++ b/changelog/unreleased/enhancement-update-ods
@@ -1,6 +1,6 @@
-Enhancement: Update ODS to v13.1.0-rc.5
+Enhancement: Update ODS to v13.1.0
-We updated the ownCloud Design System to version 13.1.0-rc.5. Please refer to the full changelog in the ODS release (linked) for more details. Summary:
+We updated the ownCloud Design System to version 13.1.0. Please refer to the full changelog in the ODS release (linked) for more details. Summary:
- Enhancement - Add isFileExtensionDisplayed property: https://github.com/owncloud/owncloud-design-system/pull/2087
- Enhancement - OcModal input type: https://github.com/owncloud/owncloud-design-system/pull/2077
@@ -18,4 +18,4 @@ https://github.com/owncloud/web/pull/6749
https://github.com/owncloud/web/pull/6750
https://github.com/owncloud/web/pull/6953
https://github.com/owncloud/web/pull/7094
-https://github.com/owncloud/owncloud-design-system/releases/tag/v13.1.0-rc.9
+https://github.com/owncloud/owncloud-design-system/releases/tag/v13.1.0
diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
index c2204b88325..0e709c268f2 100644
--- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
+++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
@@ -1,123 +1,93 @@
Add password
diff --git a/packages/web-runtime/src/App.vue b/packages/web-runtime/src/App.vue
index 4015fd219dc..98e2b81461e 100644
--- a/packages/web-runtime/src/App.vue
+++ b/packages/web-runtime/src/App.vue
@@ -13,12 +13,13 @@
:title="modal.title"
:message="modal.message"
:has-input="modal.hasInput"
- :input-label="modal.inputLabel"
- :input-disabled="modal.inputDisabled"
- :input-value="modal.inputValue"
- :input-selection-range="modal.inputSelectionRange"
:input-description="modal.inputDescription"
+ :input-disabled="modal.inputDisabled"
:input-error="modal.inputError"
+ :input-label="modal.inputLabel"
+ :input-selection-range="modal.inputSelectionRange"
+ :input-type="modal.inputType"
+ :input-value="modal.inputValue"
:button-secondary-text="modal.buttonSecondaryText"
:button-cancel-text="modal.cancelText"
:button-confirm-text="modal.confirmText"
diff --git a/packages/web-runtime/src/store/modal.js b/packages/web-runtime/src/store/modal.js
index b3ac129aa86..1ff82131040 100644
--- a/packages/web-runtime/src/store/modal.js
+++ b/packages/web-runtime/src/store/modal.js
@@ -19,6 +19,7 @@ const state = {
inputLabel: '',
inputError: '',
checkboxLabel: '',
+ inputType: 'text',
// Events
onCancel: emptyReturn,
onConfirm: emptyReturn,
@@ -66,6 +67,7 @@ const mutations = {
state.inputLabel = modal.inputLabel || null
state.inputError = modal.inputError || null
state.inputDisabled = modal.inputDisabled || false
+ state.inputType = modal.inputType || 'text'
state.onInput = modal.onInput || emptyReturn
state.onCheckboxValueChanged = modal.onCheckboxValueChanged || emptyReturn
state.onConfirmSecondary = modal.onConfirmSecondary || emptyReturn
diff --git a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md
index 7e2e400b24a..b06a19c35a0 100644
--- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md
+++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md
@@ -170,16 +170,11 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:52](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L52)
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:71](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L71)
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:72](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L72)
-- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:75](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L75)
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:86](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L86)
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:106](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L106)
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:130](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L130)
- [webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature:147](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature#L147)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:276](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L276)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:284](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L284)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:293](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L293)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:302](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L302)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:311](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L311)
- [webUIMoveFilesFolders/moveFiles.feature:97](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature#L97)
- [webUIMoveFilesFolders/moveFolders.feature:72](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature#L72)
- [webUIFilesActionMenu/versions.feature:93](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L93)
@@ -261,14 +256,6 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingNotifications/shareWithUsers.feature:40](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingNotifications/shareWithUsers.feature#L40)
- [webUISharingNotifications/shareWithUsers.feature:53](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingNotifications/shareWithUsers.feature#L53)
-### [name of public link is empty and not "Public link" when not specified in the create request](https://github.com/owncloud/ocis/issues/1237)
-- [webUISharingPublicBasic/publicLinkCreate.feature:11](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L11)
-- [webUISharingPublicBasic/publicLinkCreate.feature:28](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L28)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L33)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:34](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L34)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:35](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L35)
-- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:60](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L60)
-
### [Listing shares via ocs API does not show path for parent folders](https://github.com/owncloud/ocis/issues/1231)
- [webUISharingPublicManagement/shareByPublicLink.feature:133](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L133)
diff --git a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature
index 61c1717c4e0..fdad39ee304 100644
--- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature
+++ b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature
@@ -19,8 +19,8 @@ Feature: Create public link shares
| uid_owner | Alice |
| permissions | read |
| path | /simple-folder |
- | name | Public link |
- And a link named "Public link" should be listed with role "Viewer" in the public link list of resource "simple-folder" on the webUI
+ | name | Link |
+ And a link named "Link" should be listed with role "Viewer" in the public link list of resource "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
@@ -35,8 +35,8 @@ Feature: Create public link shares
| uid_owner | Alice |
| permissions | read |
| path | /lorem.txt |
- | name | Public link |
- And a link named "Public link" should be listed with role "Viewer" in the public link list of resource "lorem.txt" on the webUI
+ | name | Link |
+ And a link named "Link" should be listed with role "Viewer" in the public link list of resource "lorem.txt" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
@@ -53,10 +53,10 @@ Feature: Create public link shares
| uid_owner | Alice |
| permissions | read |
| path | /simple-folder |
- And a public link with the last created link share token as name should be listed for resource "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
+
@skipOnOC10 @issue-ocis-reva-383
# When this issue is fixed delete this scenario and use the one above
Scenario: simple file sharing by public link (ocis bug demonstration)
@@ -69,22 +69,22 @@ Feature: Create public link shares
| uid_owner | Alice |
| permissions | read |
| path | /lorem.txt |
- And a public link with the last created link share token as name should be listed for resource "lorem.txt" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
+
@issue-ocis-reva-389
Scenario: user shares a public link with folder longer than 64 chars and shorter link name
Given user "Alice" has created folder "simple-folder" in the server
And user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has renamed folder "simple-folder" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" in the server
And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" using the webUI with
- | name | short_linkname |
+ When the user creates a new public link for folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" using the webUI
And the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
+
Scenario: share two files with same name but different paths by public link
Given user "Alice" has created folder "simple-folder" in the server
And user "Alice" has created file "simple-folder/lorem.txt" in the server
@@ -158,10 +158,8 @@ Feature: Create public link shares
Scenario Outline: user creates multiple public links with same name for the same file/folder
Given user "Alice" has created "" in the server
And user "Alice" has logged in using the webUI
- When the user creates a new public link for "" using the webUI with
- | name | same_link_name |
- And the user creates a new public link for "" using the webUI with
- | name | same_link_name |
+ When the user creates a new public link for "" using the webUI
+ And the user creates a new public link for "" using the webUI
Then the tokens should be unique for each public links on the webUI
Examples:
| element | name |
@@ -169,17 +167,19 @@ Feature: Create public link shares
| file | lorem.txt |
+
+
Scenario: User can create a public link via quick action
Given user "Alice" has created folder "simple-folder" in the server
And user "Alice" has logged in using the webUI
When the user creates a public link via quick action for resource "simple-folder" using the webUI
Then user "Alice" should have a share with these details in the server:
- | field | value |
- | share_type | public_link |
- | uid_owner | Alice |
- | permissions | read |
- | path | /simple-folder |
- | name | Quicklink |
+ | field | value |
+ | share_type | public_link |
+ | uid_owner | Alice |
+ | permissions | read |
+ | path | /simple-folder |
+ | name | Quicklink |
And the following success message should be displayed on the webUI
"""
Quicklink copied into your clipboard
diff --git a/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature b/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature
index c839c8666ec..b674bbf8d77 100644
--- a/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature
+++ b/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature
@@ -16,16 +16,16 @@ Feature: Share by public link with different roles
Scenario Outline: simple sharing by public link with different roles
Given user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | |
+ When the user creates a new public link for folder "simple-folder" using the webUI
+ And the user sets the role of the most recently created public link of resource "simple-folder" to ""
Then user "Alice" should have a share with these details in the server:
| field | value |
| share_type | public_link |
| uid_owner | Alice |
| permissions | |
| path | /simple-folder |
- | name | Public link |
- And a link named "Public link" should be listed with role "" in the public link list of folder "simple-folder" on the webUI
+ | name | Link |
+ And a link named "Link" should be listed with role "" in the public link list of folder "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Examples:
@@ -39,15 +39,14 @@ Feature: Share by public link with different roles
Scenario Outline: simple sharing by public link with different roles (ocis bug demonstration)
Given user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | |
+ When the user creates a new public link for folder "simple-folder" using the webUI
+ And the user sets the role of the most recently created public link of resource "simple-folder" to ""
Then user "Alice" should have a share with these details in the server:
| field | value |
| share_type | public_link |
| uid_owner | Alice |
| permissions | |
| path | /simple-folder |
- And a public link with the last created link share token as name should be listed for resource "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Examples:
@@ -56,20 +55,21 @@ Feature: Share by public link with different roles
| Editor | read, update, create, delete |
| Contributor | read, create |
+
@issue-ocis-reva-383
Scenario: sharing by public link with "Uploader" role
Given user "Alice" has created file "simple-folder/fileInside" in the server
And user "Alice" has logged in using the webUI
- And the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Uploader |
+ And the user creates a new public link for folder "simple-folder" using the webUI
+ And the user sets the role of the most recently created public link of resource "simple-folder" to "Uploader"
Then user "Alice" should have a share with these details in the server:
| field | value |
| share_type | public_link |
| uid_owner | Alice |
| permissions | create |
| path | /simple-folder |
- | name | Public link |
- And a link named "Public link" should be listed with role "Uploader" in the public link list of folder "simple-folder" on the webUI
+ | name | Link |
+ And a link named "Link" should be listed with role "Uploader" in the public link list of folder "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then the user should be redirected to the files-drop page
@@ -77,18 +77,18 @@ Feature: Share by public link with different roles
#after fixing the issue delete this scenario and use the one above by deleting the @skipOnOCIS tag there
Scenario: sharing by public link with "Uploader" role (ocis bug demonstration)
Given user "Alice" has logged in using the webUI
- And the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Uploader |
+ And the user creates a new public link for folder "simple-folder" using the webUI
+ And the user sets the role of the most recently created public link of resource "simple-folder" to "Uploader"
Then user "Alice" should have a share with these details in the server:
| field | value |
| share_type | public_link |
| uid_owner | Alice |
| permissions | create |
| path | /simple-folder |
- And a public link with the last created link share token as name should be listed for resource "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then the user should be redirected to the files-drop page
+
@issue-4582 @disablePreviews
Scenario: creating a public link with "Editor" role makes it possible to delete files via the link
Given user "Alice" has created the following folders in the server
@@ -277,46 +277,12 @@ Feature: Share by public link with different roles
Given the setting "shareapi_enforce_links_password_read_only" of app "core" has been set to "yes" in the server
And user "Alice" has logged in using the webUI
When the user creates a new public link for folder "simple-folder" using the webUI
- And user "Alice" should not have created any shares in the server
-
-
- @issue-ocis-1328
- Scenario: user tries to create a public link with Contributor role without entering share password while enforce password on read-write public share is enforced
- Given the setting "shareapi_enforce_links_password_read_write" of app "core" has been set to "yes" in the server
- And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Contributor |
- And user "Alice" should not have created any shares in the server
-
-
- @issue-ocis-1328
- Scenario: user tries to create a public link with Editor Role without entering share password while enforce password on read-write public share is enforced
- Given the setting "shareapi_enforce_links_password_read_write_delete" of app "core" has been set to "yes" in the server
- And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Editor |
- And user "Alice" should not have created any shares in the server
-
-
- @issue-ocis-1328
- Scenario: user tries to create a public link with Uploader role without entering share password while enforce password on write only public share is enforced
- Given the setting "shareapi_enforce_links_password_write_only" of app "core" has been set to "yes" in the server
- And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Uploader |
- And user "Alice" should not have created any shares in the server
-
-
- @issue-ocis-1328
- Scenario: user creates a public link with Contributor Role without entering share password while enforce password on read only public share is enforced
- Given the setting "shareapi_enforce_links_password_read_only" of app "core" has been set to "yes" in the server
- And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Contributor |
+ Then user "Alice" should not have created any shares in the server
+ When the user sets a password "123123" for the public link in the modal
Then user "Alice" should have a share with these details in the server:
| field | value |
| share_type | public_link |
| uid_owner | Alice |
- | permissions | read, create |
+ | permissions | read |
| path | /simple-folder |
- | name | Public link |
+ | name | Link |
diff --git a/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature b/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature
index c8c6afa39b4..2db8401f93e 100644
--- a/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature
+++ b/tests/acceptance/features/webUISharingPublicExpire/shareByPublicLinkExpiringLinks.feature
@@ -44,7 +44,7 @@ Feature: Share by public link
| uid_owner | Alice |
| permissions | read |
| path | / |
- | name | Public link |
+ | name | Link |
| expiration | +7 |
Examples:
| element | shared-resource |
@@ -64,23 +64,23 @@ Feature: Share by public link
| uid_owner | Alice |
| permissions | read |
| path | / |
- | name | Public link |
+ | name | Link |
| expiration | +42 |
Examples:
| element | shared-resource |
| file | lorem.txt |
| folder | simple-folder |
- @issue-ocis-1328
- Scenario: expiry date is set to enforced max expiry date when creating a public link to a date that is past the enforced max expiry date
- Given the setting "shareapi_default_expire_date" of app "core" has been set to "yes" in the server
- And the setting "shareapi_expire_after_n_days" of app "core" has been set to "7" in the server
- And the setting "shareapi_enforce_expire_date" of app "core" has been set to "yes" in the server
- And user "Alice" has created folder "simple-folder" in the server
- And user "Alice" has logged in using the webUI
- When the user tries to create a new public link for resource "simple-folder" which expires in "+15" days using the webUI
- Then the link expiration date shown on the webUI should be "+7" days
- And user "Alice" should not have created any shares in the server
+
+
+
+
+
+
+
+
+
+
@issue-ocis-1328
Scenario: user cannot change the expiry date of an existing public link to a date that is past the enforced max expiry date
@@ -132,17 +132,17 @@ Feature: Share by public link
And the setting "shareapi_enforce_expire_date" of app "core" has been set to "yes" in the server
And user "Alice" has created file "lorem.txt" in the server
And user "Alice" has logged in using the webUI
- When the user creates a new public link for resource "lorem.txt" using the webUI with
- | expireDate | +7 |
+ When the user creates a new public link for resource "lorem.txt" using the webUI
Then user "Alice" should have a share with these details in the server:
| field | value |
| share_type | public_link |
| uid_owner | Alice |
| permissions | read |
| path | /lorem.txt |
- | name | Public link |
+ | name | Link |
| expiration | +7 |
+
@issue-ocis-1328
Scenario: user can change the expiry date of an existing public link to a date that is before the enforced max expiry date
Given the setting "shareapi_default_expire_date" of app "core" has been set to "yes" in the server
diff --git a/tests/acceptance/features/webUISharingPublicManagement/publicLinkIndicator.feature b/tests/acceptance/features/webUISharingPublicManagement/publicLinkIndicator.feature
index 6f0ff524f3e..1835d359e2a 100644
--- a/tests/acceptance/features/webUISharingPublicManagement/publicLinkIndicator.feature
+++ b/tests/acceptance/features/webUISharingPublicManagement/publicLinkIndicator.feature
@@ -69,8 +69,8 @@ Feature: Public link share indicator
And user "Brian" has shared folder "simple-folder" with link with "read" permissions in the server
When user "Brian" has logged in using the webUI
Then the following resources should have share indicators on the webUI
- | fileName | expectedIndicators |
- | simple-folder | link-direct,user-indirect |
+ | fileName | expectedIndicators |
+ | simple-folder | link-direct,user-indirect |
When the user opens folder "simple-folder" using the webUI
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
@@ -86,8 +86,8 @@ Feature: Public link share indicator
And user "Brian" has shared folder "simple-folder/sub-folder" with link with "read" permissions in the server
When user "Brian" has logged in using the webUI
Then the following resources should have share indicators on the webUI
- | fileName | expectedIndicators |
- | simple-folder | user-indirect |
+ | fileName | expectedIndicators |
+ | simple-folder | user-indirect |
When the user opens folder "simple-folder" using the webUI
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
@@ -114,12 +114,10 @@ Feature: Public link share indicator
Then the following resources should not have share indicators on the webUI
| simple-folder |
When the user shares folder "simple-folder" with user "Brian Murphy" as "Viewer" using the webUI
- And the user creates a new public link for resource "simple-folder" using the webUI with
- | field | value |
- | name | first |
- And the user creates a new public link for resource "simple-folder" using the webUI with
- | field | value |
- | name | second |
+ And the user creates a new public link for resource "simple-folder" using the webUI
+ And the user renames the most recently created public link of resource "simple-folder" to "first"
+ And the user creates a new public link for resource "simple-folder" using the webUI
+ And the user renames the most recently created public link of resource "simple-folder" to "second"
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
| simple-folder | user-direct,link-direct |
@@ -127,9 +125,8 @@ Feature: Public link share indicator
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
| testimage.png | user-indirect,link-indirect |
- When the user creates a new public link for resource "testimage.png" using the webUI with
- | field | value |
- | name | third |
+ When the user creates a new public link for resource "testimage.png" using the webUI
+ And the user renames the most recently created public link of resource "testimage.png" to "third"
# the indicator changes from link-indirect to link-direct to show the direct share
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
diff --git a/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature b/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature
index be6dc6f243b..cad9456ef41 100644
--- a/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature
+++ b/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature
@@ -86,12 +86,12 @@ Feature: Public link share management
And the user navigates to the copied public link using the webUI
Then file "lorem.txt" should be listed on the webUI
-
Scenario: access details dialog of public share and check the tabs displayed
Given user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has logged in using the webUI
- When the user creates a new public link for folder "simple-folder" using the webUI with
- | role | Editor |
+ When the user creates a new public link for folder "simple-folder" using the webUI
+ And the user renames the most recently created public link of folder "simple-folder" to "link1"
+ And the user tries to edit the public link named "link1" of folder "simple-folder" changing the role to "Editor"
And the public uses the webUI to access the last public link created by user "Alice" in a new session
And the user opens the sidebar for file "lorem.txt" on the webUI
Then the following panels should be visible in the details dialog on the webUI
@@ -147,13 +147,6 @@ Feature: Public link share management
Then a link named "Public Link" should be listed with role "Viewer" in the public link list of resource "simple-folder/simple-empty-folder" via "simple-folder" on the webUI
- @issue-ocis-reva-243
- Scenario: token is shown for links without a name
- When user "Alice" has created a public link with following settings in the server
- | path | /simple-folder |
- And user "Alice" logs in using the webUI
- Then a public link with the last created link share token as name should be listed for resource "simple-folder" on the webUI
-
@issue-product-130
Scenario: User can attempt to upload a file in public link
Given user "Alice" has created file "lorem.txt" in the server
diff --git a/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js b/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js
index 34443e1a1b0..0b9d5da001f 100644
--- a/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js
+++ b/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js
@@ -309,48 +309,12 @@ module.exports = {
/**
* creates a new public link
*
- * @param {Object} settings - Parameters to be set up for a new public link share
- * @param {string} settings.role - Role of the viewer of the public link
- * @param {string} settings.name - Name of the public link share
- * @param {string} settings.password - Password for a public link share
- * @param {string} settings.expireDate - Expire date for a public link share
* @returns {*}
*/
- addNewLink: async function (settings = null) {
- await this.waitForElementVisible('@publicLinkAddButton')
- .click('@publicLinkAddButton')
- .waitForElementVisible('@publicLinkCreateButton')
- if (settings !== null) {
- for (const [key, value] of Object.entries(settings)) {
- await this.setPublicLinkForm(key, value)
- }
- }
- return this.waitForElementVisible('@publicLinkCreateButton')
- .initAjaxCounters()
- .click('@publicLinkCreateButton')
- .waitForOutstandingAjaxCalls()
- },
- /**
- * tries to create a new public link in specified date
- *
- * @param {string} settings.expireDate - Expire date for a public link share
- * @returns {*}
- */
- setPublicLinkDate: async function (days) {
- await this.waitForElementVisible('@publicLinkAddButton')
- .click('@publicLinkAddButton')
- .waitForElementVisible('@publicLinkCreateButton')
- if (days) {
- const isExpiryDateChanged = await this.setPublicLinkForm('expireDate', days)
- if (!isExpiryDateChanged) {
- console.log('WARNING: Cannot create share with disabled expiration date!')
- return
- }
- }
+ addNewLink: function () {
return this.waitForElementVisible('@publicLinkCreateButton')
.initAjaxCounters()
.click('@publicLinkCreateButton')
- .waitForElementNotPresent('@publicLinkCreateButton')
.waitForOutstandingAjaxCalls()
},
/**
@@ -436,8 +400,8 @@ module.exports = {
result.value.forEach((item) => {
promiseList.push(
new Promise((resolve) => {
- this.api.elementIdAttribute(item.ELEMENT, 'href', (href) => {
- resolve(href.value)
+ this.api.elementIdAttribute(item.ELEMENT, 'innerText', (text) => {
+ resolve(text)
})
})
)
@@ -484,6 +448,24 @@ module.exports = {
await this.click('@dialogConfirmBtnEnabled')
},
+ changeLatestLinkName: async function (newName) {
+ let latestLinkName
+ await this.waitForElementVisible('@latestLinkName').getText(
+ '@latestLinkName',
+ (result) => (latestLinkName = result.value)
+ )
+ await this.changeName(latestLinkName, newName)
+ },
+
+ changeLatestLinkRole: async function (newRole) {
+ let latestLinkName
+ await this.waitForElementVisible('@latestLinkName').getText(
+ '@latestLinkName',
+ (result) => (latestLinkName = result.value)
+ )
+ await this.changeRole(latestLinkName, newRole)
+ },
+
addPassword: async function (linkName, password) {
await this.clickLinkEditBtn(linkName)
await this.clickLinkAddPasswordBtn(linkName)
@@ -498,6 +480,20 @@ module.exports = {
await this.click('@dialogConfirmBtnEnabled')
},
+ setRequiredPassword: async function (password) {
+ await this.useXpath()
+ .waitForElementVisible('@dialog')
+ .waitForAnimationToFinish()
+ .clearValue('@dialogInput')
+ .setValue('@dialogInput', password)
+ .useCss()
+
+ await this.waitForElementVisible('@dialogConfirmBtnEnabled')
+ .initAjaxCounters()
+ .click('@dialogConfirmBtnEnabled')
+ .waitForOutstandingAjaxCalls()
+ },
+
changePassword: async function (linkName, password) {
await this.clickLinkEditBtn(linkName)
await this.clickLinkEditPasswordBtn(linkName)
@@ -549,6 +545,10 @@ module.exports = {
}
},
elements: {
+ latestLinkName: {
+ selector: '//div[@id="oc-files-file-link"]//ul/li[1]//h4',
+ locateStrategy: 'xpath'
+ },
expirationDateFieldWrapper: {
selector: '#oc-files-file-link-expire-date'
},
@@ -564,7 +564,7 @@ module.exports = {
locateStrategy: 'xpath'
},
publicLinkUrl: {
- selector: '//a[contains(@class, "oc-files-file-link-url")]',
+ selector: '//p[contains(@class, "oc-files-file-link-url")]',
locateStrategy: 'xpath'
},
publicLinkName: {
@@ -580,12 +580,6 @@ module.exports = {
publicLinkSubVia: {
selector: '.oc-files-file-link-via'
},
- publicLinkAddButton: {
- selector: '#files-file-link-add'
- },
- addLinkButton: {
- selector: '#files-file-link-add'
- },
selectRoleButton: {
selector: '#files-file-link-role-button'
},
@@ -601,14 +595,6 @@ module.exports = {
roleUploader: {
selector: '#files-role-uploader'
},
- errorMessageInsidePublicLinkContainer: {
- selector: '//div[contains(@class, "oc-notification-message-warning")]',
- locateStrategy: 'xpath'
- },
- publicLinkNameInputField: {
- selector: '//input[@id="oc-files-file-link-name"]',
- locateStrategy: 'xpath'
- },
publicLinkEditRoleButton: {
selector:
'//h4[contains(@class, "oc-files-file-link-name") and text()="%s"]//ancestor::li//div[contains(@class, "link-details")]/div/button[contains(@class, "edit-public-link-role-dropdown-toggl")]',
@@ -662,10 +648,7 @@ module.exports = {
selector: '#oc-files-file-link-password-delete'
},
publicLinkCreateButton: {
- selector: '#oc-files-file-link-create'
- },
- publicLinkSaveButton: {
- selector: '#oc-files-file-link-save'
+ selector: '#files-file-link-add'
},
publicLinkRoleSelectionDropdown: {
selector: '//div[contains(@class, "files-file-link-role-button-wrapper")]//span[.="%s"]',
diff --git a/tests/acceptance/stepDefinitions/publicLinkContext.js b/tests/acceptance/stepDefinitions/publicLinkContext.js
index 77c1604631d..e475177c3b4 100644
--- a/tests/acceptance/stepDefinitions/publicLinkContext.js
+++ b/tests/acceptance/stepDefinitions/publicLinkContext.js
@@ -15,19 +15,10 @@ When(
)
When(
- 'the user (tries to )create/creates a new public link for file/folder/resource {string} using the webUI with',
- async function (resource, settingsTable) {
- const settings = settingsTable.rowsHash()
+ 'the user sets the role of the most recently created public link of resource {string} to {string}',
+ async function (resource, newRole) {
await client.page.FilesPageElement.filesList().openPublicLinkDialog(resource)
- return client.page.FilesPageElement.publicLinksDialog().addNewLink(settings)
- }
-)
-
-When(
- 'the user (tries to) create a new public link for file/folder/resource {string} which expires in {string} day/days using the webUI',
- async function (resource, days) {
- await client.page.FilesPageElement.filesList().openPublicLinkDialog(resource)
- return client.page.FilesPageElement.publicLinksDialog().setPublicLinkDate(days)
+ await client.page.FilesPageElement.publicLinksDialog().changeLatestLinkRole(newRole)
}
)
@@ -112,6 +103,14 @@ Then('the public should not get access to the publicly shared file', async funct
)
})
+When(
+ 'the user renames the most recently created public link of file/folder/resource {string} to {string}',
+ async function (resource, newName) {
+ await client.page.FilesPageElement.filesList().openPublicLinkDialog(resource)
+ await client.page.FilesPageElement.publicLinksDialog().changeLatestLinkName(newName)
+ }
+)
+
When(
'the user renames the public link named {string} of file/folder/resource {string} to {string}',
async function (linkName, resource, newName) {
@@ -153,6 +152,13 @@ When(
}
)
+When(
+ 'the user sets a password {string} for the public link in the modal',
+ async function (password) {
+ await client.page.FilesPageElement.publicLinksDialog().setRequiredPassword(password)
+ }
+)
+
When(
'the user tries to edit the public link named {string} of file/folder/resource {string} adding a password {string}',
async function (linkName, resource, password) {
@@ -292,17 +298,6 @@ Then('the tokens should be unique for each public links on the webUI', async fun
return assert.ok(isUnique)
})
-Then(
- 'a public link with the last created link share token as name should be listed for resource {string} on the webUI',
- async function (resource) {
- const lastShare = await sharingHelper.fetchLastPublicLinkShare(client.globals.currentUser)
- await client.page.FilesPageElement.filesList().openPublicLinkDialog(resource)
- const shares = await client.page.FilesPageElement.publicLinksDialog().getPublicLinkList()
- const share = shares.find((link) => link.name === lastShare.token)
- return assert.ok(share.name.length > 0)
- }
-)
-
When(
'the user creates a public link via quick action for resource {string} using the webUI',
function (resource) {
diff --git a/tests/e2e/cucumber/features/integrations/link.feature b/tests/e2e/cucumber/features/integrations/link.feature
index 552de51f0ad..e6d4511e494 100644
--- a/tests/e2e/cucumber/features/integrations/link.feature
+++ b/tests/e2e/cucumber/features/integrations/link.feature
@@ -14,9 +14,11 @@ Feature: link
| lorem.txt | folderPublic |
#Then "Alice" should see the following resource
# | folderPublic/lorem.txt |
- And "Alice" creates a public link for the following resource using the sidebar panel
- | resource | name | role | dateOfExpiration | password |
- | folderPublic | myPublicLink | uploader | +5 days | 12345 |
+ And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel
+ And "Alice" renames the most recently created public link of resource "folderPublic" to "myPublicLink"
+ And "Alice" edits the public link named "myPublicLink" of resource "folderPublic" changing role to "uploader"
+ And "Alice" sets the expiration date of the public link named "myPublicLink" of resource "folderPublic" to "+5 days"
+ And "Alice" sets the password of the public link named "myPublicLink" of resource "folderPublic" to "12345"
#Then "Alice" should see 1 public link
When "Anonymous" opens the public link "myPublicLink"
And "Anonymous" unlocks the public link with password "12345"
diff --git a/tests/e2e/cucumber/features/integrations/spaces/project.ocis.feature b/tests/e2e/cucumber/features/integrations/spaces/project.ocis.feature
index 4d3e605a713..fdb2b64d2a6 100644
--- a/tests/e2e/cucumber/features/integrations/spaces/project.ocis.feature
+++ b/tests/e2e/cucumber/features/integrations/spaces/project.ocis.feature
@@ -1,20 +1,20 @@
Feature: spaces.personal
Scenario: unstructured collection of testable space interactions,
- once all needed features are there, split this into independent tests.
- contains following features:
- - ✓ assign role to user
- - ✓ create space & internal alias to differentiate multiple spaces with the same name
- - ✓ open space
- - ✓ rename space
- - ✓ change/set space subtitle
- - ✓ change/set space description
- - ✓ change/set space quota
- - ✓ resources & existing resource actions
- - ✗ change/set space image
- - ✗ trash bin
- - ✗ share
- - ✗ link
+ once all needed features are there, split this into independent tests.
+ contains following features:
+ - ✓ assign role to user
+ - ✓ create space & internal alias to differentiate multiple spaces with the same name
+ - ✓ open space
+ - ✓ rename space
+ - ✓ change/set space subtitle
+ - ✓ change/set space description
+ - ✓ change/set space quota
+ - ✓ resources & existing resource actions
+ - ✗ change/set space image
+ - ✗ trash bin
+ - ✗ share
+ - ✗ link
Given "Admin" creates following users
| id |
| Alice |
@@ -47,10 +47,11 @@ Feature: spaces.personal
| lorem.txt | folderPublic |
| lorem.txt | folder_to_shared |
- # borrowed from link.feature, all existing resource actions can be reused
- When "Alice" creates a public link for the following resource using the sidebar panel
- | resource | name | role | dateOfExpiration | password |
- | folderPublic | team.1 | uploader | +5 days | 12345 |
+ And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel
+ And "Alice" renames the most recently created public link of resource "folderPublic" to "team.1"
+ And "Alice" edits the public link named "team.1" of resource "folderPublic" changing role to "uploader"
+ And "Alice" sets the expiration date of the public link named "team.1" of resource "folderPublic" to "+5 days"
+ And "Alice" sets the password of the public link named "team.1" of resource "folderPublic" to "12345"
# borrowed from share.feature
When "Alice" shares the following resource using the sidebar panel
@@ -65,16 +66,18 @@ Feature: spaces.personal
And "Alice" updates the space "team.2" description to "management team - description"
And "Alice" updates the space "team.2" quota to "500"
- # borrowed from link.feature, all existing resource actions can be reused
And "Alice" creates the following resources
| resource | type |
| folderPublic | folder |
And "Alice" uploads the following resources
| resource | to |
| lorem.txt | folderPublic |
- When "Alice" creates a public link for the following resource using the sidebar panel
- | resource | name | role | dateOfExpiration | password |
- | folderPublic | team.2 | uploader | +5 days | 54321 |
+
+ And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel
+ And "Alice" renames the most recently created public link of resource "folderPublic" to "team.2"
+ And "Alice" edits the public link named "team.2" of resource "folderPublic" changing role to "uploader"
+ And "Alice" sets the expiration date of the public link named "team.2" of resource "folderPublic" to "+5 days"
+ And "Alice" sets the password of the public link named "team.2" of resource "folderPublic" to "54321"
# borrowed from link.feature, all existing resource actions can be reused
When "Anonymous" opens the public link "team.1"
@@ -91,10 +94,10 @@ Feature: spaces.personal
| name |
| folder_to_shared |
And "Brian" renames the following resource
- | resource | as |
+ | resource | as |
| folder_to_shared/lorem.txt | lorem_new.txt |
And "Brian" uploads the following resource
- | resource | to |
+ | resource | to |
| simple.pdf | folder_to_shared |
And "Alice" navigates to the projects space page
And "Alice" navigates to the project space "team.1"
@@ -102,7 +105,7 @@ Feature: spaces.personal
| resource | to | create_version |
| PARENT/simple.pdf | folder_to_shared | true |
When "Brian" restores following resources
- | resource | to | version |
+ | resource | to | version |
| simple.pdf | folder_to_shared | 1 |
When "Alice" deletes the following resources
| resource |
diff --git a/tests/e2e/cucumber/steps/app-files/link.ts b/tests/e2e/cucumber/steps/app-files/link.ts
index 6524c271039..3482de7b33c 100644
--- a/tests/e2e/cucumber/steps/app-files/link.ts
+++ b/tests/e2e/cucumber/steps/app-files/link.ts
@@ -1,31 +1,57 @@
-import { DataTable, When } from '@cucumber/cucumber'
+import { When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
import { World } from '../../environment'
import { objects } from '../../../support'
When(
- /^"([^"]*)" creates a public link for the following resource(s)? using the (sidebar panel|quick action)$/,
+ '{string} creates a public link for the resource {string} using the sidebar panel',
+ async function (this: World, stepUser: string, resource: string) {
+ const { page } = this.actorsEnvironment.getActor({ key: stepUser })
+ const linkObject = new objects.applicationFiles.Link({ page })
+ await linkObject.create({
+ resource,
+ name: 'Link'
+ })
+ }
+)
+
+When(
+ '{string} renames the most recently created public link of resource {string} to {string}',
+ async function (this: World, stepUser: string, resource: string, newName: string): Promise {
+ const { page } = this.actorsEnvironment.getActor({ key: stepUser })
+ const linkObject = new objects.applicationFiles.Link({ page })
+ const linkName = await linkObject.changeName({ resource, newName })
+ expect(newName).toBe(linkName)
+ }
+)
+
+When(
+ '{string} sets the expiration date of the public link named {string} of resource {string} to {string}',
async function (
this: World,
stepUser: string,
- _: string,
- actionType: string,
- stepTable: DataTable
- ) {
+ linkName: string,
+ resource: string,
+ expireDate: string
+ ): Promise {
+ const { page } = this.actorsEnvironment.getActor({ key: stepUser })
+ const linkObject = new objects.applicationFiles.Link({ page })
+ await linkObject.addExpiration({ resource, linkName, expireDate })
+ }
+)
+
+When(
+ '{string} sets the password of the public link named {string} of resource {string} to {string}',
+ async function (
+ this: World,
+ stepUser: string,
+ linkName: string,
+ resource: string,
+ newPassword: string
+ ): Promise {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const linkObject = new objects.applicationFiles.Link({ page })
- const shareInfo = stepTable.hashes()
- for (const linkShare of shareInfo) {
- const { resource, name, role, dateOfExpiration, password } = linkShare
- await linkObject.create({
- resource,
- name,
- role,
- dateOfExpiration,
- password,
- via: actionType === 'quick action' ? 'QUICK_ACTION' : 'SIDEBAR_PANEL'
- })
- }
+ await linkObject.addPassword({ resource, linkName, newPassword })
}
)
diff --git a/tests/e2e/cucumber/steps/app-files/page/public.ts b/tests/e2e/cucumber/steps/app-files/page/public.ts
index 1d3340d7ae3..a76c922fdde 100644
--- a/tests/e2e/cucumber/steps/app-files/page/public.ts
+++ b/tests/e2e/cucumber/steps/app-files/page/public.ts
@@ -42,7 +42,7 @@ When(
}
const { page } = actor
- const { url } = this.linksEnvironment.getLink({ key: name })
+ const { url } = this.linksEnvironment.getLink({ name })
const pageObject = new objects.applicationFiles.page.Public({ page })
await pageObject.open({ url })
}
diff --git a/tests/e2e/support/environment/link.ts b/tests/e2e/support/environment/link.ts
index 31318eb8819..5a5a3260274 100644
--- a/tests/e2e/support/environment/link.ts
+++ b/tests/e2e/support/environment/link.ts
@@ -2,21 +2,26 @@ import { Link } from '../types'
import { linkStore } from '../store'
export class LinksEnvironment {
- getLink({ key }: { key: string }): Link {
- if (!linkStore.has(key)) {
- throw new Error(`link with key '${key}' not found`)
+ getLink({ name }: { name: string }): Link {
+ if (!linkStore.has(name)) {
+ throw new Error(`link with name '${name}' not found`)
}
+ return linkStore.get(name)
+ }
- return linkStore.get(key)
+ updateLinkName({ key, link }: { key: string; link: Link }): any {
+ if (!linkStore.has(key)) {
+ throw new Error(`link with name '${key}' not found`)
+ }
+ linkStore.set(link.name, link)
+ linkStore.delete(key)
}
createLink({ key, link }: { key: string; link: Link }): Link {
if (linkStore.has(key)) {
throw new Error(`link with key '${key}' already exists`)
}
-
linkStore.set(key, link)
-
return link
}
diff --git a/tests/e2e/support/objects/app-files/link/actions.ts b/tests/e2e/support/objects/app-files/link/actions.ts
index ca2a0ac903f..cee3de63bf7 100644
--- a/tests/e2e/support/objects/app-files/link/actions.ts
+++ b/tests/e2e/support/objects/app-files/link/actions.ts
@@ -9,10 +9,26 @@ export interface createLinkArgs {
page: Page
resource: string
name: string
- role: string
- dateOfExpiration: string
- password: string
- via: 'SIDEBAR_PANEL' | 'QUICK_ACTION'
+}
+
+export type changeNameArgs = {
+ page: Page
+ resource: string
+ newName: string
+}
+
+export type addExpirationArgs = {
+ page: Page
+ resource: string
+ linkName: string
+ expireDate: string
+}
+
+export type addPasswordArgs = {
+ page: Page
+ resource: string
+ linkName: string
+ newPassword: string
}
export type changeRoleArgs = {
@@ -28,17 +44,13 @@ export type deleteLinkArgs = {
name: string
}
-const publicLinkSetNameInputField = '#oc-files-file-link-name'
-const publicLinkSelectRolesButton = '#files-file-link-role-button'
const publicLinkSetRoleButton = `#files-role-%s`
-const publicLinkExpiryDate = '#oc-files-file-link-expire-date'
-const publicLinkSetPasswordInputField = '#oc-files-file-link-password'
+const linkExpiryDatepicker = '.link-expiry-picker'
const publicLinkEditRoleButton =
`//h4[contains(@class, "oc-files-file-link-name") and text()="%s"]//ancestor::li//div[contains(@class, "link-details")]/` +
`div/button[contains(@class, "edit-public-link-role-dropdown-toggl")]`
-const publicLinkQuickActionButton = `//*[@data-test-resource-name="%s"]/ancestor::tr//button[contains(@class, "files-quick-action-collaborators")]`
const addPublicLinkButton = '#files-file-link-add'
-const savePublicLinkButton = '#oc-files-file-link-create'
+const getMostRecentLink = '//div[@id="oc-files-file-link"]//ul/li[1]'
const publicLink = `//ul/li/div/h4[contains(text(),'%s')]/following-sibling::div//p`
const publicLinkCurrentRole =
'//button[contains(@class,"edit-public-link-role-dropdown-toggl")]//span[contains(@class,"oc-invisible-sr")]'
@@ -46,61 +58,32 @@ const linkUpdateDialog = '//div[contains(@class,"oc-notification-message-title")
const editPublicLinkButton =
`//h4[contains(@class, "oc-files-file-link-name") and text()="%s"]` +
`//ancestor::li//div[contains(@class, "details-buttons")]//button[contains(@class, "edit-drop-trigger")]`
+const editPublicLinkRenameButton = '//button[text()="Rename"]'
+const editPublicLinkSetExpirationButton = '//button[text()="Add expiration date"]'
+const editPublicLinkAddPasswordButton = '//button[text()="Add password"]'
+const editPublicLinkInput = '.oc-modal-body input.oc-text-input'
+const editPublicLinkRenameConfirm = '.oc-modal-body-actions-confirm'
const deleteLinkButton =
`//h4[contains(@class, "oc-files-file-link-name") and text()="%s"]` +
`//ancestor::li//div[contains(@class, "details-buttons")]//button[text()="Delete link"]`
const confirmDeleteButton = `//button[contains(@class,"oc-modal-body-actions-confirm") and text()="Delete"]`
-const fillPublicLink = async (page, name, role, dateOfExpiration, password): Promise => {
- if (name) {
- await page.locator(publicLinkSetNameInputField).fill(name)
- }
-
- if (role) {
- await page.locator(publicLinkSelectRolesButton).click()
- await page.locator(util.format(publicLinkSetRoleButton, role)).click()
- }
-
- if (dateOfExpiration) {
- const newExpiryDate = getActualExpiryDate(
- dateOfExpiration.toLowerCase().match(/[dayrmonthwek]+/)[0] as any,
- dateOfExpiration
- )
-
- await page.locator(publicLinkExpiryDate).evaluate(
- (datePicker: any, { newExpiryDate }): any => {
- datePicker.__vue__.updateValue(newExpiryDate)
- },
- { newExpiryDate }
- )
- }
- if (password) {
- await page.locator(publicLinkSetPasswordInputField).fill(password)
- }
-}
-
export const createLink = async (args: createLinkArgs): Promise => {
- const { page, resource, name, role, dateOfExpiration, password, via } = args
+ const { page, resource } = args
const resourcePaths = resource.split('/')
const resourceName = resourcePaths.pop()
if (resourcePaths.length) {
await clickResource({ page: page, path: resourcePaths.join('/') })
}
- switch (via) {
- case 'QUICK_ACTION':
- await page.locator(util.format(publicLinkQuickActionButton, resourceName)).click()
- break
-
- case 'SIDEBAR_PANEL':
- await sidebar.open({ page: page, resource: resourceName })
- await sidebar.openPanel({ page: page, name: 'sharing' })
- break
- }
+ await sidebar.open({ page: page, resource: resourceName })
+ await sidebar.openPanel({ page: page, name: 'sharing' })
await page.locator(addPublicLinkButton).click()
- await fillPublicLink(page, name, role, dateOfExpiration, password)
- await page.locator(savePublicLinkButton).click()
- return await page.locator(util.format(publicLink, name)).textContent()
+ // const message = await page.locator(linkUpdateDialog).textContent()
+ // expect(message.trim()).toBe('Link was created successfully')
+ // const linkId = await page.getAttribute(getMostRecentLink, 'data-testid')
+ // return linkId.replace('files-link-id-', '')
+ return await page.locator(util.format(publicLink, 'Link')).textContent()
}
export const changeRole = async (args: changeRoleArgs): Promise => {
@@ -119,6 +102,66 @@ export const changeRole = async (args: changeRoleArgs): Promise => {
return await page.locator(publicLinkCurrentRole).textContent()
}
+export const changeName = async (args: changeNameArgs): Promise => {
+ const { page, resource, newName } = args
+ const resourcePaths = resource.split('/')
+ const resourceName = resourcePaths.pop()
+ if (resourcePaths.length) {
+ await clickResource({ page: page, path: resourcePaths.join('/') })
+ }
+ await sidebar.open({ page: page, resource: resourceName })
+ await sidebar.openPanel({ page: page, name: 'sharing' })
+ await page.locator(util.format(editPublicLinkButton, 'Link')).click()
+ await page.locator(editPublicLinkRenameButton).click()
+ await page.locator(editPublicLinkInput).fill(newName)
+ await page.locator(editPublicLinkRenameConfirm).click()
+ const message = await page.locator(linkUpdateDialog).textContent()
+ expect(message.trim()).toBe('Link was updated successfully')
+ return await page.locator(getMostRecentLink + '//h4').textContent()
+}
+
+export const addPassword = async (args: addPasswordArgs): Promise => {
+ const { page, resource, linkName, newPassword } = args
+ const resourcePaths = resource.split('/')
+ const resourceName = resourcePaths.pop()
+ if (resourcePaths.length) {
+ await clickResource({ page: page, path: resourcePaths.join('/') })
+ }
+ await sidebar.open({ page: page, resource: resourceName })
+ await sidebar.openPanel({ page: page, name: 'sharing' })
+ await page.locator(util.format(editPublicLinkButton, linkName)).click()
+ await page.locator(editPublicLinkAddPasswordButton).click()
+ await page.locator(editPublicLinkInput).fill(newPassword)
+ await page.locator(editPublicLinkRenameConfirm).click()
+ const message = await page.locator(linkUpdateDialog).textContent()
+ expect(message.trim()).toBe('Link was updated successfully')
+}
+
+export const addExpiration = async (args: addExpirationArgs): Promise => {
+ const { page, resource, linkName, expireDate } = args
+ const resourcePaths = resource.split('/')
+ const resourceName = resourcePaths.pop()
+ if (resourcePaths.length) {
+ await clickResource({ page: page, path: resourcePaths.join('/') })
+ }
+ await sidebar.open({ page: page, resource: resourceName })
+ await sidebar.openPanel({ page: page, name: 'sharing' })
+ await page.locator(util.format(editPublicLinkButton, linkName)).click()
+ await page.locator(editPublicLinkSetExpirationButton).click()
+
+ const newExpiryDate = getActualExpiryDate(
+ expireDate.toLowerCase().match(/[dayrmonthwek]+/)[0] as any,
+ expireDate
+ )
+
+ await page.locator(linkExpiryDatepicker).evaluate(
+ (datePicker: any, { newExpiryDate }): any => {
+ datePicker.__vue__.updateValue(newExpiryDate)
+ },
+ { newExpiryDate }
+ )
+}
+
export const deleteLink = async (args: deleteLinkArgs): Promise => {
const { page, resourceName, name } = args
await sidebar.open({ page: page, resource: resourceName })
diff --git a/tests/e2e/support/objects/app-files/link/index.ts b/tests/e2e/support/objects/app-files/link/index.ts
index 5f83826f2aa..6d5d2f344e3 100644
--- a/tests/e2e/support/objects/app-files/link/index.ts
+++ b/tests/e2e/support/objects/app-files/link/index.ts
@@ -2,6 +2,12 @@ import { Page } from 'playwright'
import {
createLink,
createLinkArgs,
+ changeName,
+ changeNameArgs,
+ addExpiration,
+ addExpirationArgs,
+ addPassword,
+ addPasswordArgs,
changeRole,
changeRoleArgs,
deleteLinkArgs,
@@ -24,12 +30,40 @@ export class Link {
this.#linksEnvironment.createLink({
key: args.name,
- link: { name: args.name, url, password: args.password }
+ link: { name: args.name, url }
})
await this.#page.goto(startUrl)
}
+ async changeName(args: Omit): Promise {
+ const startUrl = this.#page.url()
+ const name = await changeName({ page: this.#page, ...args })
+ const currentLink = this.#linksEnvironment.getLink({ name: 'Link' })
+
+ this.#linksEnvironment.updateLinkName({
+ key: currentLink.name,
+ link: { ...currentLink, name }
+ })
+ await this.#page.goto(startUrl)
+ return name
+ }
+
+ async addExpiration(args: Omit): Promise {
+ const startUrl = this.#page.url()
+ // const name =
+ await addExpiration({ page: this.#page, ...args })
+ await this.#page.goto(startUrl)
+ // return
+ }
+
+ async addPassword(args: Omit): Promise {
+ const startUrl = this.#page.url()
+ // const name =
+ await addPassword({ page: this.#page, ...args })
+ await this.#page.goto(startUrl)
+ }
+
async changeRole(args: Omit): Promise {
const startUrl = this.#page.url()
const role = await changeRole({ page: this.#page, ...args })