I cant seem to figure out why the file Im trying to use as an upload wont work, I've created this upload function
async uploadFile(file: string) {
await this.fileUploadIcon.click();
expect(this.page.locator('.file-upload-input')).toBeVisible();
await this.page.setInputFiles('.file-upload-input', file);
}
which is being used in the test:
test.only('Upload a document', async () => {
await uploadActions.uploadFile(firstDoc);
});
the first doc is being initialized with this path:
const firstDoc = '../Assets/Automated_Doc_2.pdf';
but the test fails and the path besides the ENOENT: no such file or directory error looks correct.
What am I doing wrong?