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..60167bf3ce5 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 | @@ -48,20 +45,14 @@ Feature: Search And "Brian" creates the following file in space "FullTextSearch" using API | name | content | | 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 + And "Brian" adds the following tags for the following resources using API | 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 + Given "Brian" opens the "files" app When "Brian" searches "" using the global search bar Then "Brian" should see the message "Search for files" on the webUI diff --git a/tests/e2e/cucumber/steps/api.ts b/tests/e2e/cucumber/steps/api.ts index 52842a628ce..d95953295d5 100644 --- a/tests/e2e/cucumber/steps/api.ts +++ b/tests/e2e/cucumber/steps/api.ts @@ -299,21 +299,16 @@ 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 -// }) -// } -// } -// ) +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, + resourceName: info.resource, + tag: info.tags + }) + } + } +) diff --git a/tests/e2e/support/api/davSpaces/spaces.ts b/tests/e2e/support/api/davSpaces/spaces.ts index 7e30841057a..bc5cc8e485c 100644 --- a/tests/e2e/support/api/davSpaces/spaces.ts +++ b/tests/e2e/support/api/davSpaces/spaces.ts @@ -87,6 +87,7 @@ export const uploadFileInPersonalSpace = async ({ const webDavEndPathToRoot = config.ocis ? 'spaces/' + (await getPersonalSpaceId({ user })) : 'files/' + user.id + console.log('User id:: ', await getPersonalSpaceId({ user })) await createFile({ user, pathToFile, content, webDavEndPathToRoot }) } @@ -138,11 +139,13 @@ export const uploadFileInsideSpaceBySpaceName = async ({ export const getDataOfFileInsideSpace = async ({ user, pathToFileName, - spaceName + spaceName, + spaceType = 'project' }: { user: User pathToFileName: string spaceName: string + spaceType?: string }): Promise => { const body = '\n' + @@ -174,7 +177,7 @@ export const getDataOfFileInsideSpace = async ({ 'remote.php', 'dav', 'spaces', - await getSpaceIdBySpaceName({ user, spaceType: 'project', spaceName }), + await getSpaceIdBySpaceName({ user, spaceType: spaceType, spaceName }), pathToFileName ), body: body, @@ -188,16 +191,19 @@ export const getDataOfFileInsideSpace = async ({ export const getIdOfFileInsideSpace = async ({ user, pathToFileName, - spaceName + spaceName, + spaceType }: { user: User pathToFileName: string spaceName: string + spaceType?: string }): Promise => { const fileDataResponse = await getDataOfFileInsideSpace({ user, pathToFileName, - spaceName + spaceName, + spaceType }) // extract file id form the response return _.get(fileDataResponse, '[0][d:prop][oc:fileid]')._text diff --git a/tests/e2e/support/api/graph/index.ts b/tests/e2e/support/api/graph/index.ts index 29b59e70779..ff852a3c558 100644 --- a/tests/e2e/support/api/graph/index.ts +++ b/tests/e2e/support/api/graph/index.ts @@ -13,5 +13,6 @@ export { createSpace, getSpaceIdBySpaceName, disableSpace, - deleteSpace + deleteSpace, + addTagsToTheResource } from './spaces' diff --git a/tests/e2e/support/api/graph/spaces.ts b/tests/e2e/support/api/graph/spaces.ts index 288bbeb31ed..28d31416f18 100644 --- a/tests/e2e/support/api/graph/spaces.ts +++ b/tests/e2e/support/api/graph/spaces.ts @@ -149,3 +149,31 @@ export const deleteSpace = ({ user, space }: { user: User; space: Space }): Prom header: { Purge: 'T' } }) } + +export const addTagsToTheResource = async ({ + user, + resourceName, + tag +}: { + user: User + resourceName: string + tag: string +}): Promise => { + const resourceId = await getIdOfFileInsideSpace({ + user: user, + pathToFileName: resourceName, + spaceName: user.displayName, + spaceType: 'personal' + }) + const body = JSON.stringify({ + resourceId: resourceId, + tags: [tag] + }) + + return request({ + method: 'PUT', + path: join('graph', 'v1.0', 'extensions', 'org.libregraph', 'tags'), + body: body, + user: user + }) +} diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 4c1e221addb..78b56880f9d 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -1010,10 +1010,11 @@ export const getDisplayedResourcesFromFilesList = async (page): Promise