Skip to content

Commit adb3fdc

Browse files
Revert fix error SWT bot test
1 parent 3656d2d commit adb3fdc

1 file changed

Lines changed: 1 addition & 34 deletions

File tree

  • tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/project

tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/project/AddProjectNatureTest.java

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -249,38 +249,5 @@ private static void toggleFilters(boolean checked) {
249249
item.toggleCheck();
250250
}
251251

252-
// Wait for UI to process changes and for the Apply button to be enabled
253-
// Use ConditionHelpers or implement a more robust wait
254-
SWTBot dialogBot = shell.bot();
255-
try {
256-
// Wait for the Apply button to be enabled (up to 5 seconds)
257-
fBot.waitUntil(org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled(
258-
dialogBot.button(APPLY_BUTTON)), 5000);
259-
} catch (Exception e) {
260-
// If button is not found or doesn't enable, try alternative approaches
261-
// First, wait a bit more for UI to settle
262-
fBot.sleep(1000);
263-
try {
264-
dialogBot.button(APPLY_BUTTON).click();
265-
} catch (WidgetNotFoundException e2) {
266-
// If Apply button is still not found, try OK button as fallback
267-
try {
268-
dialogBot.button("OK").click();
269-
return;
270-
} catch (WidgetNotFoundException e3) {
271-
// Log available buttons for debugging
272-
org.eclipse.swtbot.swt.finder.widgets.SWTBotButton[] buttons = dialogBot.allButtons();
273-
StringBuilder availableButtons = new StringBuilder("Available buttons: ");
274-
for (org.eclipse.swtbot.swt.finder.widgets.SWTBotButton btn : buttons) {
275-
availableButtons.append("[").append(btn.getText()).append("] ");
276-
}
277-
throw new WidgetNotFoundException(availableButtons.toString(), e3);
278-
}
279-
}
280-
return;
281-
}
282-
283-
// Button is enabled, click it
284-
dialogBot.button(APPLY_BUTTON).click();
285-
}
252+
shell.bot().button(APPLY_BUTTON).click();
286253
}

0 commit comments

Comments
 (0)