Cypress Tutorial For Beginners : Part 2 ( Upload a File )

In this video cypress tutorial for beginners, We are going to learn how to upload a file in cypress and create our first script to test to upload a file and check that file is uploaded successfully. 

You need to install

  1. Download the node module  :  npm i cypress-file-upload

2. Require it in your script

import 'cypress-file-upload';

3. Now use the Fixture method to upload the file.

const fileName = 'data.json';
cy.fixture(fileName).then(fileContent => {
cy.get('[data-cy="file-input"]').upload({ fileContent, fileName, mimeType: 'application/json' });

👪 Join our Community -
✅ Automation Community -
🐦Follow us on Twitter -
📖 Like us on Facebook -
🎤 Listen to our Podcast -

#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest

4 thoughts on “Cypress Tutorial For Beginners : Part 2 ( Upload a File )”

  1. it was helpful but facing issue in cypress-file -upload command when we are running it on jenkins there is any method that we can use ?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.