How can I run a single instrumentation test with Gradle Android

后端 未结 4 1467
闹比i
闹比i 2020-12-28 13:06

I\'m trying to run the tests with this line... but this launches all tests:

./gradlew -DconnectedAndroidTest.single=LandingActivityTests connectedAndroidTest         


        
4条回答
  •  执念已碎
    2020-12-28 13:52

    if you want to run just one test inside the class do something like

    ./gradlew -Pandroid.testInstrumentationRunnerArguments.class=my.app.package.register.RegisterEmailTest#can_register connectedAndroidTest
    

    can_register is a method in a class RegisterEmailTest

    NOTE: the package needs to reference where the class is otherwise it will not work.

提交回复
热议问题