Skip to content

Commit

Permalink
Test orchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
LachlanMcKee committed Sep 2, 2023
1 parent db79e72 commit 3284197
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ androidx-test-espresso-core = "androidx.test.espresso:espresso-core:3.5.1"
androidx-test-junit = "androidx.test.ext:junit:1.1.3"
androidx-test-rules = "androidx.test:rules:1.5.0"
androidx-test-core = "androidx.test:core:1.5.0"
androidx-test-runner = "androidx.test:runner:1.5.2"
androidx-test-orchestrator = "androidx.test:orchestrator:1.4.2"
androidx-test-utils = "androidx.test.services:test-services:1.4.2"
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ internal inline fun <

dependencies.add("testImplementation", libs.findLibrary("junit-api").get())
dependencies.add("testRuntimeOnly", libs.findLibrary("junit-engine").get())
dependencies.add("androidTestImplementation", libs.findLibrary("androidx-test-runner").get())
dependencies.add("androidTestUtil", libs.findLibrary("androidx-test-orchestrator").get())

extensions
.getByType<ComponentsExtensionT>()
Expand Down Expand Up @@ -62,6 +64,7 @@ private fun <DefaultConfigT : DefaultConfig> CommonExtension<*, *, DefaultConfig
useSupportLibrary = true
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["clearPackageData"] = "true"
testInstrumentationRunnerArguments["useTestStorageService"] = "true"
}

Expand All @@ -80,6 +83,7 @@ private fun <DefaultConfigT : DefaultConfig> CommonExtension<*, *, DefaultConfig
unitTests.all {
it.useJUnitPlatform()
}
execution = "ANDROIDX_TEST_ORCHESTRATOR"
managedDevices.devices.register<ManagedVirtualDevice>("uiTestsDevice") {
device = "Pixel"
@Suppress("MagicNumber")
Expand Down

0 comments on commit 3284197

Please sign in to comment.