JSPM

cypress-clipboard

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5295
  • Score
    100M100P100Q127614F
  • License MIT

Adds ability to copy and paste from clipboard to Cypress

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-clipboard

Usage


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');

Special thanks to

Gleb Bahmutov For cypress-cdp package, and for this amazing youtube video about adding permissions to Cypress. It helped me alot.