can't make robotium work. used to, fails error:
running tests test running startedfinish empty test suite.
my test draft:
public class mainactivitytest extends activityinstrumentationtestcase2 <mainactivity> { private solo solo; public mainactivitytest() { super(mainactivity.class); } @override protected void setup() throws exception { super.setup(); solo = new solo(getinstrumentation(), getactivity()); } @override protected void teardown() throws exception { super.teardown(); solo.finishopenedactivities(); } @override protected void runtest() throws throwable { super.runtest(); } }
build.gradle
defaultconfig { applicationid "my.app" testinstrumentationrunner "android.test.instrumentationtestrunner" } androidmanifest.xml
<instrumentation android:name="android.test.instrumentationtestrunner" android:targetpackage="my.app"/> in edit configurations instrumentation runner have android.test.instrumentationtestrunner. where's problem?
which have figured out empty test , started test finished test run test unable call test method, have prefix mainactivity class method test mainactivity method. e.g
class mainactivity extends activity{ //class public void calculatesomething(){} } class mainactivitytest extends activityinstrumentationtestcase2 <mainactivity>{ //class b - test class in case mainactivitytest @testcalculate public void testcalculatesomething(){ //do testing here } } dont forgot sequence of calling main activity functions same here in testclass.
for more info please check why android test runner reporting "empty test suite"?
Comments
Post a Comment