cypress-cdp-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i cypress-cdp-client

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

136 kB

Total Files

20

Last publish

Collaborators

  • shay.gueta