From 9ff8cfabd32b33b22f50d4685f8148f1bbc03336 Mon Sep 17 00:00:00 2001 From: pradip Date: Mon, 19 Aug 2024 11:36:04 +0545 Subject: [PATCH] test(refactor): try to select multiple action texts --- .drone.env | 2 +- .../cucumber/features/app-provider/urlJourneys.feature | 3 ++- tests/e2e/cucumber/steps/ui/resources.ts | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.drone.env b/.drone.env index f757382bbc2..f19d5e338c2 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The version of OCIS to use in pipelines that test against OCIS -OCIS_COMMITID=ed101c14e3b3b8dbcd4cc35084edda0545ad5ce8 +OCIS_COMMITID=b4dab08608d5ff5bb8ab81da312a24e49c7a0bb6 OCIS_BRANCH=master diff --git a/tests/e2e/cucumber/features/app-provider/urlJourneys.feature b/tests/e2e/cucumber/features/app-provider/urlJourneys.feature index bc1dee22c40..738bf182c06 100644 --- a/tests/e2e/cucumber/features/app-provider/urlJourneys.feature +++ b/tests/e2e/cucumber/features/app-provider/urlJourneys.feature @@ -6,7 +6,7 @@ Feature: url stability for mobile and desktop client # This is a minimal test for the integration of ocis with different online office suites like Collabora and OnlyOffice # Check that the file can be opened in collabora or onlyoffice using the url. https://github.com/owncloud/web/issues/9897 - + Scenario: open office suite files with Collabora and onlyOffice Given "Admin" creates following users using API | id | @@ -18,6 +18,7 @@ Feature: url stability for mobile and desktop client And "Alice" creates the following resources | resource | type | content | | MicrosoftWord.docx | Microsoft Word | Microsoft Word Content | + And for "Alice" file "MicrosoftWord.docx" should not be locked And "Alice" opens the "files" app # desktop feature diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index e8d58cc4155..0307a2ac034 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -838,7 +838,8 @@ Then( actionType === 'should' ? await expect(lockLocator).toBeVisible() - : await expect(lockLocator).not.toBeVisible() + : // can take more than 5 seconds for lock to be released in case of OnlyOffice + await expect(lockLocator).not.toBeVisible({ timeout: config.timeout }) } ) @@ -926,10 +927,11 @@ Then( const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const resourceObject = new objects.applicationFiles.Resource({ page }) for (const info of stepTable.hashes()) { + const actions = await resourceObject.getAllAvailableActions({ resource }) if (actionType === 'should') { - expect(await resourceObject.getAllAvailableActions({ resource })).toContain(info.action) + expect(actions.some((action) => action.startsWith(info.action))).toBe(true) } else { - expect(await resourceObject.getAllAvailableActions({ resource })).not.toContain(info.action) + expect(actions.some((action) => action.startsWith(info.action))).toBe(false) } } }