Skip to content

shaynet10/cypress-clipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published