From df81caa9f43e6aec950f81755e3d2cda45892100 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 8 May 2024 09:48:53 +0545 Subject: [PATCH 1/3] Fixed failure in lock test --- tests/e2e/cucumber/features/app-provider/lock.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/cucumber/features/app-provider/lock.feature b/tests/e2e/cucumber/features/app-provider/lock.feature index 5436e69fb03..816362b691f 100644 --- a/tests/e2e/cucumber/features/app-provider/lock.feature +++ b/tests/e2e/cucumber/features/app-provider/lock.feature @@ -23,7 +23,7 @@ Feature: lock When "Brian" opens the following file in Collabora | resource | | test.odt | - Then "Brian" should see the content "some content" in editor "OnlyOffice" + Then "Brian" should see the content "some content" in editor "Collabora" # file-locked And "Alice" should get "file-locked" SSE event From ffc80656280fa4220e751d7391f2faae36ff8a32 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 8 May 2024 13:13:32 +0545 Subject: [PATCH 2/3] Fixed able to manage share step: open sharing panel --- tests/e2e/cucumber/features/app-provider/lock.feature | 4 ++-- tests/e2e/cucumber/steps/ui/shares.ts | 5 ++++- tests/e2e/support/objects/app-files/share/index.ts | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/e2e/cucumber/features/app-provider/lock.feature b/tests/e2e/cucumber/features/app-provider/lock.feature index 816362b691f..4a86a4fdbe9 100644 --- a/tests/e2e/cucumber/features/app-provider/lock.feature +++ b/tests/e2e/cucumber/features/app-provider/lock.feature @@ -34,7 +34,7 @@ Feature: lock # checking that user cannot delete or change share of the locked file # https://github.com/owncloud/web/issues/10507 - And "Alice" should not be able to manage share with user "Brian" + And "Alice" should not be able to manage share for file "test.odt" with user "Brian" # checking that sharing and creating link of the locked file is possible And "Alice" creates a public link of following resource using the sidebar panel @@ -48,7 +48,7 @@ Feature: lock When "Brian" closes the file viewer Then "Alice" should get "file-unlocked" SSE event And for "Alice" file "test.odt" should not be locked - And "Alice" should be able to manage share with user "Brian" + And "Alice" should be able to manage share for file "test.odt" with user "Brian" And "Brian" logs out And "Alice" logs out diff --git a/tests/e2e/cucumber/steps/ui/shares.ts b/tests/e2e/cucumber/steps/ui/shares.ts index 54af5bf4244..79f84fdbb46 100644 --- a/tests/e2e/cucumber/steps/ui/shares.ts +++ b/tests/e2e/cucumber/steps/ui/shares.ts @@ -323,11 +323,12 @@ Then( ) Then( - /^"([^"]*)" (should|should not) be able to manage share with user "([^"]*)"$/, + /^"([^"]*)" (should|should not) be able to manage share for file "([^"]*)" with user "([^"]*)"$/, async function ( this: World, stepUser: any, actionType: string, + resource: string, recipient: string ): Promise { const { page } = this.actorsEnvironment.getActor({ key: stepUser }) @@ -339,6 +340,8 @@ Then( this.usersEnvironment.getUser({ key: recipient }) ) + await shareObject.openSharingPanel(resource) + if (actionType === 'should') { await expect(changeRole).not.toBeDisabled() await expect(changeShare).not.toBeDisabled() diff --git a/tests/e2e/support/objects/app-files/share/index.ts b/tests/e2e/support/objects/app-files/share/index.ts index 8727f1a6436..5c926adebc0 100644 --- a/tests/e2e/support/objects/app-files/share/index.ts +++ b/tests/e2e/support/objects/app-files/share/index.ts @@ -112,4 +112,8 @@ export class Share { changeShareLocator(recipient: User): Locator { return po.changeRoleLocator({ page: this.#page, recipient }) } + + async openSharingPanel(resource): Promise { + await po.openSharingPanel(this.#page, resource) + } } From a5a9a6ac13d4c5a89fffc24761418c8623026391 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 8 May 2024 14:05:48 +0545 Subject: [PATCH 3/3] Addressed reviews --- tests/e2e/cucumber/features/app-provider/lock.feature | 4 ++-- tests/e2e/cucumber/steps/ui/shares.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/cucumber/features/app-provider/lock.feature b/tests/e2e/cucumber/features/app-provider/lock.feature index 4a86a4fdbe9..861b62fddb7 100644 --- a/tests/e2e/cucumber/features/app-provider/lock.feature +++ b/tests/e2e/cucumber/features/app-provider/lock.feature @@ -34,7 +34,7 @@ Feature: lock # checking that user cannot delete or change share of the locked file # https://github.com/owncloud/web/issues/10507 - And "Alice" should not be able to manage share for file "test.odt" with user "Brian" + And "Alice" should not be able to manage share of a file "test.odt" for user "Brian" # checking that sharing and creating link of the locked file is possible And "Alice" creates a public link of following resource using the sidebar panel @@ -48,7 +48,7 @@ Feature: lock When "Brian" closes the file viewer Then "Alice" should get "file-unlocked" SSE event And for "Alice" file "test.odt" should not be locked - And "Alice" should be able to manage share for file "test.odt" with user "Brian" + And "Alice" should be able to manage share of a file "test.odt" for user "Brian" And "Brian" logs out And "Alice" logs out diff --git a/tests/e2e/cucumber/steps/ui/shares.ts b/tests/e2e/cucumber/steps/ui/shares.ts index 79f84fdbb46..de3f8cf7268 100644 --- a/tests/e2e/cucumber/steps/ui/shares.ts +++ b/tests/e2e/cucumber/steps/ui/shares.ts @@ -323,7 +323,7 @@ Then( ) Then( - /^"([^"]*)" (should|should not) be able to manage share for file "([^"]*)" with user "([^"]*)"$/, + /^"([^"]*)" (should|should not) be able to manage share of a file "([^"]*)" for user "([^"]*)"$/, async function ( this: World, stepUser: any,