From 66f312adf62a244c9fc494ace84ce80674df2a27 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Tue, 20 Jun 2023 15:32:26 +0545 Subject: [PATCH] Tika version is fixed, adding tag using API --- .drone.star | 2 +- docker-compose.yml | 2 +- .../smoke/fullTextSearch.ocis.feature | 15 +-------------- tests/e2e/cucumber/steps/api.ts | 19 ------------------- tests/e2e/cucumber/steps/ui/resources.ts | 6 +++--- .../objects/app-files/resource/actions.ts | 8 ++++---- .../objects/app-files/resource/index.ts | 4 ++-- 7 files changed, 12 insertions(+), 44 deletions(-) diff --git a/.drone.star b/.drone.star index f6d86745aa3..bee0e7bb6fc 100644 --- a/.drone.star +++ b/.drone.star @@ -4,7 +4,7 @@ FEDERATED = 2 NOTIFICATIONS = 3 ALPINE_GIT = "alpine/git:latest" -APACHE_TIKA = "apache/tika:latest" +APACHE_TIKA = "apache/tika:2.8.0.0" DEEPDIVER_DOCKER_ORACLE_XE_11G = "deepdiver/docker-oracle-xe-11g:latest" DRONE_CLI_ALPINE = "drone/cli:alpine" MINIO_MC = "minio/mc:RELEASE.2021-10-07T04-19-58Z" diff --git a/docker-compose.yml b/docker-compose.yml index 5f655a72ac9..56a332ae5f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -244,7 +244,7 @@ services: command: tika:9998 tika: - image: apache/tika:latest + image: apache/tika:2.8.0.0 container_name: web_tika ports: - 9998:9998 diff --git a/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature b/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature index 6d6d6141bea..45c3f3d92e0 100644 --- a/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature @@ -13,7 +13,6 @@ Feature: Search And "Admin" assigns following roles to the users using API | id | role | | Brian | Space Admin | - And "Alice" logs in And "Alice" creates the following folder in personal space using API | name | @@ -24,7 +23,6 @@ Feature: Search And "Alice" shares the following resource using API | resource | recipient | type | role | | folderToShare | Brian | user | Can edit | - And "Brian" logs in And "Brian" accepts the following share using API | name | @@ -38,7 +36,6 @@ Feature: Search | filesForUpload/textfile.txt | fileWithTag.txt | | filesForUpload/textfile.txt | withTag.txt | | filesForUpload/textfile.txt | testFolder/innerTextfile.txt | - And "Brian" creates the following project spaces using API | name | id | | FullTextSearch | fulltextsearch.1 | @@ -50,18 +47,13 @@ Feature: Search | spaceFolder/spaceTextfile.txt | This is test file. | And "Brian" opens the "files" app -# And "Brian" adds the following tags for the following resources using API -# | resource | tags | -# | fileWithTag.txt | tag 1 | -# | withTag.txt | tag 1 | And "Brian" adds the following tags for the following resources using the sidebar panel | resource | tags | | fileWithTag.txt | tag 1 | | withTag.txt | tag 1 | - Scenario: Search for content of file - And "Brian" opens the "files" app + Scenario: Search for content of file When "Brian" searches "" using the global search bar Then "Brian" should see the message "Search for files" on the webUI @@ -94,9 +86,4 @@ Feature: Search | fileToShare.txt | | fileWithTag.txt | | withTag.txt | - - When "Brian" opens the following file in texteditor - | resource | - | textfile.txt | - Then "Brian" should see the message "No results found" on the webUI And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/api.ts b/tests/e2e/cucumber/steps/api.ts index 52842a628ce..80ea257e137 100644 --- a/tests/e2e/cucumber/steps/api.ts +++ b/tests/e2e/cucumber/steps/api.ts @@ -298,22 +298,3 @@ Given( } } ) - -// Given( -// '{string} adds the following tags for the following resources using API', -// async function ( -// this: World, -// stepUser: string, -// stepTable: DataTable -// ): Promise { -// const user = this.usersEnvironment.getUser({ key: stepUser }) -// for (const info of stepTable.hashes()) { -// await api.graph.addTagsToTheResource({ -// user, -// shareWith: info.user, -// shareType: info.shareType, -// role: info.role -// }) -// } -// } -// ) diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index 8de33bb59a0..4de7deb015f 100644 --- a/tests/e2e/cucumber/steps/ui/resources.ts +++ b/tests/e2e/cucumber/steps/ui/resources.ts @@ -433,15 +433,15 @@ When( ) When( - /^"([^"].*)" opens the following file(?:s)? in (mediaviewer|pdfviewer|texteditor)$/, + /^"([^"].*)" opens the following file(?:s)? in (mediaviewer|pdfviewer)$/, async function (this: World, stepUser: string, actionType: string, stepTable: DataTable) { const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const resourceObject = new objects.applicationFiles.Resource({ page }) for (const info of stepTable.hashes()) { - await resourceObject.openFile({ + await resourceObject.openFileInViewer({ name: info.resource, - actionType: actionType as 'mediaviewer' | 'pdfviewer' | 'texteditor' + actionType: actionType as 'mediaviewer' | 'pdfviewer' }) } } diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 4c1e221addb..f15d4e31bd4 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -23,7 +23,7 @@ const checkBoxForTrashbin = `//*[@data-test-resource-path="%s"]//ancestor::tr//i export const fileRow = '//ancestor::*[(contains(@class, "oc-tile-card") or contains(@class, "oc-tbody-tr"))]' export const resourceNameSelector = - ':is(#files-space-table, .oc-tiles-item, #files-shared-with-me-accepted-section, .files-table) [data-test-resource-name="%s"]' + ':is(#files-space-table, .oc-tiles-item, #files-shared-with-me-accepted-section) [data-test-resource-name="%s"]' const breadcrumbResourceNameSelector = '//span[contains(@class, "oc-breadcrumb-item-text") and text()="%s"]' const addNewResourceButton = `#new-file-menu-btn` @@ -1108,13 +1108,13 @@ export const removeTagsFromResource = async (args: resourceTagsArgs): Promise => { +export const openFileInViewer = async (args: openFileInViewerArgs): Promise => { const { page, name, actionType } = args if (actionType === 'mediaviewer') { diff --git a/tests/e2e/support/objects/app-files/resource/index.ts b/tests/e2e/support/objects/app-files/resource/index.ts index 043b3581f53..bed1cf5ce98 100644 --- a/tests/e2e/support/objects/app-files/resource/index.ts +++ b/tests/e2e/support/objects/app-files/resource/index.ts @@ -201,8 +201,8 @@ export class Resource { await po.editResources({ ...args, page: this.#page }) } - async openFile(args: Omit): Promise { - await po.openFile({ ...args, page: this.#page }) + async openFileInViewer(args: Omit): Promise { + await po.openFileInViewer({ ...args, page: this.#page }) } async addTags(args: Omit): Promise {