From 9887c26e2c6c4d7e41fe9b6deb72d8e7dd977341 Mon Sep 17 00:00:00 2001 From: "Xavier F. Gouchet" Date: Mon, 20 May 2024 16:01:49 +0200 Subject: [PATCH] Fix SR flaky test --- .../mapper/SeekBarWireframeMapperTest.kt | 154 +++++++++++++++++- .../mapper/AbstractWireframeMapperTest.kt | 3 +- 2 files changed, 152 insertions(+), 5 deletions(-) diff --git a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/mapper/SeekBarWireframeMapperTest.kt b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/mapper/SeekBarWireframeMapperTest.kt index 8db082d797..c480ac0200 100644 --- a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/mapper/SeekBarWireframeMapperTest.kt +++ b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/mapper/SeekBarWireframeMapperTest.kt @@ -3,6 +3,7 @@ package com.datadog.android.sessionreplay.internal.recorder.mapper import android.content.res.ColorStateList import android.graphics.Rect import android.graphics.drawable.Drawable +import android.os.Build import android.widget.SeekBar import com.datadog.android.sessionreplay.SessionReplayPrivacy import com.datadog.android.sessionreplay.forge.ForgeConfigurator @@ -12,6 +13,8 @@ import com.datadog.android.sessionreplay.model.MobileSegment import com.datadog.android.sessionreplay.recorder.mapper.AbstractWireframeMapperTest import com.datadog.android.sessionreplay.utils.OPAQUE_ALPHA_VALUE import com.datadog.android.sessionreplay.utils.PARTIALLY_OPAQUE_ALPHA_VALUE +import com.datadog.tools.unit.annotations.TestTargetApi +import com.datadog.tools.unit.extensions.ApiLevelExtension import fr.xgouchet.elmyr.annotation.FloatForgery import fr.xgouchet.elmyr.annotation.IntForgery import fr.xgouchet.elmyr.annotation.LongForgery @@ -35,7 +38,8 @@ import kotlin.math.max @Extensions( ExtendWith(MockitoExtension::class), - ExtendWith(ForgeExtension::class) + ExtendWith(ForgeExtension::class), + ExtendWith(ApiLevelExtension::class) ) @MockitoSettings(strictness = Strictness.LENIENT) @ForgeConfiguration(value = ForgeConfigurator::class) @@ -109,11 +113,146 @@ internal class SeekBarWireframeMapperTest : AbstractWireframeMapperTest