From 1daa2ba0df5fd4adbac7bc4e2d8b2132b5bf895e Mon Sep 17 00:00:00 2001 From: AndiAJ Date: Tue, 20 Feb 2024 13:02:47 +0200 Subject: [PATCH] Bug 1881028 - Convert private variables to functions so they don't get initialised --- ...bMenuEnhancedTrackingProtectionExceptionsRobot.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.kt index db0486f71..ab958924f 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot.kt @@ -36,18 +36,18 @@ class SettingsSubMenuEnhancedTrackingProtectionExceptionsRobot { assertUIObjectExists( itemWithText("Exceptions let you disable tracking protection for selected sites."), ) - learnMoreLink.check(matches(isDisplayed())) + learnMoreLink().check(matches(isDisplayed())) } - fun openExceptionsLearnMoreLink() = learnMoreLink.click() + fun openExceptionsLearnMoreLink() = learnMoreLink().click() fun removeOneSiteException(siteHost: String) { - exceptionsList.waitForExists(waitingTime) + exceptionsList().waitForExists(waitingTime) removeSiteExceptionButton(siteHost).click() } fun verifySiteExceptionExists(siteUrl: String, shouldExist: Boolean) { - exceptionsList.waitForExists(waitingTime) + exceptionsList().waitForExists(waitingTime) assertUIObjectExists(itemContainingText(siteUrl), exists = shouldExist) } @@ -76,7 +76,7 @@ private fun assertNavigationToolBarHeader() { .check((matches(withEffectiveVisibility(Visibility.VISIBLE)))) } -private val learnMoreLink = onView(withText("Learn more")) +private fun learnMoreLink() = onView(withText("Learn more")) private fun disableAllExceptionsButton() = onView(withId(R.id.removeAllExceptions)).click() @@ -89,5 +89,5 @@ private fun removeSiteExceptionButton(siteHost: String) = ), ) -private val exceptionsList = +private fun exceptionsList() = mDevice.findObject(UiSelector().resourceId("$packageName:id/exceptions_list"))