Skip to content

Commit

Permalink
Merge branch 'main' into performance/mozilla-mobile#20634-remove-unus…
Browse files Browse the repository at this point in the history
…ed-resources-part-1
  • Loading branch information
jonalmeida authored Sep 14, 2021
2 parents 74b1364 + d33df2b commit 95ee20f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ class SettingsPrivacyTest {
}.openThreeDotMenu {
}.openSettings {
}.openPrivateBrowsingSubMenu {
cancelPrivateShortcutAddition()
addPrivateShortcutToHomescreen()
verifyPrivateBrowsingShortcutIcon()
}.openPrivateBrowsingShortcut {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ class SettingsSubMenuPrivateBrowsingRobot {

fun clickOpenLinksInPrivateTabSwitch() = openLinksInPrivateTabSwitch().click()

fun cancelPrivateShortcutAddition() {
mDevice.wait(
Until.findObject(text("Add private browsing shortcut")),
waitingTime
)
addPrivateBrowsingShortcutButton().click()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mDevice.wait(Until.findObject(By.textContains("CANCEL")), waitingTime)
cancelShortcutAdditionButton().click()
}
}

fun addPrivateShortcutToHomescreen() {
mDevice.wait(
Until.findObject(text("Add private browsing shortcut")),
Expand Down Expand Up @@ -105,6 +117,9 @@ private fun goBackButton() = onView(withContentDescription("Navigate up"))
private fun addAutomaticallyButton() =
mDevice.findObject(UiSelector().textStartsWith("add automatically"))

private fun cancelShortcutAdditionButton() =
mDevice.findObject(UiSelector().textContains("CANCEL"))

private fun privateBrowsingShortcutIcon() = mDevice.findObject(text("Private $appName"))

private fun assertAddPrivateBrowsingShortcutButton() {
Expand Down

0 comments on commit 95ee20f

Please sign in to comment.