Package Exports
- cypress-clipboard
- cypress-clipboard/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cypress-clipboard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
cypress-clipboard
Adds ability to:
- read clipboard's content
- write to clipboard
Notice
Since it uses Chrome Devtools Protocol,
This package works with Chrome.
- Electron is not supported.Install
npm install cypress-clipboard;Or
yarn add cypress-clipboardUsage
Copy string to clipboard
import 'cypress-clipboard';
cy.get('SOME SELECTOR')
.invoke('text')
.copyToClipboard(); Or
import 'cypress-clipboard';
cy.wrap('SOME STRING VALUE')
.copyToClipboard(); Copy from clipboard
import 'cypress-clipboard';
cy.copyFromClipboard().then(clipboardData => {})
Or
import 'cypress-clipboard';
cy.copyFromClipboard().should('eq', 'EXPECTED VALUE');