Open vania-pooh opened 7 months ago
This is critical for us too, since we are moving to playwright from Selenium C# and we don't have a way to recover the files from the pod.
we need it as well, much needed to download files on playwright running on moon. download to f.e. /home/user/Downloads doesnt work (using robot framework with browser library (playwright)
const { chromium } = require('playwright');
(async () => {
var browser = await chromium.connect({ timeout: 0, wsEndpoint: 'ws://moon.aerokube.local/playwright/chrome/playwright-1.46.1?headless=false' });
const page = await browser.newPage();
await page.goto('https://kernel.org/');
const downloadPromise = page.waitForEvent('download');
await page.getByRole('link', { name: '6.10.8' }).click();
const download = await downloadPromise;
await download.saveAs(download.suggestedFilename());
await browser.close();
})();
I am not sure I understand the comment, basically our issue is not with the download it self - file is downloaded - but it cannot be recovered from the "save as" lcoation - the lcoation is not available to the current running browser session - so in the case for example you download the PDF file as per documentation to "/home/user/Downloads/some.pdf" - https://aerokube.com/moon/latest/#accessing-downloaded-files , the session started by playwright cannot reach this destination. I have verified the access rights are ok..
but when we try to serve the files in advance to the browser session https://aerokube.com/moon/latest/#selenium-context - so during the start of the session browser is informed where are some file fot the test usage, like in /home/user/some.pdf , the browser session in playwright on Moon can open this file ..
Need something similar to
/download
API in Selenium.