I am trying to create a for loop where I will pass all the files in the list using beforeEach and then I want to iterate the list in order to upload file via api call.
I have placed all my files under cypress/fixture/files folder.
I want to add the file that is under the fixture/files folder into the array like below:
beforeEach(() => {
cy.fixture('files/').as('files')
});
And then I want to iterate the files array to upload the files via api call.
I used below code to iterate:
cy.wrap(files).each((index) => {
const fileName = files[index];
When I try to use above code I get below error. I am not sure if I am using the right approach.
