mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +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;
|