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:
parent
fc42d08c06
commit
b1ee43a7ed
@ -364,6 +364,7 @@ class SettingsPrivacyTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
}.openPrivateBrowsingSubMenu {
|
||||
cancelPrivateShortcutAddition()
|
||||
addPrivateShortcutToHomescreen()
|
||||
verifyPrivateBrowsingShortcutIcon()
|
||||
}.openPrivateBrowsingShortcut {
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user