How to use Robotium with Android Studio? -
robotium android test automation framework has full support native , hybrid applications.
now android studio de facto ide android development, i'm interested try android studio. however, couldn't find way set up.
how setup , use robotium test android studio?
guide:
add following line dependencies section of inner build.gradle file (this file located @ same level src folder), change version name if required:
androidtestcompile 'com.jayway.android.robotium:robotium-solo:5.2.1'
if reason don't want let gradle download dependencies can add them manually: place robotium.jar libs folder. right click , select add library...
in src folder create folder androidtest
- inside create java folder
- (optional step, see below) inside create package test source same name app’s package name (or add ".tests" end.)
- place cursor (in editor window) @ class name inside 1 of files want test (e.g. mainactivity) , press alt+enter.
select create test. select proper superclass robotium:
android.test.activityinstrumentationtestcase2
- android studio create test file , package (if wasn’t created in step 6)
how run test:
- ui: usual using android studio run menu
console: in terminal enter following command:
./gradlew connectedandroidtest
the html-reports generated @ "yourapp/yourapp/build/outputs/reports/androidtests/ connected/index.html"
Comments
Post a Comment