mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
14 lines
404 B
TypeScript
14 lines
404 B
TypeScript
import { ElectronApplication } from '@playwright/test';
|
|
|
|
const setFilePickerResponse = (electronApp: ElectronApplication, response: string[]) => {
|
|
return electronApp.evaluate(async ({ dialog }, response) => {
|
|
dialog.showOpenDialog = async () => ({
|
|
canceled: false,
|
|
filePaths: response,
|
|
});
|
|
dialog.showOpenDialogSync = () => response;
|
|
}, response);
|
|
};
|
|
|
|
export default setFilePickerResponse;
|