Created
January 28, 2016 12:33
-
-
Save davidmigloz/8dabbdd012fbdb92838f to your computer and use it in GitHub Desktop.
Basic template for Robotium testing.
This file contains hidden or 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 com.davidmiguel.taxsystem; | |
import junit.framework.Test; | |
import junit.framework.TestSuite; | |
public class AllTests { | |
public static Test suite() { | |
TestSuite suite = new TestSuite(AllTests.class.getName()); | |
suite.addTest(TestSuite.createTest(ExampleTest.class, "testXXX")); | |
// Add here more test cases... | |
return suite; | |
} | |
} |
This file contains hidden or 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 com.davidmiguel.taxsystem; | |
import android.test.ActivityInstrumentationTestCase2; | |
import com.davidmiguel.taxsystem.activities.EmployeesList; | |
import com.robotium.solo.Solo; | |
public class ExampleTest extends ActivityInstrumentationTestCase2<EmployeesList> { | |
private Solo solo; | |
public AddEmployeeTest() { | |
super(EmployeesList.class); | |
} | |
public void setUp() throws Exception { | |
super.setUp(); | |
solo = new Solo(getInstrumentation(), getActivity()); | |
} | |
public void tearDown() throws Exception { | |
solo.finishOpenedActivities(); | |
} | |
public void testXXX() throws Exception { | |
// Unlock the screen if it is locked | |
solo.unlockScreen(); | |
// Write your test here... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment