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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

toSelect fails when using custom Page instance #272

Closed
Swatinem opened this issue Jul 29, 2019 · 1 comment
Closed

toSelect fails when using custom Page instance #272

Swatinem opened this issue Jul 29, 2019 · 1 comment

Comments

@Swatinem
Copy link

馃悰 Bug Report

When using a custom Page instance, for example using browser.newPage(), the toSelect matcher fails with the following Error:
JSHandles can be evaluated only in the context they were created!

To Reproduce

NOTE: I haven鈥檛 run this inside a reduced testcase, but my testsuite runs correctly when not using browser.newPage().

// fails:
const p = await browser.newPage()
// works:
// const p = page
await expect(p).toSelect('select[name="fontFamily"]', font)

Expected behavior

This should work no matter which page instance it is run on.

Link to repl or repo (highly encouraged)

Please provide a minimal repository on GitHub.

Issues without a reproduction link are likely to stall.

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

Paste the results here:

  • node@10.15.3
  • jest-puppeteer@4.3.0
  • expect-puppeteer@4.3.0
@Mavrin
Copy link
Contributor

Mavrin commented Aug 19, 2019

Look like I fix it #275

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

No branches or pull requests

3 participants