Below is the code i'm using to upload the file into the system from the test runner.
it.only('Check the item upload file validations', () => {
cy.get('[icon="fa fa-cloud-upload"]').click()
cy.get('[id="itemListController"]',{force:true}).attachFile('itemfile.xlsx')
cy.get('.p-float-label > [type="submit"]').click()
// cy.pause()
})
When the cypress the code executes , it displays a system internal validation as if the file is not being attached to the web page to be uploaded even though the file name is clearly being displayed in the input field.
Below is the element im trying to upload the file in to before clicking the submit button
<input _ngcontent-wul-c516="" id="itemListController" formcontrolname="itemListController" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" hidden="" class="ng-untouched ng-pristine ng-invalid">