spaceagetv / electron-playwright-example

Example of multi-window Playwright testing with Electron
MIT License
79 stars 8 forks source link

doesn't work on windows systems? #7

Closed gootaoo closed 1 year ago

2BC-Wasabi commented 2 years ago

can you provide more details for me it worked.

MS-Manikandan commented 2 years ago

Hi , I couldn't able to import electron from playwright, I am currently using version 1.25.2, I tried to run a basic test to launch teams desktop app on windows 10 machine, since the import wasn't successful, could able to run it . could you let us know how did you able to import electron from playwright and lauch electron app locally ?

2BC-Wasabi commented 2 years ago

here is how you might run the exe

let electronApp: ElectronApplication;
electronApp = await electron.launch({
      executablePath: 'C:\\path\\to\\exe',
    });
electronApp.on('window', async (page) => {
      //this is called within electron 
});

await electronApp.evaluate(
    async ({ BrowserWindow }) => {
     // this is also from electron
});
MS-Manikandan commented 2 years ago

Hi @2BC-Wasabi, thanks for reaching out , since I didn't install the playwright-core package I couldn't able to access the underlying _electron from it, thanks for sharing the above snippet.

jjeff commented 1 year ago

Sounds like this is resolved. I'm going to close the issue. Feel free to reopen if I'm incorrect.