Skip to content
Cypress File download custom command
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src updated version Jul 26, 2019
types first commit with working downloadfile Jul 26, 2019
.babelrc
.gitignore first commit with working downloadfile Jul 26, 2019
.npmignore first commit with working downloadfile Jul 26, 2019
.prettierrc.js first commit with working downloadfile Jul 26, 2019
LICENSE Initial commit Jul 26, 2019
README.md
cypress.json
package-lock.json first commit with working downloadfile Jul 26, 2019
package.json

README.md

cypress-downloadfile

npm version

This is a Cypress custom file download command.

This repository is not maintained by the Cypress developers.

Installation

Install the module.

npm install cypress-downloadfile

Add the following line to cypress/support/commands.js.

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})
}

If autocompletion does not work out of the box you can add the following line above your testfile

/// <reference types="cypress-downloadfile"/>

Example of command

cy.downloadFile('https://library.concordia.ca/help/technology/recovering_saved_files.pdf','mydownloads','demo.pdf')
You can’t perform that action at this time.