title: cannot locate 'iframe' using cypress
body: <p>I am using cypress to test my site what I want to achieve is the following :
  under this link: <a href="https://www.glassboxdigital.shop/product-page/classic" rel="nofollow noreferrer">https://www.glassboxdigital.shop/product-page/classic</a>
  when I click on 'Add to Cart'
  <a href="https://i.stack.imgur.com/sUnYr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sUnYr.png" alt="enter image description here" /></a></p>
  <p>there is a side panel that pops out from the right side :
  <a href="https://i.stack.imgur.com/ymLnr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ymLnr.png" alt="enter image description here" /></a></p>
  <p>I want to click on 'View Cart' button my first go was the naive one - getting the element locator and click on it, as I saw it failed, I investigated a little bit and found out it is 'iframe' I tried using 'iframe' by pointing it out as following:</p>
  <pre><code>cy.get(&quot;iframe[frameborder='0']:nth-child(2)&quot;).then(function($elem){
       var ifele = $elem.contents().find(&quot;a[id*='view-cart-button']&quot;)
       cy.wrap(ifele).click()
  </code></pre>
  <p>but when I ran it the result was :</p>
  <pre><code>Expected to find element: undefined, but never found it
  
  cy.get(&quot;iframe[frameborder='0']:nth-child(2)&quot;).then(function($elem){
    16 |             var ifele = $elem.contents().find(&quot;a[id*='view-cart-button']&quot;)
  &gt; 17 |             cy.wrap(ifele).click()
       |                ^
    18 |         })
    19 |     
    20 |     }
  </code></pre>