Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-delete-downloads-folder

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-delete-downloads-folder

Cypress custom command and hooks to remove downloads folder

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

cypress-delete-downloads-folder tests Total npm downloads

Cypress custom commands and hooks to delete Cypress.config('downloadsFolder') folder

Installation

npm i -D cypress-delete-downloads-folder

Usage

cypress-delete-downloads-folder extends Cypress' cy command.

So, if you want to use custom cy.deleteDownloadsFolder() command then you need to add this line to your project's cypress/support/commands.js:

require('cypress-delete-downloads-folder').addCustomCommand();

And add the following lines to your project's cypress/plugins/index.js:

const { removeDirectory } = require('cypress-delete-downloads-folder');

module.exports = (on, config) => {
  on('task', { removeDirectory })
}

Then, in your test, you can use it like this:

cy.deleteDownloadsFolder();

Also, you can use custom hooks to delete downloads folder before or after tests execution:

const { deleteDownloadsFolderBeforeAll } = require('cypress-delete-downloads-folder');

describe('delete downloads folder before all', () => {
  deleteDownloadsFolderBeforeAll()

  it('should work', () => {})
})
const { deleteDownloadsFolderBeforeEach } = require('cypress-delete-downloads-folder');

describe('delete downloads folder before each', () => {
  deleteDownloadsFolderBeforeEach()

  it('should work', () => {})
})
const { deleteDownloadsFolderAfterAll } = require('cypress-delete-downloads-folder');

describe('delete downloads folder after all', () => {
  deleteDownloadsFolderAfterAll()

  it('should work', () => {})
})
const { deleteDownloadsFolderAfterEach } = require('cypress-delete-downloads-folder');

describe('delete downloads folder after each', () => {
  deleteDownloadsFolderAfterEach()

  it('should work', () => {})
})

Types

To enable IntelliSense information and autocomplete you have to include types in the tsconfig.json file:

{
  "compilerOptions": {
    "types": ["cypress", "cypress-delete-downloads-folder"]
  }
}

Author

Yevhen Laichenkov elaichenkov@gmail.com

License

MIT

Keywords

FAQs

Package last updated on 04 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc