Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] playwright-electron types might be missing from the release or is there any guide on how to get it to work? #4256

Closed
kevinlinv opened this issue Oct 27, 2020 · 4 comments
Assignees

Comments

@kevinlinv
Copy link

kevinlinv commented Oct 27, 2020

Background

Hi, I am playing around with playwright at the moment. First impressions is great, I am able to install and run the minimal test on my existing project. I followed the guide in the short readme available here 👉 https://www.npmjs.com/package/playwright-electron

Problem

I am struggling with the typing though, can't seem to get it to work. electron related typing is not available.
It is kinda a deal breaker on my project without the typing so I am really keen to get this to work 😭

Some troubleshooting I did

I was looking at node_modules/playwright-electron/index.d.ts, it looks like it imports the type from playwright-core, however, playwright-core is not in the package.json of playwright-electron

import { ElectronLauncher } from 'playwright-core/electron-types';
export * from 'playwright-core/types/types';
export * from 'playwright-core/electron-types';
export const electron: ElectronLauncher;

I tried to install playwright-core to get around that, however, I noticed that there is no playwright-core/electron-types available in node_modules/playwright-core/electron-types to be imported from.

Screen Shot 2020-10-27 at 10 32 18 pm

Question

  • Is my above observation correct? in that the typing for electron is indeed missing from the release of playwright-core and therefore can't be found?
  • Would I be able to get some advice on how to get it to work?

Thanks in advance 🙌

@arjunattam
Copy link
Contributor

Thanks for the report, @kevinlinv! I can repro this issue with the latest from npm. Running node packages/build_package.js playwright-electron on tip-of-tree is working correctly, and my guess is that the npm version is slightly outdated. Tagging @pavelfeldman.

As you can probably tell, Playwright support for Electron is new, and we would love to learn more about how it's working for you. Feel free to ping me on Slack/email.

@kevinlinv
Copy link
Author

O, good to know it wasn't something I did wrong. Thanks for the help.

As you can probably tell, Playwright support for Electron is new, and we would love to learn more about how it's working for you. Feel free to ping me on Slack/email.

Yep, sounds good, will get in touch with any feedback in the future once I have played with it a little bit more.

@pavelfeldman
Copy link
Member

I just published playwright-electron@0.5.0, it should make things work for you, please let us know if it does or it does not.

@kevinlinv
Copy link
Author

kevinlinv commented Oct 29, 2020

It works as expected with playwright-electron@0.5.0! Thanks!
Shall close this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants