Cannot read property 'data' of undefined #16987
Rajesh-Kodandam
started this conversation in
Cypress Cloud
Replies: 1 comment 1 reply
-
If you what to use fixtures from before block, you must use function callback, not arrow function () => {} in the it block. https://docs.cypress.io/api/commands/fixture#this-context
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on cypress: 7.4.0
describe('verif', () => {
before (function() {
cy.fixture('example').then(function(data){
this.data = data;
});
});
It('valida', () => {
cy.log('');
});
})
Not sure the reason I have this error while trying to use the data from fixture "Cannot read property 'data' of undefined"
Your advice much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions