Socket
Socket
Sign inDemoInstall

cypress-clipboard

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cypress-clipboard

Adds ability to copy and paste from clipboard to Cypress


Version published
Weekly downloads
479
increased by16.83%
Maintainers
1
Install size
3.08 MB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 18 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc