Skip to content

Commit

Permalink
Exit onboarding tour UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiAJ authored and pkirakosyan committed Sep 24, 2021
1 parent fb2b8cc commit 3f4113b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 4 deletions.
59 changes: 55 additions & 4 deletions app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

package org.mozilla.fenix.ui

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.helpers.HomeActivityTestRule
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
import androidx.test.uiautomator.Until
import org.mozilla.fenix.helpers.ext.waitNotNull
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.ext.waitNotNull
import org.mozilla.fenix.ui.robots.homeScreen

/**
Expand Down Expand Up @@ -88,4 +88,55 @@ class HomeScreenTest {
verifyHomeComponent()
}
}

@Test
fun dismissOnboardingUsingSettingsTest() {
homeScreen {
verifyWelcomeHeader()
}.openThreeDotMenu {
}.openSettings {
verifyBasicsHeading()
}.goBack {
verifyExistingTopSitesList()
}
}

@Test
fun dismissOnboardingUsingBookmarksTest() {
homeScreen {
verifyWelcomeHeader()
}.openThreeDotMenu {
}.openBookmarks {
verifyBookmarksMenuView()
navigateUp()
}
homeScreen {
verifyExistingTopSitesList()
}
}

@Test
fun dismissOnboardingUsingHelpTest() {
homeScreen {
verifyWelcomeHeader()
}.openThreeDotMenu {
}.openHelp {
verifyHelpUrl()
}.goBack {
verifyExistingTopSitesList()
}
}

@Test
fun toolbarTapDoesntDismissOnboardingTest() {
homeScreen {
verifyWelcomeHeader()
}.openSearch {
verifyScanButton()
verifySearchEngineButton()
verifyKeyboardVisibility()
}.dismissSearchBar {
verifyWelcomeHeader()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,13 @@ class BrowserRobot {
return HomeScreenRobot.Transition()
}

fun goBack(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
mDevice.pressBack()

HomeScreenRobot().interact()
return HomeScreenRobot.Transition()
}

fun clickTabCrashedCloseButton(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {

assertTrue(
Expand Down

0 comments on commit 3f4113b

Please sign in to comment.