2
0
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:
AndiAJ 2021-09-10 12:12:27 +03:00 committed by mergify[bot]
parent 3f12d01de6
commit aa63facce4
2 changed files with 17 additions and 6 deletions

View File

@ -274,9 +274,10 @@ class SmokeTest {
navigationToolbar {
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
mDevice.waitForIdle()
}.openThreeDotMenu {
}.openSyncSignIn {
verifySyncSignInMenuHeader()
verifyTurnOnSyncMenu()
}
}

View File

@ -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)
)
}