CSV parsing error when uploading a csv file in cypress

Viewed 61

I am having issues with uploading a csv file to test in cypress so I am successful in uploading the file and it also shows the file being uploaded in the UI but the values are not updated in the required fields. When I right-click and inspect, and check the console, I can see there is a CSV PARSING ERROR in the response

cy.fixture('contentData.csv').then((fileContent) => {
  cy.get('input[type="file"]').attachFile({
    fileContent: fileContent.toString(),
    fileName: 'contentData.csv',
    mimeType: 'text/csv',
  });
});

I was hoping someone can tell me where i am going wrong

0 Answers
Related