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

Puppeteer 21 regression: [object Object] is not supported #565

Closed
fregante opened this issue Sep 14, 2023 · 4 comments · Fixed by #566
Closed

Puppeteer 21 regression: [object Object] is not supported #565

fregante opened this issue Sep 14, 2023 · 4 comments · Fixed by #566

Comments

@fregante
Copy link

🐛 Bug Report

This works in Puppeteer 20, but not 21. The error appears with toMatchElement and toMatchTextContent


  ● static: iframe › should load iframe page

    [object Object] is not supported

      59 | 	});
      60 | 	it('should load iframe page', async () => {
    > 61 | 		await expect(iframe).toMatchTextContent('Framed page');
         | 		      ^
      62 | 	});
      63 |
      64 | 	it('should load the content script, once', async () => {

      at expectPuppeteerInstance (node_modules/expect-puppeteer/dist/index.js:488:11)
      at expectPuppeteer (node_modules/expect-puppeteer/dist/index.js:492:26)
      at Object.expect (test/browser.js:61:9)

To Reproduce

I think:

await page.goto('https://static-ephiframe.vercel.app/Parent-page?iframe=./Framed-page');
const elementHandle = await page.waitForSelector('iframe');
const iframe = await elementHandle.contentFrame();
await expect(iframe).toMatchTextContent('Framed page');

Expected behavior

The test should pass

Run npx envinfo --system --binaries --npmPackages expect-puppeteer,jest-dev-server,jest-environment-puppeteer,jest-puppeteer,spawnd --markdown --clipboard

Paste the results here:

## System:
 - OS: macOS 13.4.1
 - CPU: (16) x64 Intel(R) Core(TM) i9
 - Memory: 100.70 MB / 16.00 GB
 - Shell: 3.6.1 - /usr/local/bin/fish
## Binaries:
 - Node: 20.6.1 - /usr/local/bin/node
 - Yarn: 1.22.11 - /usr/local/bin/yarn
 - npm: 10.1.0 - /usr/local/bin/npm
## npmPackages:
 - expect-puppeteer: ^8.0.3 => 9.0.0 
 - jest-puppeteer: ^8.0.4 => 9.0.0 

Slightly more information can be found at:

@fregante
Copy link
Author

fregante commented Sep 14, 2023

Since v21 has been released after the last jest-puppeteer release, I assume this version hasn't been tested here.

@jamesgpearce
Copy link

This started happening again with puppeteer 21.2.1.

(It looks like 21.1.1 is OK, so should be easier to downgrade and bisect.)

@gregberge
Copy link
Member

Hi, if we can do something in this repository to fix it, feel free to submit a PR.

@swissspidy
Copy link
Contributor

#566 should fix this

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

Successfully merging a pull request may close this issue.

4 participants