Попробуйте следующее
async function verifyFileInDownloadsFolder(fileName: string) {
const filePath = ('./e2e/app/tmp_downloads/' + fileName);
await console.log('Getting the path ' + filePath);
await browser.wait(async () => fs.existsSync(filePath), 10 * 10000, 'File never appeared!');
await expect(fs.existsSync(filePath)).toBe(true,
'Failed to download file: ' + fileName + ' in user directory' + filePath);
await console.log('File download was successful');
}
Надеюсь, это поможет вам