Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ca.ualberta.cs.lonelytwitter;
- import android.app.Activity;
- import android.test.ActivityInstrumentationTestCase2;
- import android.widget.EditText;
- import com.robotium.solo.Solo;
- import junit.framework.TestCase;
- public class LonelyTwitterActivityTest extends ActivityInstrumentationTestCase2<LonelyTwitterActivity> {
- private Solo solo;
- public LonelyTwitterActivityTest() {
- super(ca.ualberta.cs.lonelytwitter.LonelyTwitterActivity.class);
- }
- /**
- * Runs at the begining of the tests
- * pretty much this function runs all the time whenver you run a test
- * @throws Exception
- */
- public void setUp() throws Exception{
- solo = new Solo(getInstrumentation(),getActivity());
- }
- public void testStart() throws Exception {
- Activity activity = getActivity();
- }
- public void testTweet(){
- solo.assertCurrentActivity("Wrong Activity",LonelyTwitterActivity.class);
- solo.enterText ((EditText)solo.getView(R.id.body),"Test Tweet!");
- solo.clickOnButton("Save");
- solo.enterText ((EditText)solo.getView(R.id.body),"");
- assertTrue(solo.waitForText("Test Tweet!"));
- solo.clickOnButton("Clear");
- }
- public void testClicktweetList(){
- }
- /**
- * at the end of the test it will close the activity
- * @throws Exception
- */
- public void tearDown() throws Exception{
- solo.finishOpenedActivities();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement