|
|
@ -15,14 +15,15 @@ import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withParent
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withParent
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
|
|
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
|
|
|
|
|
|
|
import androidx.test.rule.ActivityTestRule
|
|
|
|
import androidx.test.uiautomator.By
|
|
|
|
import androidx.test.uiautomator.By
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
import org.hamcrest.CoreMatchers.allOf
|
|
|
|
import org.hamcrest.CoreMatchers.allOf
|
|
|
|
import org.hamcrest.CoreMatchers.containsString
|
|
|
|
import org.hamcrest.CoreMatchers.containsString
|
|
|
|
import org.hamcrest.CoreMatchers.instanceOf
|
|
|
|
import org.hamcrest.CoreMatchers.instanceOf
|
|
|
|
import org.hamcrest.CoreMatchers.not
|
|
|
|
import org.hamcrest.CoreMatchers.not
|
|
|
|
|
|
|
|
import org.mozilla.fenix.HomeActivity
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
|
|
|
|
|
|
|
import org.mozilla.fenix.helpers.IdlingResourceHelper.registerAddonInstallingIdlingResource
|
|
|
|
import org.mozilla.fenix.helpers.IdlingResourceHelper.registerAddonInstallingIdlingResource
|
|
|
|
import org.mozilla.fenix.helpers.IdlingResourceHelper.unregisterAddonInstallingIdlingResource
|
|
|
|
import org.mozilla.fenix.helpers.IdlingResourceHelper.unregisterAddonInstallingIdlingResource
|
|
|
|
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
|
|
|
|
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
|
|
|
@ -38,7 +39,7 @@ import org.mozilla.fenix.helpers.ext.waitNotNull
|
|
|
|
class SettingsSubMenuAddonsManagerRobot {
|
|
|
|
class SettingsSubMenuAddonsManagerRobot {
|
|
|
|
fun verifyAddonPrompt(addonName: String) = assertAddonPrompt(addonName)
|
|
|
|
fun verifyAddonPrompt(addonName: String) = assertAddonPrompt(addonName)
|
|
|
|
fun clickInstallAddon(addonName: String) = selectInstallAddon(addonName)
|
|
|
|
fun clickInstallAddon(addonName: String) = selectInstallAddon(addonName)
|
|
|
|
fun verifyDownloadAddonPrompt(addonName: String, activityTestRule: HomeActivityTestRule) =
|
|
|
|
fun verifyDownloadAddonPrompt(addonName: String, activityTestRule: ActivityTestRule<HomeActivity>) =
|
|
|
|
assertDownloadingAddonPrompt(addonName, activityTestRule)
|
|
|
|
assertDownloadingAddonPrompt(addonName, activityTestRule)
|
|
|
|
|
|
|
|
|
|
|
|
fun cancelInstallAddon() = cancelInstall()
|
|
|
|
fun cancelInstallAddon() = cancelInstall()
|
|
|
@ -125,7 +126,7 @@ class SettingsSubMenuAddonsManagerRobot {
|
|
|
|
|
|
|
|
|
|
|
|
private fun assertDownloadingAddonPrompt(
|
|
|
|
private fun assertDownloadingAddonPrompt(
|
|
|
|
addonName: String,
|
|
|
|
addonName: String,
|
|
|
|
activityTestRule: HomeActivityTestRule
|
|
|
|
activityTestRule: ActivityTestRule<HomeActivity>
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
registerAddonInstallingIdlingResource(activityTestRule)
|
|
|
|
registerAddonInstallingIdlingResource(activityTestRule)
|
|
|
|
|
|
|
|
|
|
|
|