Temporary fix for SWTBotTextTest.typesText()
In Oxygen on CentOS, Control.forceFocus() does not give proper keyboard
focus to the text widget. Pressing the SPACE key gives keyboard focus.
Change-Id: I3c64cbf01e6d50783e680f7f19b4073fb3a9a449
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
diff --git a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTextTest.java b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTextTest.java
index e0257cb..26d8686 100644
--- a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTextTest.java
+++ b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTextTest.java
@@ -18,7 +18,9 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.test.AbstractControlExampleTest;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.Before;
import org.junit.Test;
@@ -53,6 +55,13 @@
@Test
public void typesText() throws Exception {
final SWTBotText text = bot.textInGroup("Text");
+
+ /*
+ * Temporary fix for Bug 516674. Pressing the SPACE key gives proper
+ * keyboard focus to the text widget.
+ */
+ text.pressShortcut(Keystrokes.SPACE);
+
text.setText("");
text.typeText("Type This 123");
@@ -88,6 +97,7 @@
@Before
public void prepareExample() throws Exception {
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
bot.tabItem("Text").activate();
}