title: How to use values from DOM in cypress test?
body: <p>if I have a page containing:</p>
  
  <pre><code>  &lt;span data-testid="credit-balance"&gt;
      10
    &lt;/span&gt;
  </code></pre>
  
  <p>In Cypress, how do I extract the value to a variable to use in tests?</p>
  
  <p>Something along the lines of:</p>
  
  <pre><code>const creditBalance = cy.get('[data-testid="credit-balance"]').value();
  </code></pre>