Skip to content

Commit

Permalink
feat: added @FlakyTest annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Apr 24, 2024
1 parent ca7c7ba commit 4d21841
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -109,6 +110,7 @@ class FileDetailsFragmentTest {
}

@Test
@FlakyTest
fun show_space_not_personal_when_it_has_value() {
every { fileDetailsViewModel.currentFile } returns currentFileWithoutPersonalSpace

Expand All @@ -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)
Expand All @@ -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!!))
Expand Down

0 comments on commit 4d21841

Please sign in to comment.