groovyautomated-testsgeb

GEB: Disable implicit assertions in waitFor block


I have a waitFor{} block with several lines inside:

waitFor(timeOutSeconds) {
    jobRow.clickUpdate()
    processDialog.waitIfShown()
    jobRow.statusCell.text() == status.value
}

According to The Book of GEB:

Any calls to refreshWaitFor() method have implicit assertions added to each expression in the bloc passed to it just like for waitFor() method calls.

The problem is that processDialog.waitIfShown() can return false, and this is actually okay if the progress bar was not displayed.

I need the only last row to be verified for groovy truth, so now I'm writing processDialog.waitIfShown() || true to skip this expression verification. This works but looks odd.

Is there any flag or option to turn off implicit assertions in waiting blocks?


Solution

  • If you would like to disable implicit assertions for a specific waitFor() call then no, that's currently not supported out of the box. There is a number of workarounds, though:

    If you believe that the above options/workarounds are insufficient then please feel free to raise an issue in the tracker.