title: How to fetch copied to clipboard content in cypress
body: <p>How to get the 'clipboard' content in cypress. I have a button in my web application, on click of button  system will perform 'copy to clipboard' and a message will get displayed. Below is an example of the url content that is copy to clipboard ( <em>this url content is different from web site url</em>)</p>
  
  <p><a href="https://someurl.net/machines/0c459829-a5b1-4d4b-b3c3-18b03c1c969a/attachments/a30ceca7-198e-4d87-a550-04c97fbb9231/download" rel="noreferrer">https://someurl.net/machines/0c459829-a5b1-4d4b-b3c3-18b03c1c969a/attachments/a30ceca7-198e-4d87-a550-04c97fbb9231/download</a></p>
  
  <p>I have double check that there is no <code>href</code> attribute in that button tag. So I have use a plugin called clipboardy and I have added <code>plugins/index.js</code> file </p>
  
  <pre><code> const clipboardy = require('clipboardy');
      module.exports = ( on ) =&gt; {
          on('task', {
              getClipboard () {
                  return clipboardy.readSync();
              }
          });
      };
  </code></pre>
  
  <p>In my test I have used cy.task() to get the clipboard content, but this is not printing the actual url content </p>
  
  <pre><code>cy.get('td').find('div').find('span').find('button').find('i').eq(0).click().then(()=&gt;{
            cy.task('getClipboard').then((data)=&gt;{
            console.log("Helloooo:"+data);
        })
      })
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;td class="sc-hgRTRy duUdhJ"&gt;
  &lt;div&gt;
  &lt;span class="sc-bYwvMP jTmLTC"&gt;
  &lt;span class="sc-jzJRlG iVpVVy"&gt;
  &lt;span role="button" aria-expanded="true" aria-haspopup="true" aria-owns="5aa03785-1370-455e-a838-4154f7481a7b"&gt;
  &lt;button class="sc-feJyhm cJOKrG"&gt;
  &lt;i class="icon fas fa-link sc-htpNat cQABgO" aria-hidden="true" data-component-type="icon"&gt;
  &lt;/i&gt;
  &lt;/button&gt;
  &lt;/span&gt;
  &lt;/span&gt;
  &lt;/span&gt;
  &lt;/div&gt;
  &lt;/td&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/523LH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/523LH.png" alt="enter image description here"></a></p>