@@ -0,0 +1,2689 @@
+package com.example.whatsmymood;%0A%0Aimport android.app.Activity;%0Aimport android.test.ActivityInstrumentationTestCase2;%0Aimport android.widget.AutoCompleteTextView;%0Aimport android.widget.EditText;%0A%0Aimport com.robotium.solo.Solo;%0A%0A/**%0A * Created by ejtang on 2017-03-13.%0A *%0A * testing our Login activity to make sure that everything works %0A */%0Apublic class LoginTest extends ActivityInstrumentationTestCase2 %7B%0A    private Solo solo;%0A%0A    public LoginTest() %7B%0A        super(LoginActivity.class);%0A    %7D%0A%0A    public void setUp() throws Exception %7B%0A        solo = new Solo(getInstrumentation(), getActivity());%0A    %7D%0A%0A    public void testStart() throws Exception %7B%0A        Activity activity = getActivity();%0A    %7D%0A%0A    public void testLoginWithExisting() %7B%0A        LoginActivity activity = (LoginActivity) solo.getCurrentActivity();%0A%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A        solo.enterText((AutoCompleteTextView) solo.getView(R.id.Username), %22testUser%22);%0A        solo.enterText((EditText) solo.getView(R.id.password), %22password%22);%0A%0A        solo.clickOnButton(%22Login%22);%0A        solo.assertCurrentActivity(%22Wrong Activity%22, MainActivity.class);%0A    %7D%0A%0A    public void testLoginWithNonExisting() %7B%0A        LoginActivity activity = (LoginActivity) solo.getCurrentActivity();%0A%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A        solo.enterText((AutoCompleteTextView) solo.getView(R.id.Username), %22Non-existing User%22);%0A        solo.enterText((EditText) solo.getView(R.id.password), %22password%22);%0A%0A        solo.clickOnButton(%22Login%22);%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A%0A        assertTrue(solo.waitForText(%22Wrong Username/Password Combination%22));%0A    %7D%0A%0A    public void testLoginWithoutPassword() %7B%0A        LoginActivity activity = (LoginActivity) solo.getCurrentActivity();%0A%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A        solo.enterText((AutoCompleteTextView) solo.getView(R.id.Username), %22Non-existing User%22);%0A%0A        solo.clickOnButton(%22Login%22);%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A%0A        assertTrue(solo.waitForText(%22This field is required%22));%0A    %7D%0A%0A    public void testLoginWithoutUsername() %7B%0A        LoginActivity activity = (LoginActivity) solo.getCurrentActivity();%0A%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A        solo.enterText((EditText) solo.getView(R.id.password), %22password%22);%0A%0A        solo.clickOnButton(%22Login%22);%0A        solo.assertCurrentActivity(%22Wrong Activity%22, LoginActivity.class);%0A%0A        assertTrue(solo.waitForText(%22This field is required%22));%0A    %7D%0A%7D%0A

Add intent testing for Login Activity