Created
June 26, 2015 10:03
-
-
Save xdtianyu/d6d725aedacdecdc236a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.xdty.buttontest; | |
import android.test.ActivityInstrumentationTestCase2; | |
/** | |
* Created by ty on 15-6-26. | |
*/ | |
public class ActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | |
public ActivityTest() { | |
super(MainActivity.class); | |
} | |
@Override | |
protected void setUp() throws Exception { | |
super.setUp(); | |
} | |
@Override | |
protected void tearDown() throws Exception { | |
super.tearDown(); | |
} | |
@Override | |
protected void runTest() throws Throwable { | |
super.runTest(); | |
} | |
public void testName() throws Exception { | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
getActivity().textView.setText(":xxx"); | |
} | |
}); | |
getInstrumentation().waitForIdleSync(); | |
assertEquals(":xxx", getActivity().textView.getText().toString()); | |
} | |
public void testColor() throws Exception { | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
getActivity().editText.setText(":xxx"); | |
} | |
}); | |
getInstrumentation().waitForIdleSync(); | |
assertEquals(":xxx", getActivity().button.getText()); | |
} | |
public void testButton() throws Exception { | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
getActivity().button2.performClick(); | |
} | |
}); | |
getInstrumentation().waitForIdleSync(); | |
assertEquals(false, getActivity().buttonFloatShare.isShow); | |
Thread.sleep(3000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment