Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #16615: UI smoke test startBrowsingButtonTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Oana Horvath committed Dec 7, 2020
1 parent 948db6f commit 370efe8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.mozilla.fenix.helpers.ViewVisibilityIdlingResource
import org.mozilla.fenix.ui.robots.clickUrlbar
import org.mozilla.fenix.ui.robots.homeScreen
import org.mozilla.fenix.ui.robots.navigationToolbar
import org.mozilla.fenix.ui.robots.searchScreen

/**
* Test Suite that contains tests defined as part of the Smoke and Sanity check defined in Test rail.
Expand Down Expand Up @@ -110,6 +111,16 @@ class SmokeTest {
}
}

@Test
fun startBrowsingButtonTest() {
homeScreen {
verifyStartBrowsingButton()
}.dismissOnboarding()
searchScreen {
verifySearchView()
}
}

@Test
fun verifyBasicNavigationToolbarFunctionality() {
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.widget.EditText
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.longClick
Expand Down Expand Up @@ -391,7 +392,7 @@ class HomeScreenRobot {
}

fun dismissOnboarding() {
openThreeDotMenu { }.openSettings { }.goBack { }
startBrowsingButton().click()
}

fun togglePrivateBrowsingMode() {
Expand Down Expand Up @@ -808,3 +809,8 @@ private fun tab(title: String) =
withText(title)
)
)

private fun startBrowsingButton(): ViewInteraction {
scrollToElementByText("Start browsing")
return onView(allOf(withText("Start browsing")))
}

0 comments on commit 370efe8

Please sign in to comment.