Instead of waiting for tests to time out if they show a dialog that they cannot interact with, throw an error immediately if a dialog is shown.