title: Cypress should not.exist or not.be.visible
body: <p>Because of - imo - poor page design, I've found myself having problems verify the visibility or non-existance of one or more elements on a page.</p>
  <p>The problem is that some of the elements does not exist, while some of them have CSS property display:none. But the existing test code checks for not.exist, which makes the test fail. But I cannot change to not.be.visible, since then it will fail on the other elements.</p>
  <p>So: Is it possible to do an OR in an assertion? Somthing like</p>
  <pre><code>cy.get('blabla').should('not.be.visible').or.cy.get('blabla').should('not.exist');
  </code></pre>
  <p>The above line compiles, but yields an undefined on the second part, so it doesn't work.</p>
  <p>Here's the code:</p>
  <p>(I don't consider the code architecture important - the question is basically the OR thing.)</p>
  <pre><code>page.sjekkAtDellaanFelterVises(2, 2, [
    DellaanFelter.formaal,
    DellaanFelter.opprinneligLaanebelop,
    DellaanFelter.utbetalingsdato,
    DellaanFelter.restlaanInnfridd,
  ]);
  
  public sjekkAtDellaanFelterVisesALT(sakRad: number, delLanRad: number, felter: DellaanFelter[]) {
    this.sjekkFelter(felter, DellaanFelter, (felt: string) =&gt; this.delLanAccordionBody(sakRad, delLanRad).get(this.e2e(felt)));
  }   
  
  @ts-ignore
  public sjekkFelterALT&lt;T, E extends Node = HTMLElement&gt;(felter: T[], enumType, lookupFn: (felt: string) =&gt; Chainable&lt;JQuery&lt;E&gt;&gt;) {
    this.valuesOfEnum(enumType).forEach(felt =&gt; {
      this.sjekkFelt(felt, felter, enumType, lookupFn);
    });
  }
  
  // @ts-ignore enumType fungerer fint i praksis ...
  public sjekkFeltALT&lt;T, E extends Node = HTMLElement&gt;(felt: string, felter: T[], enumType, lookupFn: (felt: string) =&gt; Chainable&lt;JQuery&lt;E&gt;&gt;) {
    if (felter.some(feltSomSkalVises =&gt; enumType[feltSomSkalVises] == felt)) {
      lookupFn(felt).should('be.visible');
    } else {
      lookupFn(felt).should('not.exist');
    }
  }    
  </code></pre>
  <p>Or is the solution to try and check if the elements exists first, then if they do, check the visibility?</p>