Sure, so I have my image file on this location and I call it via fixture command, and load it in selectFile, after which I force to upload it (because input=file element is hidden because of use of Ant design on front), after which I press save button. Image gets uploaded but when I click on it, it is opened as this element shown on uploaded image above.
Snippet of code:
cy.fixture('/images/testImageFile.jpeg').as('imageFile');
ProjectNameAssetDetailsPage.elements.uploadImageFileButton()
.selectFile('@imageFile', {
force: true,
});
ProjectNameAssetDetailsPage.elements.saveAssetChangesButton()
.click({force : true});
// assert that the file is uploaded and present in the list on the asset
ProjectNameAssetDetailsPage.elements.uploadedFilesList()
.should('contain.text', 'testImageFile.jpeg');