Nice video! Thank you for the clear explanation on how to use fixtures. The "quick and dirty" way worked, however the cypress documentation recommended way did not. I still get the "Cannot read properties of undefined (reading 'data')". I had the beforeEach() function originally in my e2e.js file which I thought was the issue. When I moved to within my test file, I still received the error. Any suggestion?
I understand you point and in general I do follow the docs. I had issues in the past when doing it like in the docs. That is why I tried to find a way to MAKE IT WORK :D
why the fixture don't work if you replace the "function()" for the "=>"?
Thanks a lot!
Welcome!
Nice video! Thank you for the clear explanation on how to use fixtures. The "quick and dirty" way worked, however the cypress documentation recommended way did not. I still get the "Cannot read properties of undefined (reading 'data')". I had the beforeEach() function originally in my e2e.js file which I thought was the issue. When I moved to within my test file, I still received the error. Any suggestion?
Nevermind, I was missing the "function ()" in my it() test. Thanks!!!
Glad it helped!
Doesnt it defeats the way cypress recommend to use fixtures?
let examplejson;
before( () => {
cy.fixture('example').then((data) => {
examplejson = data;
})
})
@@rajann44 - I do not understand the question
@@ResterTest I mean cypress dont recommend to use fixtures via imports
I understand you point and in general I do follow the docs. I had issues in the past when doing it like in the docs. That is why I tried to find a way to MAKE IT WORK :D