<div class="form-fill-file">
<input data-val="true" data-val-requiredif="Please upload invoice file." id="Upload_File" name="Upload.File"
type="file" value="" class="valid" aria-invalid="false">
</div>
I have written the following script:
it('Upload file', () => {
const filepath = 'air1.pdf'
cy.get('#Upload_File').attachFile(filepath).click()
cy.get('.form-fill-file').contains('air1.pdf')
})
After I add the file, file name is displayed as shown in the image, but I am not able to assert this. I am getting the following error: