@ -7,8 +7,6 @@
package org.mozilla.fenix.ui.robots
package org.mozilla.fenix.ui.robots
import android.content.Context
import android.content.Context
import android.view.InputDevice
import android.view.MotionEvent
import android.view.View
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import androidx.test.core.app.ApplicationProvider
import androidx.test.core.app.ApplicationProvider
@ -17,12 +15,8 @@ import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.UiController
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.GeneralClickAction
import androidx.test.espresso.action.GeneralLocation
import androidx.test.espresso.action.GeneralLocation
import androidx.test.espresso.action.Press
import androidx.test.espresso.action.Tap
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.actionWithAssertions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.replaceText
import androidx.test.espresso.action.ViewActions.replaceText
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
@ -51,6 +45,7 @@ import org.mozilla.fenix.helpers.TestAssetHelper
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestHelper.packageName
import org.mozilla.fenix.helpers.TestHelper.packageName
import org.mozilla.fenix.helpers.click
import org.mozilla.fenix.helpers.click
import org.mozilla.fenix.helpers.clickAtLocationInView
import org.mozilla.fenix.helpers.ext.waitNotNull
import org.mozilla.fenix.helpers.ext.waitNotNull
import org.mozilla.fenix.helpers.idlingresource.BottomSheetBehaviorStateIdlingResource
import org.mozilla.fenix.helpers.idlingresource.BottomSheetBehaviorStateIdlingResource
import org.mozilla.fenix.helpers.matchers.BottomSheetBehaviorHalfExpandedMaxRatioMatcher
import org.mozilla.fenix.helpers.matchers.BottomSheetBehaviorHalfExpandedMaxRatioMatcher
@ -264,17 +259,7 @@ class TabDrawerRobot {
fun clickTopBar ( interact : TabDrawerRobot . ( ) -> Unit ) : Transition {
fun clickTopBar ( interact : TabDrawerRobot . ( ) -> Unit ) : Transition {
// The topBar contains other views.
// The topBar contains other views.
// Don't do the default click in the middle, rather click in some free space - top right.
// Don't do the default click in the middle, rather click in some free space - top right.
onView ( withId ( R . id . topBar ) ) . perform (
onView ( withId ( R . id . topBar ) ) . clickAtLocationInView ( GeneralLocation . TOP _RIGHT )
actionWithAssertions (
GeneralClickAction (
Tap . SINGLE ,
GeneralLocation . TOP _RIGHT ,
Press . FINGER ,
InputDevice . SOURCE _UNKNOWN ,
MotionEvent . BUTTON _PRIMARY
)
)
)
TabDrawerRobot ( ) . interact ( )
TabDrawerRobot ( ) . interact ( )
return Transition ( )
return Transition ( )
}
}