mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-08-01 17:09:26 -04:00
Fix file input in tests
This commit is contained in:
parent
fdd02a6bd6
commit
34072d2f53
5 changed files with 79 additions and 65 deletions
test/integration
|
@ -13,9 +13,12 @@ const runFile = async (file, action, page, script) => {
|
|||
await page.goto(`file://${indexHTML}`);
|
||||
const fileInput = await page.$('#file');
|
||||
await fileInput.uploadFile(testDir(file));
|
||||
// the index.html handler for file input will add a #loaded element when it
|
||||
// finishes.
|
||||
await page.waitForSelector('#loaded');
|
||||
|
||||
await page.evaluate(() =>
|
||||
// `loadFile` is defined on the page itself.
|
||||
// eslint-disable-next-line no-undef
|
||||
loadFile()
|
||||
);
|
||||
return page.evaluate(`(function () {return (${script})(${action});})()`);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue