mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
17 lines
439 B
TypeScript
17 lines
439 B
TypeScript
|
import { ElectronApplication } from '@playwright/test';
|
||
|
|
||
|
const waitForNextOpenPath = (electronApp: ElectronApplication) => {
|
||
|
return electronApp.evaluate(async ({ shell }) => {
|
||
|
return new Promise<string>(resolve => {
|
||
|
const originalOpenPath = shell.openPath;
|
||
|
shell.openPath = async (path: string) => {
|
||
|
shell.openPath = originalOpenPath;
|
||
|
resolve(path);
|
||
|
return '';
|
||
|
};
|
||
|
});
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export default waitForNextOpenPath;
|