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

When using the Firefox and Chrome extensions in Cypress, an 'Uncaught TypeError: e.matches is not a function' is thrown #335

Open
DaniBedz opened this issue Jun 25, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@DaniBedz
Copy link

Bug Report 🐛

If using either the Firefox or Chrome extensions in Cypress test runner, when moving the mouse to pick elements, the following error message is thrown:

contentScript.js:1 Uncaught TypeError: e.matches is not a function at Y (contentScript.js:1) at PP (contentScript.js:1) at Ai (contentScript.js:1) at t (contentScript.js:1) at contentScript.js:1 at f (contentScript.js:1) at b (contentScript.js:1) at m (contentScript.js:1) Y @ contentScript.js:1 PP @ contentScript.js:1 Ai @ contentScript.js:1 t @ contentScript.js:1 (anonymous) @ contentScript.js:1 f @ contentScript.js:1 b @ contentScript.js:1 m @ contentScript.js:1 setTimeout (async) h @ contentScript.js:1 v @ contentScript.js:1 g @ contentScript.js:1

This issue can only be reproduced in the test runner window. If a new tab is opened, the element picker works as expected as detailed below:

2021-06-25 203809

To Reproduce ✔️

  1. Open the Cypress test runner
  2. Run a test in either Chrome or Firefox
  3. Open the Dev tools at the Testing Playground tab
  4. Click the 'Pick element' icon
  5. Move the mouse over the page to preview different elements

Expected behavior 🤔

The element picker should preview queries with no errors, and the best query should be displayed, e.g:

screen.getByRole('button', { name: /google search/i })

Instead, multiple Uncaught TypeError: e.matches is not a function errors are displayed in the console, and only container.querySelector suggestions are displayed.

Suggested solution 🔦

The expected behavior is present if a new tab is opened in the test runner, but I am unsure about the difference between this tab and test runner tab.

Your Environment 💻

  • browser: Chrome & Firefox
  • os: Mac
  • Cypress: v. 7.5.0
  • Extensions: Offical releases in webstores, as well as builds from the latest develop branch

Thanks so much for your hard work on this amazing tool, I hope you're able to iron out this issue!

@DaniBedz DaniBedz added the bug Something isn't working label Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant