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 Test4 extends ActivityInstrumentationTestCase2<LoginActivity> {

	private Solo solo; 
	
	public Test4() {
		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 testFavorites()
	{
		//Series of button clicks and entering text to test the interface
		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.clickOnButton("Faves");
		solo.sleep(5000);
		solo.clickOnText("Apple Inc.");
		solo.sleep(5000);
		assertTrue(solo.searchText("AAPL",1));
		solo.sleep(5000);
	}
}