Skip to content

Commit

Permalink
update(test): handle file uploads with promise instead of input eleme…
Browse files Browse the repository at this point in the history
…nt (#200)
  • Loading branch information
luisecm authored Nov 29, 2024
1 parent 96e56b7 commit f7c6c1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion playwright/PageObjects/FilesScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,11 @@ export class FilesPage extends MainPage {
}

async uploadFile(filePath: string) {
const fileChooserPromise = this.page.waitForEvent("filechooser");
await this.clickOnUploadFileButton();
await this.uploadFileInput.setInputFiles(filePath);
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(filePath);

if (this.viewport === "mobile-chrome") {
await this.uploadFileButton.click();
}
Expand Down

0 comments on commit f7c6c1a

Please sign in to comment.