title: How to write variable values on text file or Excel file in Cypress.io?
body: <p>Does anyone know how I can write the variable values on Text or Excel sheet? 
  I have variable <code>tex</code> and it stores the string values and i want to write those values on textfiles or Excel sheet( preferable) </p>
  
  <pre><code>beforeEach(() =&gt; {
      cy.visit('https://docs.cypress.io/api/commands/closest.html#Syntax')
    })
  it('go to the home page', () =&gt; {
    cy.get('.sidebar-link').each(($el, index, $list) =&gt; {
      const tex = $el.text()
    cy.writeFile('/Users⁩/⁨Desktop⁩/2.txt', tex) // &lt;= This piece of code is printing only last stored value
    })
  });
  </code></pre>
  
  <p>I know there is <code>cy.writeFile</code> but not sure how i can use it.</p>