title: How to do conditional checks in cypress
body: <p>I have tree with multiple elements - some elements are inside the header element.</p>
  <p>For Eg:</p>
  <ol>
  <li><p>Parent Element</p>
  <p>Child element1</p>
  <p>Child Element</p>
  </li>
  <li><p>Axis element</p>
  </li>
  </ol>
  <p>Child elements are visible only when user clicks on the expand option for parent.
  I am trying to write something to check if there are child elements exist or not, to determine the given element is header or not.
  But cypress test fails compiling, it can't find the child elements.</p>
  <p>Is there any way we can conditionally check the presence of these child elements even when the header is not expanded?</p>
  <p>As in screenshot these elements are only visible if the tree node for parent expanded.</p>
  <p>My intention is to determine whether a given element is header or not, then I can decide what action to do.</p>
  <p>Just to clarify my question is - is there way in cypress to check if an element exist and if not I need to do some other actions?</p>
  <p>[<img src="https://i.stack.imgur.com/sanuP.png" alt="I want to check the tree node ng][1]" /></p>