For #16615: UI smoke test startBrowsingButtonTest

upstream-sync
Oana Horvath 4 years ago
parent 5cc66f532f
commit 5e046c8f04

@ -110,6 +110,15 @@ class SmokeTest {
}
}
@Test
fun startBrowsingButtonTest() {
homeScreen {
verifyStartBrowsingButton()
}.clickStartBrowsingButton {
verifySearchView()
}
}
@Test
fun verifyBasicNavigationToolbarFunctionality() {
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)

@ -11,6 +11,7 @@ import android.widget.EditText
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.longClick
@ -394,6 +395,14 @@ class HomeScreenRobot {
openThreeDotMenu { }.openSettings { }.goBack { }
}
fun clickStartBrowsingButton(interact: SearchRobot.() -> Unit): SearchRobot.Transition {
scrollToElementByText("Start browsing")
startBrowsingButton().click()
SearchRobot().interact()
return SearchRobot.Transition()
}
fun togglePrivateBrowsingMode() {
onView(ViewMatchers.withResourceName("privateBrowsingButton"))
.perform(click())
@ -808,3 +817,8 @@ private fun tab(title: String) =
withText(title)
)
)
private fun startBrowsingButton(): ViewInteraction {
scrollToElementByText("Start browsing")
return onView(allOf(withText("Start browsing")))
}

Loading…
Cancel
Save