Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] [full-ci] file viewer editor close step addition #9365

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/e2e/cucumber/features/smoke/fullTextSearch.ocis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
S-Panta marked this conversation as resolved.
Show resolved Hide resolved
When "Brian" opens the following file in texteditor
| resource |
| textfile.txt |
And "Brian" closes the file viewer
Then following resources should be displayed in the files list for user "Brian"
| resource |
| textfile.txt |
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/cucumber/features/smoke/share.ocis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ Feature: share
And "Brian" opens the following file in mediaviewer
| resource |
| testavatar.jpeg |
And "Brian" closes the file viewer
And "Brian" opens the following file in pdfviewer
| resource |
| simple.pdf |
And "Brian" closes the file viewer
And "Alice" removes following sharee
| resource | recipient |
| shareToBrian.txt | Brian |
Expand Down
11 changes: 7 additions & 4 deletions tests/e2e/cucumber/steps/ui/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ When(
}
)

When('{string} closes the editor', async function (this: World, stepUser: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
await editor.close(page)
})
When(
'{string} closes the file viewer',
async function (this: World, stepUser: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
await editor.close(page)
}
)

When(
'{string} drop uploads following resources',
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/steps/ui/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
name: info.resource,
actionType: actionType as 'mediaviewer' | 'pdfviewer'
actionType: actionType as 'mediaviewer' | 'pdfviewer' | 'texteditor'
})
}
}
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/support/objects/app-files/resource/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
S-Panta marked this conversation as resolved.
Show resolved Hide resolved
S-Panta marked this conversation as resolved.
Show resolved Hide resolved
const breadcrumbResourceNameSelector =
'//span[contains(@class, "oc-breadcrumb-item-text") and text()="%s"]'
const addNewResourceButton = `#new-file-menu-btn`
Expand Down Expand Up @@ -1114,7 +1114,7 @@ export const removeTagsFromResource = async (args: resourceTagsArgs): Promise<vo
export interface openFileInViewerArgs {
page: Page
name: string
actionType: 'mediaviewer' | 'pdfviewer'
actionType: 'mediaviewer' | 'pdfviewer' | 'texteditor'
}

export const openFileInViewer = async (args: openFileInViewerArgs): Promise<void> => {
Expand All @@ -1141,8 +1141,6 @@ export const openFileInViewer = async (args: openFileInViewerArgs): Promise<void
page.locator(util.format(resourceNameSelector, name)).click()
])
}

await editor.close(page)
}

export const checkThatFileVersionIsNotAvailable = async (
Expand Down