diff --git a/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature b/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature index 4fe45a05e8f..986b78b0a5d 100644 --- a/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature @@ -82,6 +82,18 @@ Feature: Search When "Brian" enables the option to search in file content And "Brian" searches "Cheers" using the global search bar + Then following resources should be displayed in the files list for user "Brian" + | resource | + | textfile.txt | + | testFolder/innerTextfile.txt | + | fileToShare.txt | + | fileWithTag.txt | + | withTag.txt | + | spaceFolder/spaceTextfile.txt | + When "Brian" opens the following file in texteditor + | resource | + | textfile.txt | + And "Brian" closes the file Then following resources should be displayed in the files list for user "Brian" | resource | | textfile.txt | diff --git a/tests/e2e/cucumber/features/smoke/share.ocis.feature b/tests/e2e/cucumber/features/smoke/share.ocis.feature index 06fc5632b93..aed49c6bf4a 100644 --- a/tests/e2e/cucumber/features/smoke/share.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/share.ocis.feature @@ -121,9 +121,11 @@ Feature: share And "Brian" opens the following file in mediaviewer | resource | | testavatar.jpeg | + And "Brian" closes the file And "Brian" opens the following file in pdfviewer | resource | | simple.pdf | + And "Brian" closes the file And "Alice" removes following sharee | resource | recipient | | shareToBrian.txt | Brian | diff --git a/tests/e2e/cucumber/steps/ui/resources.ts b/tests/e2e/cucumber/steps/ui/resources.ts index 4de7deb015f..f36001f2057 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)$/, + /^"([^"].*)" opens the following file(?:s)? in (mediaviewer|pdfviewer|texteditor)$/, 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.openFileInViewer({ + await resourceObject.openFile({ name: info.resource, - actionType: actionType as 'mediaviewer' | 'pdfviewer' + actionType: actionType as 'mediaviewer' | 'pdfviewer' | 'texteditor' }) } } @@ -638,3 +638,10 @@ When( await resourceObject.uploadLargeNumberOfResources({ resources: files }) } ) + +When('{string} closes the file', async function (this: World, stepUser: string): Promise { + const { page } = this.actorsEnvironment.getActor({ key: stepUser }) + const resourceObject = new objects.applicationFiles.Resource({ page }) + + await resourceObject.closeFile() +}) diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 243c75998de..b224becea63 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) [data-test-resource-name="%s"]' + ':is(#files-space-table, .oc-tiles-item, #files-shared-with-me-accepted-section, .files-table) [data-test-resource-name="%s"]' const breadcrumbResourceNameSelector = '//span[contains(@class, "oc-breadcrumb-item-text") and text()="%s"]' const addNewResourceButton = `#new-file-menu-btn` @@ -1110,13 +1110,13 @@ export const removeTagsFromResource = async (args: resourceTagsArgs): Promise => { +export const openFile = async (args: openFileArgs): Promise => { const { page, name, actionType } = args if (actionType === 'mediaviewer') { @@ -1140,8 +1140,6 @@ export const openFileInViewer = async (args: openFileInViewerArgs): Promise => { export const expectPageNumberNotToBeVisible = async ({ page }): Promise => { await expect(page.locator(filesPaginationNavSelector)).not.toBeVisible() } + +export const closeFile = async ({ page }): Promise => { + await editor.close(page) +} diff --git a/tests/e2e/support/objects/app-files/resource/index.ts b/tests/e2e/support/objects/app-files/resource/index.ts index bed1cf5ce98..07ebbec5cdd 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 openFileInViewer(args: Omit): Promise { - await po.openFileInViewer({ ...args, page: this.#page }) + async openFile(args: Omit): Promise { + await po.openFile({ ...args, page: this.#page }) } async addTags(args: Omit): Promise { @@ -256,4 +256,8 @@ export class Resource { async expectPageNumberNotToBeVisible(): Promise { await po.expectPageNumberNotToBeVisible({ page: this.#page }) } + + async closeFile(): Promise { + await po.closeFile({ page: this.#page }) + } }