Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Razeeman committed Jan 2, 2024
1 parent 222e430 commit 899ddf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.example.util.simpletimetracker

import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.swipeUp
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA
Expand Down Expand Up @@ -87,7 +86,6 @@ class RecordAdjustTimeTest : BaseUiTest() {
clickOnViewWithText("+30")
clickOnViewWithText(coreR.string.change_record_actions_hint)
onView(withText(coreR.string.change_record_adjust)).perform(nestedScrollTo())
onView(withId(changeRecordR.id.containerChangeRecordAction)).perform(swipeUp())
clickOnViewWithText(coreR.string.change_record_adjust)

// Check records
Expand Down Expand Up @@ -174,7 +172,6 @@ class RecordAdjustTimeTest : BaseUiTest() {
clickOnRecyclerItem(changeRecordR.id.rvChangeRecordType, withText(name2))
clickOnViewWithText(coreR.string.change_record_actions_hint)
onView(withText(coreR.string.change_record_adjust)).perform(nestedScrollTo())
onView(withId(changeRecordR.id.containerChangeRecordAction)).perform(swipeUp())
clickOnViewWithText(coreR.string.change_record_adjust)

// Check records
Expand Down Expand Up @@ -239,7 +236,6 @@ class RecordAdjustTimeTest : BaseUiTest() {
clickOnViewWithText("-5")
clickOnViewWithText(coreR.string.change_record_actions_hint)
onView(withText(coreR.string.change_record_adjust)).perform(nestedScrollTo())
onView(withId(changeRecordR.id.containerChangeRecordAction)).perform(swipeUp())
clickOnViewWithText(coreR.string.change_record_adjust)

// Check records
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.example.util.simpletimetracker.feature_views.pieChart.PieChartView
import com.example.util.simpletimetracker.ui.MainActivity
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Before
import org.junit.Rule
Expand Down Expand Up @@ -92,6 +93,8 @@ open class BaseUiTest {
open fun setUp() {
if (!this::testUtils.isInitialized) hiltRule.inject()
clearData()
runBlocking { prefsInteractor.setShowUntrackedInRecords(true) }
runBlocking { prefsInteractor.setShowUntrackedInStatistics(true) }
disableAnimations()
registerIdlingResource()
}
Expand Down

0 comments on commit 899ddf9

Please sign in to comment.