2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] Improve coverage for addPrivateBrowsingShortcut Ui test

This commit is contained in:
AndiAJ 2021-09-13 14:37:00 +03:00 committed by mergify[bot]
parent fc42d08c06
commit b1ee43a7ed
2 changed files with 16 additions and 0 deletions

View File

@ -364,6 +364,7 @@ class SettingsPrivacyTest {
}.openThreeDotMenu {
}.openSettings {
}.openPrivateBrowsingSubMenu {
cancelPrivateShortcutAddition()
addPrivateShortcutToHomescreen()
verifyPrivateBrowsingShortcutIcon()
}.openPrivateBrowsingShortcut {

View File

@ -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")),
@ -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() {