You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iceraven-browser/app/src/androidTest/java/org/mozilla/fenix/ui/robots/PwaRobot.kt

29 lines
1.1 KiB
Kotlin

/* 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.ui.robots
import androidx.test.uiautomator.UiSelector
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.mozilla.fenix.helpers.TestHelper.isExternalAppBrowserActivityInCurrentTask
import org.mozilla.fenix.helpers.TestHelper.mDevice
import org.mozilla.fenix.helpers.TestHelper.packageName
class PwaRobot {
fun verifyCustomTabToolbarIsNotDisplayed() = assertFalse(customTabToolbar().exists())
fun verifyPwaActivityInCurrentTask() = assertTrue(isExternalAppBrowserActivityInCurrentTask())
class Transition
}
fun pwaScreen(interact: PwaRobot.() -> Unit): PwaRobot.Transition {
mDevice.findObject(UiSelector().resourceId("$packageName:id/engineView"))
PwaRobot().interact()
return PwaRobot.Transition()
}
private fun customTabToolbar() = mDevice.findObject(UiSelector().resourceId("$packageName:id/toolbar"))