@ -18,6 +18,7 @@ import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
import org.hamcrest.Matchers.allOf
import org.junit.Assert.assertNotNull
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.click
@ -38,7 +39,7 @@ class ThreeDotMenuMainRobot {
fun verifyShareButton ( ) = assertShareButton ( )
fun clickShareButton ( ) {
shareButton ( ) . click ( )
mDevice. wait ( Until . findObject ( By . text ( " SHARE A LINK " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " SHARE A LINK " ) ) , waitingTime ) )
}
fun verifyShareTabButton ( ) = assertShareTabButton ( )
@ -54,7 +55,7 @@ class ThreeDotMenuMainRobot {
private val mDevice = UiDevice . getInstance ( InstrumentationRegistry . getInstrumentation ( ) )
fun openSettings ( interact : SettingsRobot . ( ) -> Unit ) : SettingsRobot . Transition {
mDevice. wait ( Until . findObject ( By . text ( " R.string.s ettings" ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " S ettings" ) ) , waitingTime ) )
settingsButton ( ) . click ( )
SettingsRobot ( ) . interact ( )
@ -62,7 +63,7 @@ class ThreeDotMenuMainRobot {
}
fun openLibrary ( interact : LibraryRobot . ( ) -> Unit ) : LibraryRobot . Transition {
mDevice. wait ( Until . findObject ( By . text ( " R.string. Library" ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " Your Library" ) ) , waitingTime ) )
libraryButton ( ) . click ( )
LibraryRobot ( ) . interact ( )
@ -70,7 +71,7 @@ class ThreeDotMenuMainRobot {
}
fun openHelp ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice. wait ( Until . findObject ( By . text ( " Help " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " Help " ) ) , waitingTime ) )
helpButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
@ -78,7 +79,7 @@ class ThreeDotMenuMainRobot {
}
fun goForward ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice. wait ( Until . findObject ( By . desc ( " Forward " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . desc ( " Forward " ) ) , waitingTime ) )
forwardButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
@ -86,7 +87,7 @@ class ThreeDotMenuMainRobot {
}
fun goBack ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice. wait ( Until . findObject ( By . desc ( " Back " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . desc ( " Back " ) ) , waitingTime ) )
backButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
@ -94,7 +95,7 @@ class ThreeDotMenuMainRobot {
}
fun refreshPage ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice. wait ( Until . findObject ( By . desc ( " Refresh " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . desc ( " Refresh " ) ) , waitingTime ) )
refreshButton ( ) . click ( )
BrowserRobot ( ) . interact ( )
@ -102,7 +103,7 @@ class ThreeDotMenuMainRobot {
}
fun closeAllTabs ( interact : HomeScreenRobot . ( ) -> Unit ) : HomeScreenRobot . Transition {
mDevice. wait ( Until . findObject ( By . text ( " Close all tabs " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " Close all tabs " ) ) , waitingTime ) )
closeAllTabsButton ( ) . click ( )
HomeScreenRobot ( ) . interact ( )
@ -110,7 +111,7 @@ class ThreeDotMenuMainRobot {
}
fun openFindInPage ( interact : FindInPageRobot . ( ) -> Unit ) : FindInPageRobot . Transition {
mDevice. wait ( Until . findObject ( By . text ( " Find in page " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " Find in page " ) ) , waitingTime ) )
findInPageButton ( ) . click ( )
FindInPageRobot ( ) . interact ( )
@ -118,7 +119,7 @@ class ThreeDotMenuMainRobot {
}
fun openWhatsNew ( interact : BrowserRobot . ( ) -> Unit ) : BrowserRobot . Transition {
mDevice. wait ( Until . findObject ( By . text ( " What's New " ) ) , waitingTime )
assertNotNull( mDevice. wait ( Until . findObject ( By . text ( " What's New " ) ) , waitingTime ) )
whatsNewButton ( ) . click ( )
BrowserRobot ( ) . interact ( )