From d00f0b4eae6963e244cdb9fffa1bf8ac2d8d6dce Mon Sep 17 00:00:00 2001 From: prajwol Date: Thu, 15 Feb 2024 14:26:10 +0545 Subject: [PATCH 1/3] added e2e test to receive two shares with same name --- .../features/smoke/shares/share.feature | 30 +++++++++++++++++++ tests/e2e/cucumber/steps/ui/resources.ts | 2 +- .../objects/app-files/resource/actions.ts | 14 +++++++++ .../objects/app-files/resource/index.ts | 2 ++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tests/e2e/cucumber/features/smoke/shares/share.feature b/tests/e2e/cucumber/features/smoke/shares/share.feature index 9c4dec9793c..4d5053b1af3 100644 --- a/tests/e2e/cucumber/features/smoke/shares/share.feature +++ b/tests/e2e/cucumber/features/smoke/shares/share.feature @@ -158,3 +158,33 @@ Feature: share And "Brian" navigates to the shared with me page And "Brian" logs out + + + Scenario: receive two shares with same name + Given "Admin" creates following users using API + | id | + | Carol | + And "Alice" logs in + And "Alice" creates the following folder in personal space using API + | name | + | test-folder | + And "Alice" opens the "files" app + And "Alice" shares the following resource using the sidebar panel + | resource | recipient | type | role | + | test-folder | Brian | user | Can view | + And "Alice" logs out + And "Carol" logs in + And "Carol" creates the following folder in personal space using API + | name | + | test-folder | + And "Carol" opens the "files" app + And "Carol" shares the following resource using the sidebar panel + | resource | recipient | type | role | + | test-folder | Brian | user | Can view | + And "Carol" logs out + When "Brian" navigates to the shared with me page + Then following resources should be displayed in the Shares for user "Brian" + | resource | + | test-folder | + | test-folder (1) | + And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index 562bbd1f31c..2daf04eb84a 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -319,7 +319,7 @@ When( ) Then( - /^following resources (should|should not) be displayed in the (search list|files list) for user "([^"]*)"$/, + /^following resources (should|should not) be displayed in the (search list|files list|Shares) for user "([^"]*)"$/, async function ( this: World, actionType: string, diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 2fcf0f17156..c0d6828efab 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -114,6 +114,7 @@ const highlightedFileRowSelector = '#files-space-table tr.oc-table-highlighted' const emptyTrashbinButtonSelector = '.oc-files-actions-empty-trash-bin-trigger' const resourceLockIcon = '//*[@data-test-resource-name="%s"]/ancestor::tr//td//span[contains(@class, "oc-resource-icon-status-badge-inner")]' +const sharesNavigationButtonSelector = '.oc-sidebar-nav [data-nav-name="files-shares"]' export const clickResource = async ({ page, @@ -1360,6 +1361,19 @@ export const getDisplayedResourcesFromFilesList = async (page): Promise => { + const files = [] + await page.locator(sharesNavigationButtonSelector).click() + const result = await page.locator('[data-test-resource-path]') + + const count = await result.count() + for (let i = 0; i < count; i++) { + files.push(await result.nth(i).getAttribute('data-test-resource-name')) + } + + return files +} + export interface switchViewModeArgs { page: Page target: 'resource-table' | 'resource-tiles' diff --git a/tests/e2e/support/objects/app-files/resource/index.ts b/tests/e2e/support/objects/app-files/resource/index.ts index d302e4b0bf1..dce63168cfb 100644 --- a/tests/e2e/support/objects/app-files/resource/index.ts +++ b/tests/e2e/support/objects/app-files/resource/index.ts @@ -187,6 +187,8 @@ export class Resource { return po.getDisplayedResourcesFromFilesList(this.#page) } else if (args.keyword === 'search list') { return po.getDisplayedResourcesFromSearch(this.#page) + } else if (args.keyword === 'Shares') { + return po.getDisplayedResourcesFromShares(this.#page) } else { throw new Error('Unknown keyword') } From 6d96de703317c4b6da2c73c4fd8d129509b330a9 Mon Sep 17 00:00:00 2001 From: prajwol Date: Thu, 15 Feb 2024 14:27:03 +0545 Subject: [PATCH 2/3] removed web UI test related to receiving two shares with same name --- ...-failures-with-ocis-server-ocis-storage.md | 4 -- .../acceptShares.feature | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) 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 853ee14fdab..28dcb6a447c 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -24,7 +24,3 @@ Other free text and markdown formatting can be used elsewhere in the document if ### [empty subfolder inside a folder to be uploaded is not created on the server](https://github.com/owncloud/web/issues/6348) - [webUIUpload/upload.feature:43](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L43) - -### [PROPFIND to sub-folder of a shared resources with same name gives 404](https://github.com/owncloud/ocis/issues/3859) - -- [webUISharingAcceptShares/acceptShares.feature:16](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L16) diff --git a/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature b/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature index 6b7ece6e5ae..8006536d460 100644 --- a/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature +++ b/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature @@ -12,6 +12,63 @@ Feature: accept/decline shares coming from internal users And user "Brian" has logged in using the webUI + Scenario: User receives files when auto accept share is disabled - oCIS behavior + Given user "Alice" has created file "toshare.txt" in the server + And user "Alice" has uploaded file with content "test" to "toshare.txt" in the server + And user "Alice" has shared file "toshare.txt" with user "Brian" in the server + When the user browses to the shared-with-me page + Then file "toshare.txt" shared by "Alice Hansen" should be in "Accepted" state on the webUI + When the user browses to the files page + Then file "toshare.txt" should not be listed on the webUI + And folder "Shares" should not be listed on the webUI + + + Scenario: receive shares with same name from different users + Given user "Carol" has been created with default attributes and without skeleton files in the server + And user "Carol" has created file "lorem.txt" in the server + And user "Alice" has created file "lorem.txt" in the server + And user "Carol" has shared file "lorem.txt" with user "Brian" in the server + And user "Alice" has shared file "lorem.txt" with user "Brian" in the server + When the user browses to the shared-with-me page + Then file "lorem (1).txt" shared by "Alice Hansen" should be in "Accepted" state on the webUI + And file "lorem.txt" shared by "Carol King" should be in "Accepted" state on the webUI + + @ocisSmokeTest + Scenario: decline an offered (pending) share + Given user "Alice" has created file "toshare.txt" in the server + And user "Alice" has created file "anotherfile.txt" in the server + And user "Alice" has uploaded file with content "test" to "toshare.txt" in the server + And user "Alice" has uploaded file with content "test" to "anotherfile.txt" in the server + And user "Alice" has shared file "toshare.txt" with user "Brian" in the server + And user "Alice" has shared file "anotherfile.txt" with user "Brian" in the server + When the user browses to the shared-with-me page in accepted shares view + And the user declines share "toshare.txt" offered by user "Alice Hansen" using the webUI + And the user browses to the shared-with-me page in declined shares view + Then file "toshare.txt" shared by "Alice Hansen" should be in "Declined" state on the webUI + And file "anotherfile.txt" shared by "Alice Hansen" should be in "Accepted" state on the webUI + When the user browses to the files page + Then file "toshare.txt" should not be listed on the webUI + And file "anotherfile.txt" should not be listed on the webUI + + @issue-3101 @issue-4102 + Scenario: Decline multiple accepted shares at once from shared with me page + Given user "Alice" has created file "lorem.txt" in the server + And user "Alice" has created file "data.zip" in the server + And user "Alice" has created folder "simple-folder" in the server + And user "Alice" has shared folder "simple-folder" with user "Brian" in the server + And user "Alice" has shared file "lorem.txt" with user "Brian" in the server + And user "Alice" has shared file "data.zip" with user "Brian" in the server + When the user browses to the shared-with-me page in accepted shares view + And the user batch declines these shares using the webUI + | name | + | data.zip | + | lorem.txt | + | simple-folder | + And the user browses to the shared-with-me page in declined shares view + Then file "data.zip" shared by "Alice Hansen" should be in "Declined" state on the webUI + And file "lorem.txt" shared by "Alice Hansen" should be in "Declined" state on the webUI + And folder "simple-folder" shared by "Alice Hansen" should be in "Declined" state on the webUI + @issue-3859 Scenario: receive shares with same name from different users, accept one by one Given user "Carol" has been created with default attributes and without skeleton files in the server From 8717522b30887168125b81f95a1d17f9edc02a65 Mon Sep 17 00:00:00 2001 From: prajwol Date: Thu, 15 Feb 2024 16:53:47 +0545 Subject: [PATCH 3/3] added step to share file with same name --- .drone.star | 3 - .../acceptShares.feature | 85 ------------------- .../features/smoke/shares/share.feature | 21 +++-- 3 files changed, 16 insertions(+), 93 deletions(-) delete mode 100644 tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature diff --git a/.drone.star b/.drone.star index 13db206950d..ec8050b9ed3 100644 --- a/.drone.star +++ b/.drone.star @@ -99,9 +99,6 @@ config = { "webUIPreview", "webUILogin", ], - "oCISSharingBasic": [ - "webUISharingAcceptShares", - ], "oCISFiles1": [ "webUICreateFilesFolders", "webUIDeleteFilesFolders", diff --git a/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature b/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature deleted file mode 100644 index 8006536d460..00000000000 --- a/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature +++ /dev/null @@ -1,85 +0,0 @@ -Feature: accept/decline shares coming from internal users - As a user - I want to have control of which received shares I accept - So that I can keep my file system clean - - Background: - Given the administrator has set the default folder for received shares to "Shares" in the server - And these users have been created with default attributes and without skeleton files in the server: - | username | - | Alice | - | Brian | - And user "Brian" has logged in using the webUI - - - Scenario: User receives files when auto accept share is disabled - oCIS behavior - Given user "Alice" has created file "toshare.txt" in the server - And user "Alice" has uploaded file with content "test" to "toshare.txt" in the server - And user "Alice" has shared file "toshare.txt" with user "Brian" in the server - When the user browses to the shared-with-me page - Then file "toshare.txt" shared by "Alice Hansen" should be in "Accepted" state on the webUI - When the user browses to the files page - Then file "toshare.txt" should not be listed on the webUI - And folder "Shares" should not be listed on the webUI - - - Scenario: receive shares with same name from different users - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "Carol" has created file "lorem.txt" in the server - And user "Alice" has created file "lorem.txt" in the server - And user "Carol" has shared file "lorem.txt" with user "Brian" in the server - And user "Alice" has shared file "lorem.txt" with user "Brian" in the server - When the user browses to the shared-with-me page - Then file "lorem (1).txt" shared by "Alice Hansen" should be in "Accepted" state on the webUI - And file "lorem.txt" shared by "Carol King" should be in "Accepted" state on the webUI - - @ocisSmokeTest - Scenario: decline an offered (pending) share - Given user "Alice" has created file "toshare.txt" in the server - And user "Alice" has created file "anotherfile.txt" in the server - And user "Alice" has uploaded file with content "test" to "toshare.txt" in the server - And user "Alice" has uploaded file with content "test" to "anotherfile.txt" in the server - And user "Alice" has shared file "toshare.txt" with user "Brian" in the server - And user "Alice" has shared file "anotherfile.txt" with user "Brian" in the server - When the user browses to the shared-with-me page in accepted shares view - And the user declines share "toshare.txt" offered by user "Alice Hansen" using the webUI - And the user browses to the shared-with-me page in declined shares view - Then file "toshare.txt" shared by "Alice Hansen" should be in "Declined" state on the webUI - And file "anotherfile.txt" shared by "Alice Hansen" should be in "Accepted" state on the webUI - When the user browses to the files page - Then file "toshare.txt" should not be listed on the webUI - And file "anotherfile.txt" should not be listed on the webUI - - @issue-3101 @issue-4102 - Scenario: Decline multiple accepted shares at once from shared with me page - Given user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created file "data.zip" in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has shared folder "simple-folder" with user "Brian" in the server - And user "Alice" has shared file "lorem.txt" with user "Brian" in the server - And user "Alice" has shared file "data.zip" with user "Brian" in the server - When the user browses to the shared-with-me page in accepted shares view - And the user batch declines these shares using the webUI - | name | - | data.zip | - | lorem.txt | - | simple-folder | - And the user browses to the shared-with-me page in declined shares view - Then file "data.zip" shared by "Alice Hansen" should be in "Declined" state on the webUI - And file "lorem.txt" shared by "Alice Hansen" should be in "Declined" state on the webUI - And folder "simple-folder" shared by "Alice Hansen" should be in "Declined" state on the webUI - - @issue-3859 - Scenario: receive shares with same name from different users, accept one by one - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "Carol" has created folder "/simple-folder" in the server - And user "Carol" has created folder "/simple-folder/from_Carol" in the server - And user "Carol" has shared folder "/simple-folder" with user "Brian" in the server - And user "Alice" has created folder "/simple-folder" in the server - And user "Alice" has created folder "/simple-folder/from_Alice" in the server - And user "Alice" has shared folder "/simple-folder" with user "Brian" in the server - And the user has browsed to the shared-with-me page - Then folder "simple-folder" shared by "Alice Hansen" should be in "Accepted" state on the webUI - Then folder "simple-folder (2)" shared by "Carol King" should be in "Accepted" state on the webUI - And as "Brian" folder "from_Alice" should exist inside folder "/Shares/simple-folder" in the server - And as "Brian" folder "from_Carol" should exist inside folder "/Shares/simple-folder (2)" in the server diff --git a/tests/e2e/cucumber/features/smoke/shares/share.feature b/tests/e2e/cucumber/features/smoke/shares/share.feature index 4d5053b1af3..423188c1e17 100644 --- a/tests/e2e/cucumber/features/smoke/shares/share.feature +++ b/tests/e2e/cucumber/features/smoke/shares/share.feature @@ -168,23 +168,34 @@ Feature: share And "Alice" creates the following folder in personal space using API | name | | test-folder | + And "Alice" creates the following files into personal space using API + | pathToFile | content | + | testfile.txt | example text | And "Alice" opens the "files" app And "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | + | testfile.txt | Brian | user | Can view | | test-folder | Brian | user | Can view | And "Alice" logs out And "Carol" logs in And "Carol" creates the following folder in personal space using API | name | | test-folder | + And "Carol" creates the following files into personal space using API + | pathToFile | content | + | testfile.txt | example text | And "Carol" opens the "files" app And "Carol" shares the following resource using the sidebar panel - | resource | recipient | type | role | - | test-folder | Brian | user | Can view | + | resource | recipient | type | role | + | testfile.txt | Brian | user | Can view | + | test-folder | Brian | user | Can view | And "Carol" logs out When "Brian" navigates to the shared with me page Then following resources should be displayed in the Shares for user "Brian" - | resource | - | test-folder | - | test-folder (1) | + | resource | + | testfile.txt | + | test-folder | + # https://github.com/owncloud/ocis/issues/8471 + # | testfile (1).txt | + # | test-folder (1) | And "Brian" logs out