Uncaught Type Error when running a test with Cypress

Hi,

I’m using Cypress for testing, and am getting the following error for one of my tests:

VM218 elm.min.js:7051 Uncaught TypeError: Cannot read properties of undefined (reading 'childNodes')

Here’s the stack trace (the lines between requestAnimationFrame just repeat identically):

The process the test is testing runs fine manually in the browser, and all my other tests run fine.

Does anyone have any ideas about this, or can point in a direction to resolve?

Will provide any additional info that is requested.

Thanks.

2 Likes

OK, I’ve got page transitions/animations going on, and when I take out the transition, the test passes. Strange though, because all my other tests involve page transitions, and work fine because Cypress waits for Dom elements to come into view.

Whats strange with this particular one, is that the animation from one page to the next doesn’t run during the test, while all others do.

Guess I need to look at how I’m running the test :person_shrugging:

So this has sent me in the direction of adding a new user feature…

Each change from one page to another involves a page transition, which I like, but might not be everyone’s cup of tea. So I’m going to add the option of turning transitions off and store the selection in local storage, which I can set in a before hook in my cypress tests so that they run without the transitions.

It is strange though, because the test should run fine with the transitions running…

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.