From b5b4abb1ff71d2164f6253228847b1ad82bcef22 Mon Sep 17 00:00:00 2001 From: AndiAJ Date: Tue, 13 Feb 2024 15:45:42 +0200 Subject: [PATCH] Bug 1880221 - Convert private variables to functions so they don't get initialised --- .../fenix/ui/robots/RecentlyClosedTabsRobot.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/RecentlyClosedTabsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/RecentlyClosedTabsRobot.kt index d77962cfb..2a3996fd9 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/RecentlyClosedTabsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/RecentlyClosedTabsRobot.kt @@ -87,21 +87,21 @@ class RecentlyClosedTabsRobot { } fun clickOpenInNewTab(testRule: HomeActivityComposeTestRule, interact: ComposeTabDrawerRobot.() -> Unit): ComposeTabDrawerRobot.Transition { - openInNewTabOption.click() + openInNewTabOption().click() ComposeTabDrawerRobot(testRule).interact() return ComposeTabDrawerRobot.Transition(testRule) } fun clickOpenInPrivateTab(testRule: HomeActivityComposeTestRule, interact: ComposeTabDrawerRobot.() -> Unit): ComposeTabDrawerRobot.Transition { - openInPrivateTabOption.click() + openInPrivateTabOption().click() ComposeTabDrawerRobot(testRule).interact() return ComposeTabDrawerRobot.Transition(testRule) } fun clickShare(interact: ShareOverlayRobot.() -> Unit): ShareOverlayRobot.Transition { - multipleSelectionShareButton.click() + multipleSelectionShareButton().click() ShareOverlayRobot().interact() return ShareOverlayRobot.Transition() @@ -132,8 +132,8 @@ private fun recentlyClosedTabDeleteButton() = ), ) -private val openInNewTabOption = onView(withText("Open in new tab")) +private fun openInNewTabOption() = onView(withText("Open in new tab")) -private val openInPrivateTabOption = onView(withText("Open in private tab")) +private fun openInPrivateTabOption() = onView(withText("Open in private tab")) -private val multipleSelectionShareButton = onView(withId(R.id.share_history_multi_select)) +private fun multipleSelectionShareButton() = onView(withId(R.id.share_history_multi_select))