From 2fbe9c4e265956c7da39a0587c1a265bb4100b40 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Sat, 21 Jan 2012 23:39:35 +0100 Subject: [PATCH] ScenarioHelper: Fix createTestServer(). --- .../org/yaaic/test/scenario/ScenarioHelper.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/src/org/yaaic/test/scenario/ScenarioHelper.java b/test/src/org/yaaic/test/scenario/ScenarioHelper.java index e88cd0d..f323b7d 100644 --- a/test/src/org/yaaic/test/scenario/ScenarioHelper.java +++ b/test/src/org/yaaic/test/scenario/ScenarioHelper.java @@ -24,6 +24,9 @@ import org.yaaic.R; import org.yaaic.activity.ConversationActivity; import org.yaaic.activity.ServersActivity; +import android.view.View; +import android.widget.EditText; + import com.jayway.android.robotium.solo.Solo; /** @@ -53,17 +56,23 @@ public class ScenarioHelper if (!solo.searchText("RobotiumTest")) { solo.assertCurrentActivity("Starting at ServersActivity", "ServersActivity"); - solo.pressMenuItem(0); + View view = solo.getView(R.id.add); + assert view != null; + + solo.clickOnView(view); - solo.waitForActivity("AddServerActivity", 2000); + solo.waitForActivity("AddServerActivity"); solo.assertCurrentActivity("Switched to AddServerActivity", "AddServerActivity"); solo.enterText(0, "RobotiumTest"); solo.enterText(1, "irc.epd-me.net"); solo.enterText(4, "YaaicBotium"); - solo.enterText(6, "Robotium and Yaaic"); + // Somehow robotium doesn't detect the field when using index 5 + EditText realname = (EditText) solo.getView(R.id.realname); + solo.enterText(realname, "Robotium and Yaaic"); + solo.clickOnButton(solo.getString(R.string.server_save)); solo.waitForActivity("ServersActivity", 2000);