Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. package ca.ualberta.cs.lonelytwitter;
  2.  
  3. import android.app.Activity;
  4. import android.test.ActivityInstrumentationTestCase2;
  5. import android.widget.EditText;
  6.  
  7. import com.robotium.solo.Solo;
  8.  
  9. import junit.framework.TestCase;
  10.  
  11. public class LonelyTwitterActivityTest extends ActivityInstrumentationTestCase2<LonelyTwitterActivity> {
  12. private Solo solo;
  13.  
  14. public LonelyTwitterActivityTest() {
  15. super(ca.ualberta.cs.lonelytwitter.LonelyTwitterActivity.class);
  16. }
  17.  
  18. /**
  19. * Runs at the begining of the tests
  20. * pretty much this function runs all the time whenver you run a test
  21. * @throws Exception
  22. */
  23. public void setUp() throws Exception{
  24. solo = new Solo(getInstrumentation(),getActivity());
  25.  
  26. }
  27.  
  28.  
  29. public void testStart() throws Exception {
  30. Activity activity = getActivity();
  31.  
  32.  
  33. }
  34.  
  35. public void testTweet(){
  36. solo.assertCurrentActivity("Wrong Activity",LonelyTwitterActivity.class);
  37. solo.enterText ((EditText)solo.getView(R.id.body),"Test Tweet!");
  38. solo.clickOnButton("Save");
  39. solo.enterText ((EditText)solo.getView(R.id.body),"");
  40.  
  41. assertTrue(solo.waitForText("Test Tweet!"));
  42.  
  43. solo.clickOnButton("Clear");
  44.  
  45. }
  46.  
  47. public void testClicktweetList(){
  48.  
  49. }
  50.  
  51. /**
  52. * at the end of the test it will close the activity
  53. * @throws Exception
  54. */
  55. public void tearDown() throws Exception{
  56. solo.finishOpenedActivities();
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement