Comments (8)
Similar here. We use cypress 12.5.1
and @testing-library/cypress 9.0.0
. Everything worked fine until yesterday when the test hung on cy.findAllByTestId
and failed after the timeout. The issue happened only CI
. Overwriting the element error message, as @jessezhang91 suggested, seems to fix it. We added that as a global cypress configuration to cypress/support/e2e.ts
:
import { configure } from '@testing-library/cypress';
configure({
getElementError(message, container) {
const error = new Error(
[message, container.tagName].filter(Boolean).join('\n\n'),
);
error.name = 'TestingLibraryElementError';
return error;
},
});
It looks like when the testing library error occurs, it breaks the retry-ability of the cypress and fails after the timeout. I wonder why it was working before and suddenly stopped working without any lib updates 🤔
from cypress-testing-library.
i added this:
before(() => {
cy.configureCypressTestingLibrary({
getElementError(message, container) {
const error = new Error(
[message, container.tagName].filter(Boolean).join('\n\n'),
);
error.name = 'TestingLibraryElementError';
return error;
},
});
});
to prevent prettyDOM from being called and this seems to be working now with the newer versions of testing-library/cypress
from cypress-testing-library.
we just ran into the same issue using cypress 11.2.0 and testing-library/cypress 8.0.7. reverting it back to 7.0.7 per above suggestions seems to have worked as well. the cy.findByRole
and cy.findAllByText
commands were both hanging up the browser
strangely we've been on 8.0.7 since november and we only just started seeing this issue a day ago with no other changes that we can find.
from cypress-testing-library.
Same problem, same fix, also suddenly started for us on 27/28 April. One thing I noticed is it seemed to freeze up whenever performing XHR requests.
We also hadn't upgraded any packages in our bundle, other than loading the latest Google Maps API dynamically via a script tag. Pinning the version to a couple releases ago fixed the error for a few tests involving maps requests.
from cypress-testing-library.
Same thing here ("@testing-library/cypress": "^9.0.0", cypress: 12.5.0) but only triggers in the CI, probably because the CI is quicker and the command runs while the elements are not loaded yet.
Similar here. We use
cypress 12.5.1
and@testing-library/cypress 9.0.0
. Everything worked fine until yesterday when the test hung oncy.findAllByTestId
and failed after the timeout. The issue happened onlyCI
. Overwriting the element error message, as @jessezhang91 suggested, seems to fix it. We added that as a global cypress configuration tocypress/support/e2e.ts
:import { configure } from '@testing-library/cypress'; configure({ getElementError(message, container) { const error = new Error( [message, container.tagName].filter(Boolean).join('\n\n'), ); error.name = 'TestingLibraryElementError'; return error; }, });It looks like when the testing library error occurs, it breaks the retry-ability of the cypress and fails after the timeout. I wonder why it was working before and suddenly stopped working without any lib updates 🤔
i added this:
before(() => { cy.configureCypressTestingLibrary({ getElementError(message, container) { const error = new Error( [message, container.tagName].filter(Boolean).join('\n\n'), ); error.name = 'TestingLibraryElementError'; return error; }, }); });to prevent prettyDOM from being called and this seems to be working now with the newer versions of testing-library/cypress
Thanks a lot for the workaround!! @jessezhang91
from cypress-testing-library.
Had the same problem. It suddenly appeared yesterday. We use Cypress 9.7.0
, @testing-library/cypress 7.0.6
and @testing-library/dom 8.19.0
.
Your solution @patrykkarny fixed it (as well as @jessezhang91 solution).
from cypress-testing-library.
Hello.
We experienced the same problem upgrading to cypress v10+ and updating every dependencies.
Downgrading to CTL 7.0.7 solved it.
It looks like the regression was introduced in v8.0.0
@testing-library/dom has been upgraded to v8 -> might be ?
from cypress-testing-library.
Hi, we also experienced this issue (it actually caused the tests to hang badly in our CI pipeline). The issue repro'd with versions v8.0.7 and v9 of testing-library/cypress (with Cypress 12.3.0 and 12.6.0)
Reverting to v7.0.7, as Fanch~ suggested above, resolved the issue, so it does look like it might be a bug introduced in v8.0.0
from cypress-testing-library.
Related Issues (20)
- Enable to click to input number -webkit-inner-spin-button HOT 1
- Cypress test errors after upgraing to 9.0.0 and using testIsolation: false HOT 10
- findAllByRole and findByRole don't chain correctly HOT 2
- get/query variants don't exist HOT 3
- Testing library throws uncaught error HOT 24
- @testing-library/cypress causes non-cypress tests to fail HOT 1
- any `find*` command fails when is first to run in a test context HOT 6
- Dependency problem on @testing-library/dom between @testing-library/react and cypress-testing-library HOT 1
- Update @testing-library/dom HOT 1
- Conflicting peer dependency with new Cypress release 13.0.0 HOT 2
- should not exist does not work with findByRole
- Configuring testIdAttribute does not work HOT 1
- Doesn't work with Cypress 13.4.0 due to `addQuery` usage HOT 3
- npx cypress open fails on ubuntu 20.03 for missing GLIBCXX_3.4.29 HOT 1
- Unable to install Cypress version 13
- Property 'findByTestId' does not exist on type 'cy & CyEventEmitter' - only in .cy.tsx (component testing) files HOT 1
- Can't resolve 'process/browser.js'
- cy.findByText doesn't work on Cypress 13.6.4 in some situations HOT 2
- `findByRole` with `name` option does not consider element title when element contains text.
- Update @testing-library/dom to v10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-testing-library.