title: Cypress dynamically check deadlinks
body: <p>I wanted to check my navigations if it is dead / goes to the expected page,
  i have a menu array, now i want to check if the link is not &quot;#&quot; then visit the url and should contain the those links,</p>
  <p>so far i am stuck in this stage:</p>
  <pre class="lang-js prettyprint-override"><code>const menus = Menu;
  
  context(&quot;Nav items test&quot;, () =&gt; {
    beforeEach(() =&gt; {
      cy.visit(&quot;/&quot;);
    });
  
    it(&quot;should redirect to the expected pages&quot;, () =&gt; {
      cy.get(&quot;.navbar-nav&gt;li&gt;a[href!='/#']&quot;).each((links, index) =&gt; {
        cy.wrap(links).click();
        cy.url().should(&quot;contain&quot;, links[0].href);
      });
  });
  
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>export const Menu = [
      {
        id: 1,
        title: &quot;Home&quot;,
        link: &quot;/&quot;,
        children: [],
      },
      {
        id: 2,
        title: &quot;Consultants&quot;,
        link: &quot;#&quot;,
        children: [
          { childTitle: &quot;Find a Doctor&quot;, childTo: &quot;/consultant/doctors&quot; },
        ],
      },
      {
        id: 3,
        title: &quot;Services&quot;,
        link: &quot;/services&quot;,
        children: [
          {
            childTitle: &quot;Clinical Laboratory&quot;,
            childTo: &quot;/services/laboratoryservices&quot;,
          },
        ],
      },
      {
        id: 4,
        title: &quot;Packages&quot;,
        link: &quot;/packages&quot;,
        children: [],
      },
    ];
  </code></pre>