Cypress · Junior · Frage 65 von 75
Wie testet man einen Datei-Upload in Cypress?
- 1
cy.get('input[type=file]').selectFile('photo.png') - 2
cy.upload('photo.png') - 3
cy.get('input[type=file]').type('photo.png')
Antwort zeigen
Richtige Antwort: cy.get('input[type=file]').selectFile('photo.png')
Erklärung
.selectFile() kann mit { action: 'drag-drop' } auch Drag and Drop simulieren.