testing-library / cypress-testing-library

🐅 Simple and complete custom Cypress commands and utilities that encourage good testing practices.
http://npm.im/@testing-library/cypress
MIT License
1.8k stars 152 forks source link

Cannot set property message of [object DOMException] which has only a getter #206

Open vaclavGabriel opened 2 years ago

vaclavGabriel commented 2 years ago

Versions:

What you did: I tried to get an element using the cy.findByRole command

What happened: TypeError: Cannot set property message of [object DOMException] which has only a getter

TypeError: Cannot set property message of [object DOMException] which has only a getter
    at modifyErrMsg (http://localhost:3002/__cypress/runner/cypress_runner.js:172545:15)
    at $Cy.retry (http://localhost:3002/__cypress/runner/cypress_runner.js:164808:33)
    at onFailFn (http://localhost:3002/__cypress/runner/cypress_runner.js:148305:21)
From previous event:
    at $Cy.verifyUpcomingAssertions (http://localhost:3002/__cypress/runner/cypress_runner.js:148312:105)
From previous event:
    at tryFn (http://localhost:3002/__cypress/runner/cypress_runner.js:165332:61)
    at whenStable (http://localhost:3002/__cypress/runner/cypress_runner.js:165371:14)
    at http://localhost:3002/__cypress/runner/cypress_runner.js:164858:18

image

Problem description: I am getting the error above when using findByRole from Cypress Testing Library

Suggested solution: Rollback to the version 7.0.7 helps

MAfzalKhan1997 commented 2 years ago

any update on above issue ?

MathiasCarranza04 commented 2 years ago

I'm having the same issue

nilesh-powar-InfoTrack commented 2 years ago

same here 😢

1986stas commented 2 years ago

any solutions?

schester44 commented 2 years ago

seeing this as well when using react-app-rewired and craco with a create react app application. very strange.

RuudMeeuwsen commented 1 year ago

I had the same issue. I rolled back to v7.0.7, which indeed solves it, but of course I'd rather use the latest version. It doesn't look like there's much developer activity here, though :(

oussbenma commented 1 year ago

Same issue discovered with this Cypress version:

Cypress package version: 12.2.0 Cypress binary version: 12.2.0 Electron version: 21.0.0 Bundled Node version: 16.16.0

darrylsepeda commented 1 year ago

Cypress 12.14.0 Node 16.20.1

Still encounter this issue today. so I removed all the test and found:

  1. describe('Description', () => {}) => this works fine
  2. describe('Description', () => { it('should works fine', () => {}) }) => this is failed with the above error

Still not sure what is blocking this test

setage commented 11 months ago

Having this issue in Firefox, but in Electron it works fine:

Cypress 12.17.4 Firefox 117.0.1 Electron 106

JakubAdapt commented 6 months ago

Same issue when upgrading from @testing-library/react: 14.1.2 to higher.

Node 20.11 Cypress: 13.6.6 Typescript 5.2