Skip to content

Commit

Permalink
feat: Ignored some tests due to flakies
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Apr 9, 2024
1 parent ad35faa commit 6d49ac0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
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 @@ -228,6 +229,7 @@ class LoginActivityTest {
}

@Test
@Ignore("Flaky test")
fun initialViewStatus_brandedOptions_serverInfoInSetup_connectionFails() {

launchTest(showServerUrlInput = false, serverUrl = OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl)
Expand Down Expand Up @@ -522,6 +524,7 @@ class LoginActivityTest {
}

@Test
@Ignore("Flaky test")
fun login_isLoading() {
launchTest()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* ownCloud Android client application
*
* @author Abel García de Prada
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2020 ownCloud GmbH.
* Copyright (C) 2024 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -38,6 +39,7 @@ import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import org.junit.Before
import org.junit.Ignore
import org.junit.Test

class SortBottomSheetFragmentTest {
Expand Down Expand Up @@ -78,12 +80,14 @@ class SortBottomSheetFragmentTest {
}

@Test
@Ignore("Flaky test")
fun test_sort_by_name_click() {
onView(withId(R.id.sort_by_name)).inRoot(RootMatchers.isDialog()).perform(ViewActions.click())
verify { fragmentListener.onSortSelected(SortType.SORT_TYPE_BY_NAME) }
}

@Test
@Ignore("Flaky test")
fun test_sort_by_date_click() {
onView(withId(R.id.sort_by_date)).inRoot(RootMatchers.isDialog()).perform(ViewActions.click())
verify { fragmentListener.onSortSelected(SortType.SORT_TYPE_BY_DATE) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/**
* ownCloud Android client application
*
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.owncloud.android.files.details

import android.content.Context
Expand All @@ -15,10 +35,10 @@ import com.owncloud.android.presentation.files.operations.FileOperationsViewMode
import com.owncloud.android.sharing.shares.ui.TestShareFileActivity
import com.owncloud.android.testutil.OC_ACCOUNT
import com.owncloud.android.testutil.OC_FILE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AVAILABLE_OFFLINE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AND_SPACE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AND_WITHOUT_PERSONAL_SPACE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AVAILABLE_OFFLINE
import com.owncloud.android.utils.DisplayUtils
import com.owncloud.android.utils.matchers.assertVisibility
import com.owncloud.android.utils.matchers.isDisplayed
Expand All @@ -28,6 +48,7 @@ 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 @@ -140,6 +161,7 @@ class FileDetailsFragmentTest {
}

@Test
@Ignore("Flaky test")
fun verifyTests() {
R.id.fdCreatedLabel.withText(R.string.filedetails_created)
R.id.fdCreated.withText(DisplayUtils.unixTimeToHumanReadable(currentFile.value?.file?.creationTimestamp!!))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* ownCloud Android client application
*
* @author Juan Carlos Garrote Gascón
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2021 ownCloud GmbH.
* Copyright (C) 2024 ownCloud GmbH.
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -36,11 +37,11 @@ import androidx.test.platform.app.InstrumentationRegistry
import com.owncloud.android.BuildConfig
import com.owncloud.android.R
import com.owncloud.android.presentation.releasenotes.ReleaseNotesActivity
import com.owncloud.android.presentation.settings.privacypolicy.PrivacyPolicyActivity
import com.owncloud.android.presentation.settings.SettingsFragment
import com.owncloud.android.presentation.releasenotes.ReleaseNotesViewModel
import com.owncloud.android.presentation.settings.more.SettingsMoreViewModel
import com.owncloud.android.presentation.settings.SettingsFragment
import com.owncloud.android.presentation.settings.SettingsViewModel
import com.owncloud.android.presentation.settings.more.SettingsMoreViewModel
import com.owncloud.android.presentation.settings.privacypolicy.PrivacyPolicyActivity
import com.owncloud.android.utils.matchers.verifyPreference
import com.owncloud.android.utils.releaseNotesList
import io.mockk.every
Expand Down Expand Up @@ -259,6 +260,7 @@ class SettingsFragmentTest {
}

@Test
@Ignore("Flaky test")
fun privacyPolicyOpensPrivacyPolicyActivity() {
launchTest(attachedAccount = false)

Expand Down

0 comments on commit 6d49ac0

Please sign in to comment.