title: How to expose/access a data store like Redux within a cypress test?
body: <p>The <a href="https://docs.cypress.io/guides/overview/key-differences.html#New-kind-of-testing" rel="noreferrer">Cypress docs</a> say you can </p>
  
  <blockquote>
    <p>Expose data stores (like in Redux) so you can programmatically alter the state of your application directly from your test code.</p>
  </blockquote>
  
  <p>I also watched a course on testing by Mr. Kent C. Dodds where he mentions a redux store could be initialized with existing data in Cypress (before or within tests, not sure)</p>
  
  <p>I went through pretty much all the docs and googled and I just can't find any references or examples of actually doing this other than it being mentioned as one of the key differences on the introductory page.</p>
  
  <p>How does one achieve something like that, if possible?</p>
  
  <p>The case I am interested in is for E2E tests:</p>
  
  <ul>
  <li>First I would test my auth/login functionality as a standard E2E test</li>
  <li>Then for testing other parts of the application I would add a Cypress Command that would directly make the auth call and set up the store from the response whenever I needed to log in (same for log out), instead of manually typing in the credentials &amp; clicking log in (which might be what I end up doing anyway)</li>
  </ul>
  
  <p>This might not be the best use case (or a good one even) but I'm sure there are other cases where at least initializing your redux state with some data would come in very handy.</p>
  
  <p>Thanks!</p>