late-greece-72449
05/10/2023, 9:23 PMdata
object defined initially is taken and thus the element el
takes the value from that. However if you cy.log(data);
in your first it() you will see that you are getting the correct data after before. So I believe it is working as designed
So basically your object should be finalized before cypress test execution starts if you want your data.forEach to get the final changes, having it in before probably wont work
try moving the object assignment outside of before() directly to describe that should work