Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Bug 1884904 - Add logs to SettingsSubMenuSetDefaultBrowserRobot
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiAJ authored and mergify[bot] committed Mar 12, 2024
1 parent 5d6c597 commit d0343ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ class SettingsSubMenuAboutRobot {
}

fun verifyProductCompany() {
Log.i(TAG, "verifyVersionNumber: Trying to verify that the about section contains the company that produced the app info: ${"$appName is produced by Mozilla."}")
Log.i(TAG, "verifyProductCompany: Trying to verify that the about section contains the company that produced the app info: ${"$appName is produced by Mozilla."}")
onView(withId(R.id.about_content))
.check(matches(withText(containsString("$appName is produced by Mozilla."))))
Log.i(TAG, "verifyVersionNumber: Verified that the about section contains the company that produced the app info: ${"$appName is produced by Mozilla."}")
Log.i(TAG, "verifyProductCompany: Verified that the about section contains the company that produced the app info: \"$appName is produced by Mozilla.\"")
}

fun verifyCurrentTimestamp() {
Log.i(TAG, "verifyVersionNumber: Trying to verify that the about section contains \"debug build\"")
Log.i(TAG, "verifyCurrentTimestamp: Trying to verify that the about section contains \"debug build\"")
onView(withId(R.id.build_date))
// Currently UI tests run against debug builds, which display a hard-coded string 'debug build'
// instead of the date. See https://github.com/mozilla-mobile/fenix/pull/10812#issuecomment-633746833
.check(matches(withText(containsString("debug build"))))
// This assertion should be valid for non-debug build types.
// .check(BuildDateAssertion.isDisplayedDateAccurate())
Log.i(TAG, "verifyVersionNumber: Verified that the about section contains \"debug build\"")
Log.i(TAG, "verifyCurrentTimestamp: Verified that the about section contains \"debug build\"")
}

fun verifyAboutToolbar() {
Expand All @@ -110,12 +110,12 @@ class SettingsSubMenuAboutRobot {
Log.i(TAG, "verifyWhatIsNewInFirefoxLink: Performed ${LISTS_MAXSWIPES}x a scroll action to the end of the about list")

val firefox = TestHelper.appContext.getString(R.string.firefox)
Log.i(TAG, "verifyAboutToolbar: Trying to verify that the \"What’s new in $firefox\" link is visible")
Log.i(TAG, "verifyWhatIsNewInFirefoxLink: Trying to verify that the \"What’s new in $firefox\" link is visible")
onView(withText("What’s new in $firefox")).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
Log.i(TAG, "verifyAboutToolbar: Verified that the \"What’s new in $firefox\" link is visible")
Log.i(TAG, "verifyAboutToolbar: Trying to click the \"What’s new in $firefox\" link")
Log.i(TAG, "verifyWhatIsNewInFirefoxLink: Verified that the \"What’s new in $firefox\" link is visible")
Log.i(TAG, "verifyWhatIsNewInFirefoxLink: Trying to click the \"What’s new in $firefox\" link")
onView(withText("What’s new in $firefox")).perform(click())
Log.i(TAG, "verifyAboutToolbar: Clicked the \"What’s new in $firefox\" link")
Log.i(TAG, "verifyWhatIsNewInFirefoxLink: Clicked the \"What’s new in $firefox\" link")
}
fun verifySupport() {
Log.i(TAG, "verifySupport: Trying to perform ${LISTS_MAXSWIPES}x a scroll action to the end of the about list")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@

package org.mozilla.fenix.ui.robots

import android.util.Log
import org.mozilla.fenix.helpers.Constants.TAG
import org.mozilla.fenix.helpers.TestHelper.mDevice

class SettingsSubMenuSetDefaultBrowserRobot {
class Transition {
fun goBack(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
Log.i(TAG, "goBack: Waiting for device to be idle")
mDevice.waitForIdle()
Log.i(TAG, "goBack: Waited for device to be idle")

// We are now in system settings / showing a default browser dialog.
// Really want to go back to the app. Not interested in up navigation like in other robots.
Log.i(TAG, "clearNotifications: Trying to click the device back button")
mDevice.pressBack()
Log.i(TAG, "clearNotifications: Clicked the device back button")

SettingsRobot().interact()
return SettingsRobot.Transition()
Expand Down

0 comments on commit d0343ee

Please sign in to comment.