Co-authored-by: AndiAJ <andiaj@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
ddd472d143
commit
d30583e0e7
|
@ -227,16 +227,18 @@ class HistoryTest {
|
|||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(firstWebPage.url) {
|
||||
}.openTabDrawer {
|
||||
}.openNewTab {
|
||||
}.submitQuery(secondWebPage.url.toString()) {
|
||||
}.openNavigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(secondWebPage.url) {
|
||||
mDevice.waitForIdle()
|
||||
verifyUrl(secondWebPage.url.toString())
|
||||
}.openThreeDotMenu {
|
||||
}.openHistory {
|
||||
verifyHistoryListExists()
|
||||
historyListIdlingResource =
|
||||
RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.history_list), 2)
|
||||
IdlingRegistry.getInstance().register(historyListIdlingResource!!)
|
||||
verifyHistoryItemExists(firstWebPage.url.toString())
|
||||
verifyHistoryItemExists(secondWebPage.url.toString())
|
||||
longTapSelectItem(firstWebPage.url)
|
||||
longTapSelectItem(secondWebPage.url)
|
||||
openActionBarOverflowOrOptionsMenu(activityTestRule.activity)
|
||||
|
|
|
@ -19,8 +19,10 @@ import androidx.test.uiautomator.UiSelector
|
|||
import androidx.test.uiautomator.Until
|
||||
import org.hamcrest.Matchers
|
||||
import org.hamcrest.Matchers.allOf
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
|
||||
import org.mozilla.fenix.helpers.TestHelper.waitForObjects
|
||||
import org.mozilla.fenix.helpers.click
|
||||
import org.mozilla.fenix.helpers.ext.waitNotNull
|
||||
|
||||
|
@ -51,6 +53,8 @@ class HistoryRobot {
|
|||
assertVisitedTimeTitle()
|
||||
}
|
||||
|
||||
fun verifyHistoryItemExists(url: String) = assertHistoryItemExists(url)
|
||||
|
||||
fun verifyFirstTestPageTitle(title: String) = assertTestPageTitle(title)
|
||||
|
||||
fun verifyTestPageUrl(expectedUrl: Uri) = assertPageUrl(expectedUrl)
|
||||
|
@ -120,6 +124,11 @@ private fun assertEmptyHistoryView() =
|
|||
private fun assertHistoryListExists() =
|
||||
mDevice.findObject(UiSelector().resourceId("R.id.history_list")).waitForExists(waitingTime)
|
||||
|
||||
private fun assertHistoryItemExists(url: String) {
|
||||
mDevice.waitForObjects(mDevice.findObject(UiSelector().textContains(url)))
|
||||
assertTrue(mDevice.findObject(UiSelector().textContains(url)).waitForExists(waitingTime))
|
||||
}
|
||||
|
||||
private fun assertVisitedTimeTitle() =
|
||||
onView(withId(R.id.header_title)).check(matches(withText("Today")))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user