- add the confirmDialogHandler (using the UseDialogOnce class)
- Click (no wait!) the button
- Wait (30 seconds) for the dialog (if it doesn't show up you'll get an exception)
- Assert the confirm dialog message
- Click the OK button on the dialog.
- Wait until the dialog is closed (ie.WaitForComplete)
- Assert the right button was clicked (OK is put into a textfield by some java script in this specific html page).
It also uses the UseDialogOnce class to make sure the dialoghandler gets removed from dialogwatchers if the assertion fails. The using statement always calls a Dispose method on a class which inplements IDisposable. I recommend using this otherwise you might end up with strange test results (the WatiN tests where bugged with this for a while).