Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
cypress-delete-downloads-folder
Advanced tools
Cypress custom command and hooks to remove downloads folder
Cypress custom commands and hooks to delete Cypress.config('downloadsFolder')
folder
npm i -D cypress-delete-downloads-folder
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', () => {})
})
To enable IntelliSense information and autocomplete you have to include types in the tsconfig.json
file:
{
"compilerOptions": {
"types": ["cypress", "cypress-delete-downloads-folder"]
}
}
Yevhen Laichenkov elaichenkov@gmail.com
FAQs
Cypress custom command and hooks to remove downloads folder
We found that cypress-delete-downloads-folder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.