title: Cypress 10 - variables between cypress tests
body: <p>I am trying to get a value from response body and then using it in another it-s in Cypress 10. I have created custom cy.task for get and set global variable, but it's not a good solution when I need for example 10 values from previous test:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>await cy.task("getValue", {key: "one"}).then((one){
      await cy.task("getValue", {key: "two"}).then((two){
          await cy.task("getValue", {key: "three"}).then((three){
              await cy.task("getValue", {key: "four"}).then((four){
                  ...
                  if(one === null &amp;&amp; two === null &amp;&amp; three == null &amp;&amp; four == null){
                      do smth
                  }
              });
          });
      });
  });</code></pre>
  </div>
  </div>
  </p>
  <p>Another solution is get value from cy.task and save it into local variable:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let one_helper;
  let two_helper;
  let ...
  cy.task("getValue", {key: "one"}).then((one){
      one_helper = one;
  }
  cy.task("getValue", {key: "two"}).then((two){
      two_helper = two;
  }
  ...
  if(one_helper == null &amp;&amp; two_helper == null){
      do smth
  }</code></pre>
  </div>
  </div>
  </p>
  <p>But it's not a good solution for me because I have a lots of values from previous response.</p>