cypress-testing-library: TypeError: container.querySelectorAll is not a function
cypress-testing-libraryversion: 5.1.1nodeversion: 12.4.0npm(oryarn) version: 1.21.1 (yarn)
Relevant code or config
describe('anonymous calculator', () => {
it('can make calculations', () => {
cy.visit('/')
.findByText(/^1$/)
.click()
.findByText(/^\+$/)
.click()
.findByText(/^2$/)
.click()
.findByText(/^=$/)
.click()
.findByTestId('total')
.should('have.text', '3')
})
})
What you did: Attempted to run tjs/cypress-04 branch of https://github.com/kentcdodds/jest-cypress-react-babel-webpack/tree/tjs/cypress-04
What happened:
Reproduction repository: https://github.com/kentcdodds/jest-cypress-react-babel-webpack/tree/tjs/cypress-04
Problem description:
TypeError: container.querySelectorAll is not a function
Suggested solution:
–
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (12 by maintainers)
Commits related to this issue
- revert: feat: support running commands against the previous subject. (#100) This reverts commit e32c8e4d95dc7da88341b2886d4c9dc0bcea645e. Reference: https://github.com/testing-library/cypress-testin... — committed to testing-library/cypress-testing-library by kentcdodds 4 years ago
- feat: add ability for queries to inherit previous subject * Fixes #109 without breaking change caused by #100 — committed to NicholasBoll/cypress-testing-library by NicholasBoll 4 years ago
- feat: add more helpful debugging information to queries (#108) * feat: add more helpful debugging information to queries * Add element selector information for debugging (outlines element when you c... — committed to testing-library/cypress-testing-library by NicholasBoll 4 years ago
For people who came across this issue, from what I understand, starting from
@testing-library/cypress@6.0.0, they are no longer supporting chaining of multiplefind*commands. So, you’ll have to write it asMore discussion about this decision on: https://github.com/testing-library/cypress-testing-library/issues/110
@kentcdodds @tlrobinson please correct me if I’m wrong. Also, it would be helpful to add this change to release changelog: https://github.com/testing-library/cypress-testing-library/releases.
🎉 This issue has been resolved in version 5.2.0 🎉
The release is available on:
npm package (@latest dist-tag)Your semantic-release bot 📦🚀
5.1.2 has been published to revert that change. I apologize for not recognizing the implications of the change in the first place. Sorry for the bump.
Ok, I think that in order to address the breaking change I’m going to revert #100 right now, and then we can talk about the merits of making a breaking change to support it in a new major version bump.
I agree that would be better for the course. Will probably do something like that in the next update 👍 thanks!
I’ll look up this issue and see if it is related to #100 and if there is any way to introduce #100 as a non-breaking change
Oh, Crumbs. No, I was on 5.1.1, I’m sorry @kentcdodds @twgraham!