mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/21133 fix openMainMenuSyncItemTest UI test
This commit is contained in:
parent
3f12d01de6
commit
aa63facce4
@ -274,9 +274,10 @@ class SmokeTest {
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
|
||||
mDevice.waitForIdle()
|
||||
}.openThreeDotMenu {
|
||||
}.openSyncSignIn {
|
||||
verifySyncSignInMenuHeader()
|
||||
verifyTurnOnSyncMenu()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,14 +6,18 @@ package org.mozilla.fenix.ui.robots
|
||||
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.UiSelector
|
||||
import org.hamcrest.CoreMatchers.allOf
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
|
||||
import org.mozilla.fenix.helpers.TestHelper.packageName
|
||||
import org.mozilla.fenix.helpers.click
|
||||
|
||||
/**
|
||||
@ -22,7 +26,7 @@ import org.mozilla.fenix.helpers.click
|
||||
class SyncSignInRobot {
|
||||
|
||||
fun verifyAccountSettingsMenuHeader() = assertAccountSettingsMenuHeader()
|
||||
fun verifySyncSignInMenuHeader() = assertSyncSignInMenuHeader()
|
||||
fun verifyTurnOnSyncMenu() = assertTurnOnSyncMenu()
|
||||
|
||||
class Transition {
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())!!
|
||||
@ -46,7 +50,13 @@ private fun assertAccountSettingsMenuHeader() {
|
||||
.check((matches(withEffectiveVisibility(Visibility.VISIBLE))))
|
||||
}
|
||||
|
||||
private fun assertSyncSignInMenuHeader() {
|
||||
onView(withText(R.string.sign_in_with_camera))
|
||||
.check((matches(withEffectiveVisibility(Visibility.VISIBLE))))
|
||||
private fun assertTurnOnSyncMenu() {
|
||||
mDevice.findObject(UiSelector().resourceId("$packageName:id/container")).waitForExists(waitingTime)
|
||||
assertTrue(
|
||||
mDevice.findObject(
|
||||
UiSelector()
|
||||
.resourceId("$packageName:id/signInScanButton")
|
||||
.resourceId("$packageName:id/signInEmailButton")
|
||||
).waitForExists(waitingTime)
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user