I created a utility method that attempts to remove all breakpoints in the Eclipse Breakpoints view. I ran into a problem where the utility was timing out when there were not breakpoints set in the system. So I attempted to update the utility to check the enabled state of the Remove All Breakpoints button before attempt to click it and wait for a dialog to be displayed. When I added the check of the enabled condition the button is no longer clicked. Is this a problem with testing the Condition returned from the isEnabled() method of a ContributedToolItemLocator?
- Code: Select all
public static void removeAllBreakpoints(IUIContext ui) throws Exception {
EclipseUtils.openViewByName("Breakpoints");
ContributedToolItemLocator removeAllButtonLocator = new ContributedToolItemLocator("org.eclipse.debug.ui.breakpointsView.toolbar.removeAll");
IUICondition enabledCondition = removeAllButtonLocator.isEnabled(true);
if (enabledCondition.testUI(ui)) {
ui.click(removeAllButtonLocator);
ui.wait(new ShellShowingCondition("Remove All Breakpoints"));
ui.click(new ButtonLocator("&Yes"));
ui.wait(new ShellDisposedCondition("Remove All Breakpoints"));
}
}
Thanks,
Joe