Thursday, December 29, 2011

No error dialogs in eclipse headless test

Here's a small funny thing I learned a while ago while running GUI tests of Eclipse application and now stumbled upon it again.
When running Eclipse tests headlessly, certain dialogs don't show up as they would normally (e.g. when writing/recording the test). This is because of flags:


org.eclipse.jface.dialogsErrorDialog.AUTOMATED_MODE = false;
org.eclipse.jface.util.SafeRunnable.setIgnoreErrors(true);


So if you for example have a test scenario that DOES expect an error dialog to show up, make sure you have above flags set correctly, or find out a different assertion than waiting for an error dialog.