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.
Contents
Cypress Upload File
You need to install
- 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 - http://bit.ly/learntesting2019
β
Automation Community - https://thetestingacademy.com
π¦Follow us on Twitter - https://twitter.com/itstechmode
π Like us on Facebook - https://www.facebook.com/scrolltest
π€ Listen to our Podcast - https://anchor.fm/thetestingacademy
------------------------------------------------------
#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest
Day 8 of 100: Arrays β Storing and Slicing Test Data
Day 8 of 100 β 100 Days of Playwright with TypeScript Challenge.
Day 7 of 100: Arrow Functions β Playwright’s Default Syntax
Day 7 of 100 β 100 Days of Playwright with TypeScript Challenge.
Day 6 of 100: Functions β Building Reusable Test Helpers
Day 6 of 100 β 100 Days of Playwright with TypeScript Challenge.
Day 5 of 100: Loops β Data-Driven Tests and Retry Logic
Day 5 of 100 β 100 Days of Playwright with TypeScript Challenge.
Day 4 of 100: Operators and Conditionals β The Logic of Assertions
Day 4 of 100 β 100 Days of Playwright with TypeScript Challenge.
Day 3 of 100: Data Types and the null vs undefined Trap
Day 3 of 100 β 100 Days of Playwright with TypeScript Challenge.
