This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// defined as: clipboard(): Chainable<Clipboard>; | |
Cypress.Commands.add('clipboard', () => { | |
cy.wrap( | |
Cypress.automation('remote:debugger:protocol', { | |
command: 'Browser.grantPermissions', | |
params: { | |
permissions: ['clipboardReadWrite', 'clipboardSanitizedWrite'], | |
origin: window.location.origin, | |
}, | |
}).catch((error) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadFixtures<Contents = unknown>(remainingPaths: string[], loadedContents: Contents[]): Chainable<Contents[]> { | |
return cy.fixture<Contents>(remainingPaths[0]).then((contents) => { | |
loadedContents.push(contents); | |
if (remainingPaths.length > 1) { | |
return loadFixtures(remainingPaths.slice(1), loadedContents); | |
} | |
return cy.wrap(loadedContents); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place inside C:\Program Files\Volta\bin and set WebStorm's Package Manager to C:\Program Files\Volta | |
// Credit: Modified from nodist - https://github.com/nullivex/nodist/blob/master/npm/bin/npm-cli.js | |
var child_process = require('child_process'); | |
child_process.spawn('npm', process.argv.slice(2), {stdio: 'inherit'}) | |
.on('error', function(err) { | |
console.log('Sorry. There was a problem with indirect running of npm.'); | |
throw err; | |
}) |