Skip to content

Commit d0ba126

Browse files
committed
skipping replay in test when running on gh
1 parent b5eb64d commit d0ba126

File tree

1 file changed

+7
-6
lines changed
  • sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android

1 file changed

+7
-6
lines changed

sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/UserFeedbackUiTest.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,17 @@ class UserFeedbackUiTest : BaseUiTest() {
473473

474474
@Test
475475
fun userFeedbackSendEnvelope() {
476+
// GH actions emulator don't allow capturing screenshots properly
477+
val enableReplay = BuildConfig.ENVIRONMENT != "github"
476478
initSentry(true) {
477479
// When sending the feedback we want to wait for relay to receive it.
478480
// We can't simply increment the idling resource,
479481
// because it would block the espresso interactions (button click)
480-
it.feedbackOptions.onSubmitSuccess = SentryFeedbackCallback { relayIdlingResource.increment(); relayIdlingResource.increment() }
482+
it.feedbackOptions.onSubmitSuccess = SentryFeedbackCallback { relayIdlingResource.increment() }
481483
// Let's capture a replay, so we can check the replayId in the feedback
482-
483-
// GH actions emulator don't allow capturing screenshots properly
484-
it.sessionReplay.sessionSampleRate = if (BuildConfig.ENVIRONMENT != "github") 1.0 else 0.0
484+
if (enableReplay) {
485+
it.sessionReplay.sessionSampleRate = 1.0
486+
}
485487
}
486488

487489
showDialogAndCheck {
@@ -506,8 +508,7 @@ class UserFeedbackUiTest : BaseUiTest() {
506508
// The screen name should be set in the url
507509
assertEquals("io.sentry.uitest.android.EmptyActivity", feedback.url)
508510

509-
// GH actions emulator don't allow capturing screenshots properly
510-
if (BuildConfig.ENVIRONMENT != "github") {
511+
if (enableReplay) {
511512
// The current replay should be set in the replayId
512513
assertNotNull(feedback.replayId)
513514
assertEquals(Sentry.getCurrentScopes().options.replayController.replayId, feedback.replayId)

0 commit comments

Comments
 (0)