Added waitForDialogToOpen() & waitForDialogToClose()