function downloadFile(page, strategy): Promise<Download>
Downloads a file using the specified strategy.

Examples

import { downloadFile } from "@intuned/sdk/files";

// use DirectLink strategy when you have the url of the pdf.
const download = await downloadFile(page, { type:"DirectLink", link:"https://www.gemini.com/documents/credit/Test_PDF.pdf" });
console.log(await download.path()); // Outputs the file path

Parameters

page: Page The Playwright Page object. strategy: PersistFileStrategy The strategy to use for downloading the file.

Returns

Promise<Download> A promise that resolves to a Download object.