Espresso : Running test from command line

2,289 views
Skip to first unread message

SK

unread,
Jul 8, 2016, 9:02:09 PM7/8/16
to Android Testing Support Library
I have a  bunch of test classes in a package,How do i run just one test class at a time from the command prompt?

I am trying to implement it on Jenkins and want a separate job for each test class.

Thanks,
SK

Nick Korostelev

unread,
Jul 11, 2016, 11:02:24 AM7/11/16
to Android Testing Support Library

Running a single test: adb shell am instrument -w -e class com.android.foo.FooTest#testFoo

Riccardo Ciovati

unread,
Jul 12, 2016, 4:42:22 AM7/12/16
to Android Testing Support Library


Il giorno sabato 9 luglio 2016 03:02:09 UTC+2, SK ha scritto:
How do i run just one test class at a time from the command prompt?

With gradle:

./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.yourpackage.TestClass

Mel

unread,
May 16, 2018, 3:38:42 PM5/16/18
to Android Testing Support Library
Hello,

I am trying to include the "clearPackageData=true" on the gradlew command below:

./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.clearPackageData=true -Pandroid.testInstrumentationRunnerArguments.class=com.yourpackage.TestClass

Should that work? Because it doesn't seem to be working for me.

Thanks.
Reply all
Reply to author
Forward
0 new messages