Cypress Tutorial For Beginners : Part 4 ( Cypress Download File )

Cypress Tutorial For Beginners - Download File

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

Contents

Cypress Download File

First make sure you install the node module of the Download file cypress from the link above.

Install the Node module

npm install cypress-downloadfile

Now You have to write the following code plugin files in plugin index.js folder.

require('cypress-downloadfile/lib/downloadFileCommand')
#Add the following lines to cypress/plugins/index.js.
const {downloadFile} = require('cypress-downloadfile/lib/addPlugin')
module.exports = (on, config) => {
on('task', {downloadFile})
}

Now You can use this below code to download the file.

cy.downloadFile('https://library.concordia.ca/help/technology/recovering_saved_files.pdf','mydownloads','demo.pdf')

-----------------------------------------------------
👪 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
------------------------------------------------------

42% of All Code Is Now AI-Generated. 96% of Developers Don’t Trust It. QA Just Became the Most Important Role in Tech.

42% of All Code Is Now AI-Generated. 96% of Developers Don’t Trust It. QA Just Became the Most Important Role in Tech.

Flaky Tests Are Killing Your CI/CD Pipeline — Here Is How to Find and Fix Them

Flaky Tests Are Killing Your CI/CD Pipeline — Here Is How to Find and Fix Them

Your AI Agent Passed the Demo. It Will Fail in Production. Here Is How QA Teams Evaluate Agents Before That Happens.

Your AI Agent Passed the Demo. It Will Fail in Production. Here Is How QA Teams Evaluate Agents Before That Happens.

Playwright CLI + OpenCode: The Deadly Combo Making $50K Enterprise Tools Obsolete

Playwright CLI + OpenCode: The Deadly Combo Making $50K Enterprise Tools Obsolete

Your Voice Agent Passes Every Test — Until a Real Human Talks to It

Your Voice Agent Passes Every Test — Until a Real Human Talks to It

Playwright Test Agents Are Here: I Spent a Week Letting AI Write My Tests (Here’s What Actually Works)

Playwright Test Agents Are Here: I Spent a Week Letting AI Write My Tests (Here’s What Actually Works)

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

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