title: Cypress: function of click random element and storage its title to verify later
body: <p>this is my first question of stackoverflow community, I am currently working with Cypress and have created test case that   randomly clicks an element from a list. I am trying to also get the text from that same function for my case, i am trying to do;</p>
  <ul>
  <li>Open main site</li>
  <li>Select any elements from elements section (randomly)</li>
  <li>Once details page for the selected elements is opened verify its title equals to the titles selected in previous page</li>
  <li>The problem is I am unable to return the title properly I can't get
  the titles to be equal. The code I currently have is:</li>
  </ul>
  <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>    context('Select feature of site', () =&gt; {
         it('Randomly select element of elements section', () =&gt; {
             cy.visit('website url')
             cy.wait(600)
             cy.get('.element_container')
              .children()
              .eq(Math.floor(Math.random() * 44))
              .click({force: true}) 
              .each(($containerSubNewsListWrapper) =&gt; {
             cy.get($containerSubNewsListWrapper).click()
              // cy.title().should('eq','') i stucked here
             })
         }) })
         </code></pre>
  </div>
  </div>
  </p>
  <p>I click randomly but I'm stuck on syncing the title,i would need to retrieve a title for an item selected randomly and store it somewhere, verify afterwards.
  I appreciate any ideas</p>