Skip to content

STFAndroidTestClient is a Gradle plugin. Run Android instrumental test using STF

License

Notifications You must be signed in to change notification settings

ttymsd/stf-android-test-client

Repository files navigation

STFAndroidTestClient

STFAndroidTestClient is a Gradle plugin. Run Android instrumental test using STF and screen record.

Getting Started

Installing

add dependencies

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.bonborunote:stf-android-test-client:${latestVersion}"
  }
}

apply plugin: "com.bonborunote.stf-android-test-client"

add config to module build.gradle

example

import com.bonborunote.TestTarget
import com.bonborunote.SwipePattern
import com.bonborunote.Point

stfConfig {
  stfHostUrl = "http://192.168.0.99:7100"
  stfAuthToken = "19abc84ed0a24ac5a59333b39eeeec78c3fdf8642a9a48eb98e76d4241a01ec4"
  testTargets = [new TestTarget(serial:"5b8bccac", name:"Nexus5", unlockPattern:new SwipePattern(start:new Point(400, 800), end:new Point(400, 200)))]
  testTimeoutMillis = 30000
  outputDir = new File(project.buildDir, "stf")
  testWithScreenRecord = true
}

  • stfHostUrl: Required Running STF Host url
  • stfAuthToken: Required STF Auth Token
  • testTargets: Required Run AndroidTest this devices.
  • testTimeoutMills: Optional default value is 600000 all tests finished in this duration.
  • outputDir: Optional default value is project root screen record file(mp4) output dir.
  • testWithScreenRecord: Optional default value is true test with screen record.

add below tasks by plugin

  • showStfDeviceList: Show devices info

  • connectedStf{ProductFlavor}AndroidTest: Run AndroidTest on configured devices.

  • assembleAndConnectedStf{ProductFlavor}AndroidTest: assemble apks and run AndroidTest on configured devices.

Authors

  • ttymsd

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

STFAndroidTestClient is a Gradle plugin. Run Android instrumental test using STF

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages