package com.example.stockprophit.test;

import com.example.stockprophit.DisplayMessageActivity;
import com.example.stockprophit.FriendProfile_Activity;
import com.example.stockprophit.LoginActivity;
import com.example.stockprophit.MainActivity;
import com.example.stockprophit.SocialActivity;
import com.example.stockprophit.SocialSearch;
import com.jayway.android.robotium.solo.Solo;

import android.test.ActivityInstrumentationTestCase2;

/**
 * @author Frank Bohn
 *
 */
public class Test1 extends ActivityInstrumentationTestCase2<LoginActivity> {

	private Solo solo; 
	
	public Test1() {
		super("com.example.stockprophit", LoginActivity.class);
	}

	/* (non-Javadoc)
	 * @see android.test.ActivityInstrumentationTestCase2#setUp()
	 */
	protected void setUp() throws Exception {
		super.setUp();
		solo = new Solo(getInstrumentation(), getActivity());
	}
	public void testSocialPost()
	{
		solo.assertCurrentActivity("check on first activity", LoginActivity.class);
		solo.clickOnText("Username");
		solo.enterText(0, "FrankBohn");
		solo.enterText(1, "aaaaa");
		solo.clickOnButton("Sign in or register");
		solo.clickOnText("Social");
		solo.clickOnText("Enter Post");
		solo.enterText(0, "Robotium Test");
		solo.clickOnButton("Submit");
		solo.clickOnButton("Home");
		assertTrue(solo.searchText("FrankBohn: Robotium Test",1));
		solo.clickOnButton("Social");
		solo.sleep(5000);
		solo.clickOnButton("View My Profile");
		solo.sleep(5000);
		assertTrue(solo.searchText("FrankBohn: Robotium Test",1));
		}

}
	

