Skip to content

Commit

Permalink
For mozilla-mobile#27522 new undo delete search engine UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiAJ committed Oct 27, 2022
1 parent 2f34e8f commit 81e08dc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,19 @@ class SettingsSearchTest {
verifyVoiceSearchButtonVisibility(false)
}
}

// Expected for en-us defaults
@Test
fun undoDeleteSearchEngineTest() {
homeScreen {
}.openThreeDotMenu {
}.openSettings {
}.openSearchSubMenu {
verifyEngineListContains("Bing")
openEngineOverflowMenu("Bing")
clickDeleteSearchEngine()
clickUndoSnackBarButton()
verifyEngineListContains("Bing")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.hamcrest.Matchers.allOf
import org.junit.Assert.assertTrue
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestHelper.getStringResource
import org.mozilla.fenix.helpers.TestHelper.mDevice
import org.mozilla.fenix.helpers.TestHelper.packageName
import org.mozilla.fenix.helpers.click
Expand Down Expand Up @@ -162,6 +163,17 @@ class SettingsSubMenuSearchRobot {

fun clickEdit() = onView(withText("Edit")).click()

fun clickDeleteSearchEngine() =
mDevice.findObject(
UiSelector().textContains(getStringResource(R.string.search_engine_delete)),
).click()

fun clickUndoSnackBarButton() =
mDevice.findObject(
UiSelector()
.resourceId("$packageName:id/snackbar_btn"),
).click()

fun saveEditSearchEngine() {
onView(withId(R.id.save_button)).click()
assertTrue(
Expand Down

0 comments on commit 81e08dc

Please sign in to comment.