Skip to content

Commit

Permalink
wait for selector while public upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SwikritiT committed Apr 5, 2022
1 parent 5f184b8 commit 98e5ffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion tests/e2e/cucumber/features/integrations/link.ocis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Feature: link
#When the public reloads the public link pages
#Then the public should not see the following files on the files-drop page
# | textfile.txt |
And "Anonymous" logs out
When "Alice" downloads the following files using the batch action
| resource | from |
| lorem.txt | folderPublic |
Expand Down
12 changes: 4 additions & 8 deletions tests/e2e/support/objects/app-files/page/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@ export class Public {
}

async upload({ resources }: { resources: File[] }): Promise<void> {
const startUrl = this.#page.url()
const resourceSelector = `//tbody/tr/td[contains(@class, "oc-pl-rm") and contains(text(), "%s")]`
await this.#page
.locator('//input[@id="file_upload_start" or @class="dz-hidden-input"]')
.setInputFiles(resources.map((file) => file.path))
const names = resources.map((file) => path.basename(file.name))
await Promise.all(
names.map((name) =>
this.#page.waitForSelector(
util.format(
`//tbody/tr/td[contains(@class, "oc-pl-rm") and contains(text(), "%s")]`,
name
)
)
)
names.map((name) => this.#page.waitForSelector(util.format(resourceSelector, name)))
)
await this.#page.goto(startUrl)
}
}

0 comments on commit 98e5ffc

Please sign in to comment.