title: Testcafe: repeat click until another element appears
body: <p>I'm testing a user interface with testcafe. </p>
  
  <p>The user is asked to click a button until a modal dialog appears, then it should click on a button in the dialog.</p>
  
  <p>The number of clicks may vary in the test, sometimes is two, sometimes three. Thus, this code doesn't always work</p>
  
  <pre><code>await t
    .click(Button)
    .click(Button)
    .click(Button)
    .click(ModalDialogButton);
  </code></pre>
  
  <p>I need a way to repeatedly click <code>Button</code> until <code>ModalDialogButton</code> appears. Then, <code>ModalDialogButton</code> must be clicked. </p>
  
  <p>How can I do this with testcafe?</p>