From 4d2184124d1c7bbbdf7ba29d25d3c3dcf780d520 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Wed, 24 Apr 2024 14:44:40 +0100 Subject: [PATCH] feat: added @FlakyTest annotation --- .../android/files/details/FileDetailsFragmentTest.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/owncloudApp/src/androidTest/java/com/owncloud/android/files/details/FileDetailsFragmentTest.kt b/owncloudApp/src/androidTest/java/com/owncloud/android/files/details/FileDetailsFragmentTest.kt index 03d1816b732f..242b516485e5 100644 --- a/owncloudApp/src/androidTest/java/com/owncloud/android/files/details/FileDetailsFragmentTest.kt +++ b/owncloudApp/src/androidTest/java/com/owncloud/android/files/details/FileDetailsFragmentTest.kt @@ -7,6 +7,7 @@ import androidx.test.espresso.Espresso.onView import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.filters.FlakyTest import com.owncloud.android.R import com.owncloud.android.domain.files.model.OCFileWithSyncInfo import com.owncloud.android.presentation.files.details.FileDetailsFragment @@ -28,7 +29,6 @@ import io.mockk.every import io.mockk.mockk import kotlinx.coroutines.flow.MutableStateFlow import org.junit.Before -import org.junit.Ignore import org.junit.Test import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.core.context.startKoin @@ -88,6 +88,7 @@ class FileDetailsFragmentTest { } @Test + @FlakyTest fun show_space_personal_when_it_has_value() { R.id.fdSpace.assertVisibility(ViewMatchers.Visibility.VISIBLE) R.id.fdSpaceLabel.assertVisibility(ViewMatchers.Visibility.VISIBLE) @@ -109,6 +110,7 @@ class FileDetailsFragmentTest { } @Test + @FlakyTest fun show_space_not_personal_when_it_has_value() { every { fileDetailsViewModel.currentFile } returns currentFileWithoutPersonalSpace @@ -123,6 +125,7 @@ class FileDetailsFragmentTest { } @Test + @FlakyTest fun show_last_sync_when_it_has_value() { currentFile.value?.file?.lastSyncDateForData = 1212121212212 R.id.fdLastSync.assertVisibility(ViewMatchers.Visibility.VISIBLE) @@ -141,7 +144,7 @@ class FileDetailsFragmentTest { } @Test - @Ignore("Flaky test") + @FlakyTest fun verifyTests() { R.id.fdCreatedLabel.withText(R.string.filedetails_created) R.id.fdCreated.withText(DisplayUtils.unixTimeToHumanReadable(currentFile.value?.file?.creationTimestamp!!))