File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
sentry-android-integration-tests/sentry-uitest-android
src/androidTest/java/io/sentry/uitest/android Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,8 @@ object Config {
201201 val javaFaker = " com.github.javafaker:javafaker:1.0.2"
202202 val msgpack = " org.msgpack:msgpack-core:0.9.8"
203203 val leakCanaryInstrumentation = " com.squareup.leakcanary:leakcanary-android-instrumentation:2.14"
204+ val composeUiTestJunit4 = " androidx.compose.ui:ui-test-junit4:$composeVersion "
205+ val composeUiTestManifest = " androidx.compose.ui:ui-test-manifest:$composeVersion "
204206 }
205207
206208 object QualityPlugins {
Original file line number Diff line number Diff line change @@ -112,6 +112,9 @@ dependencies {
112112 implementation(Config .TestLibs .espressoIdlingResource)
113113 implementation(Config .Libs .leakCanary)
114114
115+ androidTestImplementation(Config .TestLibs .composeUiTestJunit4)
116+ debugImplementation(Config .TestLibs .composeUiTestManifest)
117+
115118 compileOnly(Config .CompileOnly .nopen)
116119 errorprone(Config .CompileOnly .nopenChecker)
117120 errorprone(Config .CompileOnly .errorprone)
Original file line number Diff line number Diff line change 1+ package io.sentry.uitest.android
2+
3+ import androidx.compose.foundation.layout.Box
4+ import androidx.compose.ui.Modifier
5+ import androidx.compose.ui.test.SemanticsMatcher
6+ import androidx.compose.ui.test.junit4.createComposeRule
7+ import androidx.test.ext.junit.runners.AndroidJUnit4
8+ import io.sentry.compose.SentryModifier
9+ import io.sentry.compose.SentryModifier.sentryTag
10+ import org.junit.Rule
11+ import org.junit.Test
12+ import org.junit.runner.RunWith
13+
14+ @RunWith(AndroidJUnit4 ::class )
15+ class SentryModifierComposeTest : BaseUiTest () {
16+
17+ companion object {
18+ private const val TAG_VALUE = " ExampleTagValue"
19+ }
20+
21+ @get:Rule
22+ val rule = createComposeRule()
23+
24+ @Test
25+ fun sentryModifierAppliesTag () {
26+ rule.setContent {
27+ Box (modifier = Modifier .sentryTag(TAG_VALUE ))
28+ }
29+ rule.onNode(
30+ SemanticsMatcher (TAG_VALUE ) {
31+ it.config.find { (key, _) -> key.name == SentryModifier .TAG }?.value == TAG_VALUE
32+ }
33+ ).assertExists()
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments