Inndy / vue-clipboard2

A simple vue2 binding to clipboard.js
https://vue-clipboard2.inndy.tw/
MIT License
1.77k stars 242 forks source link

v-clipboard's copy function fails while using cypress #139

Open Daffodil404 opened 1 year ago

Daffodil404 commented 1 year ago

When I was using cypress to run test cases for the purpose to copy text via v-clipboard , it always occurs error while copying here is the simple example of my problem template part: <Button id="testBtn" v-clipboard:copy="statement" v-clipboard:success="handleCopySuccess" v-clipboard:error="handleCopyError"/> Button is a component whose core is <button> , which is used to control the process via click it. cypress test part cy.get('#testBtn').click() after execute this command , there is always a fail message for us that the copy had been failed, and there was nothing in the clipboard. What should I do to copy correctly while in cypress