testing-library / pptr-testing-library

puppeteer + dom-testing-library = 💖
MIT License
287 stars 29 forks source link

Puppeteer v17 compatibility #77

Closed swissspidy closed 8 months ago

swissspidy commented 2 years ago

In https://github.com/puppeteer/puppeteer/pull/8844, which was released as part of Puppeteer v17, the execution context has been marked internal, so this access is no longer possible.

I see it's being used twice here:

https://github.com/testing-library/pptr-testing-library/blob/860106be873fa6830c49e529ec1a0b2a65f9bbbd/lib/index.ts#L92

https://github.com/testing-library/pptr-testing-library/blob/860106be873fa6830c49e529ec1a0b2a65f9bbbd/lib/index.ts#L101

swissspidy commented 2 years ago

The new recommended approach in v17.1.0 is to use ElementHandle.frame() directly, see https://github.com/puppeteer/puppeteer/pull/8875. It should be released soon.

patrickhulce commented 2 years ago

Thanks for the note @swissspidy! We'll fix it 👍

patrickhulce commented 2 years ago

fix is up at https://github.com/testing-library/pptr-testing-library/pull/78 but getting this to work in a non-breaking way with typescript is...tricky :)

help with tests is welcome

georgehb commented 1 year ago

Is there any update on this?

If getting the types to work on both new and old versions of puppeteer is too much hassle, could the solution not be to drop support for old versions of puppeteer and release the changes as a major version bump?

patrickhulce commented 8 months ago

fixed by https://github.com/testing-library/pptr-testing-library/pull/78