Skip to content

Commit 8bdeb31

Browse files
authored
Fix Kokoro nightly release builds (#3597)
1 parent bdaea16 commit 8bdeb31

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DebugNativeAppEngineStandardProjectTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
4545
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
4646
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
47+
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
4748
import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText;
4849
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
4950
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -91,12 +92,11 @@ public void testDebugLaunch() throws Exception {
9192
assertNotNull(testProject);
9293
SwtBotTestingUtilities.waitUntilMenuHasItem(
9394
bot, () -> bot.menu("Run").menu("Debug As"), endsWith("Debug on Server"));
94-
SwtBotTestingUtilities.performAndWaitForWindowChange(
95-
bot,
96-
() -> {
97-
bot.menu("Run").menu("Debug As").menu("1 Debug on Server").click();
98-
});
9995

96+
bot.menu("Run").menu("Debug As").menu("1 Debug on Server").click();
97+
SwtBotTestingUtilities.waitUntilShellIsOpen(bot, "Debug On Server");
98+
SWTBotShell debugPage = bot.shell("Debug On Server");
99+
debugPage.activate();
100100
SwtBotTestingUtilities.clickButtonAndWaitForWindowClose(bot, bot.button("Finish"));
101101

102102
bot.perspectiveById("org.eclipse.debug.ui.DebugPerspective")

plugins/com.google.cloud.tools.eclipse.swtbot/src/com/google/cloud/tools/eclipse/swtbot/SwtBotTestingUtilities.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@ public boolean test() throws Exception {
126126
});
127127
}
128128

129+
/**
130+
* Blocks the caller until the shell matching the text is open.
131+
*/
132+
public static void waitUntilShellIsOpen(SWTBot bot, String text) {
133+
bot.waitUntil(new DefaultCondition() {
134+
@Override
135+
public String getFailureMessage() {
136+
return "Cannot find a shell with text '" + text + "'";
137+
}
138+
139+
@Override
140+
public boolean test() throws Exception {
141+
return bot.shell(text).isOpen();
142+
}
143+
});
144+
}
145+
129146
/**
130147
* Blocks the caller until the given shell is closed.
131148
*/

0 commit comments

Comments
 (0)