/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.fenix.helpers import android.net.Uri import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.longClick import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.uiautomator.UiScrollable import androidx.test.uiautomator.UiSelector object TestHelper { fun scrollToElementByText(text: String): UiScrollable { val appView = UiScrollable(UiSelector().scrollable(true)) appView.scrollTextIntoView(text) return appView } fun longTapSelectItem(url: Uri) { onView(withText(url.toString())).perform(longClick()) } }