title: How to get window scroll bar position using Cypress
body: <p>I use <code>Cypress</code> for functional testing. And want to test or window vertical scrollbar has specific positions.</p>
  
  <p>I tried:</p>
  
  <pre><code>    cy.document().then((doc) =&gt; {                                                                                           
        cy.window().then(win =&gt; {                                                                                             
          const doc = document.documentElement;                                                                                 
          const left = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);                                          
          const top = (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0);                                            
  
          console.log(top, left)  // 0, 0                                                                                            
        })                                                                                                                    
      }) 
  </code></pre>