1
0
Fork 0

Closes #3860 - Update description text for collections

master
Emily Kager 2019-08-14 13:36:50 -07:00 committed by Emily Kager
parent b7ca520787
commit f71106cb51
2 changed files with 80 additions and 30 deletions

View File

@ -42,6 +42,7 @@ class HomeScreenRobot {
// First Run elements // First Run elements
fun verifyWelcomeHeader() = assertWelcomeHeader() fun verifyWelcomeHeader() = assertWelcomeHeader()
fun verifyGetTheMostHeader() = assertGetTheMostHeader() fun verifyGetTheMostHeader() = assertGetTheMostHeader()
fun verifyAccountsSignInButton() = assertAccountsSignInButton() fun verifyAccountsSignInButton() = assertAccountsSignInButton()
fun verifyGetToKnowHeader() = assertGetToKnowHeader() fun verifyGetToKnowHeader() = assertGetToKnowHeader()
@ -106,20 +107,29 @@ fun homeScreen(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
private fun navigationToolbar() = onView(CoreMatchers.allOf(ViewMatchers.withText("Search or enter address"))) private fun navigationToolbar() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Search or enter address")))
private fun assertNavigationToolbar() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Search or enter address")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertNavigationToolbar() = onView(CoreMatchers.allOf(ViewMatchers.withText("Search or enter address")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomeScreen() = onView(ViewMatchers.withResourceName("homeLayout")) private fun assertHomeScreen() = onView(ViewMatchers.withResourceName("homeLayout"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomeMenu() = onView(ViewMatchers.withResourceName("menuButton")) private fun assertHomeMenu() = onView(ViewMatchers.withResourceName("menuButton"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomePrivateBrowsingButton() = onView(ViewMatchers.withResourceName("privateBrowsingButton"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) private fun assertHomePrivateBrowsingButton() =
onView(ViewMatchers.withResourceName("privateBrowsingButton"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomeWordmark() = onView(ViewMatchers.withResourceName("wordmark")) private fun assertHomeWordmark() = onView(ViewMatchers.withResourceName("wordmark"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomeToolbar() = onView(ViewMatchers.withResourceName("toolbar")) private fun assertHomeToolbar() = onView(ViewMatchers.withResourceName("toolbar"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertOpenTabsHeader() = private fun assertOpenTabsHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Open tabs"))) onView(CoreMatchers.allOf(ViewMatchers.withText("Open tabs")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
@ -136,28 +146,45 @@ private fun assertNoTabsOpenedText() {
onView(CoreMatchers.allOf(ViewMatchers.withText("Your open tabs will be shown here."))) onView(CoreMatchers.allOf(ViewMatchers.withText("Your open tabs will be shown here.")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertCollectionsHeader() = onView(CoreMatchers.allOf(ViewMatchers.withText("Collections")))
private fun assertCollectionsHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Collections")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertNoCollectionsHeader() = onView(CoreMatchers.allOf(ViewMatchers.withText("No collections")))
private fun assertNoCollectionsHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("No collections")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertNoCollectionsText() = private fun assertNoCollectionsText() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Your collections will be shown here."))) onView(
CoreMatchers.allOf(
ViewMatchers
.withText("Collect the things that matter to you. To start, save open tabs to a new collection.")
)
)
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertHomeComponent() = onView(ViewMatchers.withResourceName("home_component")) private fun assertHomeComponent() = onView(ViewMatchers.withResourceName("home_component"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun threeDotButton() = onView(allOf(ViewMatchers.withId(R.id.menuButton))) private fun threeDotButton() = onView(allOf(ViewMatchers.withId(R.id.menuButton)))
// First Run elements // First Run elements
private fun assertWelcomeHeader() = onView(CoreMatchers.allOf(ViewMatchers.withText("Welcome to Firefox Preview!"))) private fun assertWelcomeHeader() =
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) onView(CoreMatchers.allOf(ViewMatchers.withText("Welcome to Firefox Preview!")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertGetTheMostHeader() = private fun assertGetTheMostHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Get the most out of Firefox Preview."))) onView(CoreMatchers.allOf(ViewMatchers.withText("Get the most out of Firefox Preview.")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertAccountsSignInButton() = onView(ViewMatchers.withResourceName("turn_on_sync_button"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) private fun assertAccountsSignInButton() =
private fun assertGetToKnowHeader() = onView(CoreMatchers.allOf(ViewMatchers.withText("Get to know Firefox Preview"))) onView(ViewMatchers.withResourceName("turn_on_sync_button"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertGetToKnowHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Get to know Firefox Preview")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertChooseThemeHeader() = private fun assertChooseThemeHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Choose your theme"))) onView(CoreMatchers.allOf(ViewMatchers.withText("Choose your theme")))
@ -167,33 +194,54 @@ private fun assertChooseThemeText() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Try dark theme: easier on your battery and your eyes."))) onView(CoreMatchers.allOf(ViewMatchers.withText("Try dark theme: easier on your battery and your eyes.")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertLightThemeToggle() = onView(ViewMatchers.withResourceName("theme_light_radio_button")) private fun assertLightThemeToggle() =
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) onView(ViewMatchers.withResourceName("theme_light_radio_button"))
private fun assertLightThemeDescription() = onView(CoreMatchers.allOf(ViewMatchers.withText("Light theme"))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertDarkThemeToggle() = onView(ViewMatchers.withResourceName("theme_dark_radio_button")) private fun assertLightThemeDescription() =
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) onView(CoreMatchers.allOf(ViewMatchers.withText("Light theme")))
private fun assertDarkThemeDescription() = onView(CoreMatchers.allOf(ViewMatchers.withText("Dark theme"))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertAutomaticThemeToggle() = onView(ViewMatchers.withResourceName("theme_automatic_radio_button")) private fun assertDarkThemeToggle() =
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) onView(ViewMatchers.withResourceName("theme_dark_radio_button"))
private fun assertAutomaticThemeDescription() = onView(CoreMatchers.allOf(ViewMatchers.withText("Automatic"))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertDarkThemeDescription() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Dark theme")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertAutomaticThemeToggle() =
onView(ViewMatchers.withResourceName("theme_automatic_radio_button"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertAutomaticThemeDescription() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Automatic")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertProtectYourselfHeader() = private fun assertProtectYourselfHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Protect yourself"))) onView(CoreMatchers.allOf(ViewMatchers.withText("Protect yourself")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertTrackingProtectionToggle() = onView( private fun assertTrackingProtectionToggle() = onView(
CoreMatchers.allOf(ViewMatchers.withResourceName("tracking_protection_toggle"))) CoreMatchers.allOf(ViewMatchers.withResourceName("tracking_protection_toggle"))
)
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertProtectYourselfText() { private fun assertProtectYourselfText() {
onView(CoreMatchers.allOf(ViewMatchers.withText( onView(
"Firefox Preview blocks ad trackers that follow you around the web."))) CoreMatchers.allOf(
ViewMatchers.withText(
"Firefox Preview blocks ad trackers that follow you around the web."
)
)
)
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertBrowsePrivatelyHeader() = private fun assertBrowsePrivatelyHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Browse privately"))) onView(CoreMatchers.allOf(ViewMatchers.withText("Browse privately")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertBrowsePrivatelyText() = private fun assertBrowsePrivatelyText() =
onView(CoreMatchers.allOf(ViewMatchers.withText(containsString("private browsing is just a tap away.")))) onView(CoreMatchers.allOf(ViewMatchers.withText(containsString("private browsing is just a tap away."))))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
@ -201,10 +249,12 @@ private fun assertBrowsePrivatelyText() =
private fun assertYourPrivacyHeader() = private fun assertYourPrivacyHeader() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Your privacy"))) onView(CoreMatchers.allOf(ViewMatchers.withText("Your privacy")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertYourPrivacyText() = private fun assertYourPrivacyText() =
onView(CoreMatchers.allOf(ViewMatchers.withText( onView(CoreMatchers.allOf(ViewMatchers.withText(
"Weve designed Firefox Preview to give you control over what you share online and what you share with us."))) "Weve designed Firefox Preview to give you control over what you share online and what you share with us.")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertPrivacyNoticeButton() = private fun assertPrivacyNoticeButton() =
onView(CoreMatchers.allOf(ViewMatchers.withText("Read our privacy notice"))) onView(CoreMatchers.allOf(ViewMatchers.withText("Read our privacy notice")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))

View File

@ -24,7 +24,7 @@ val noTabMessage = AdapterItem.NoContentMessage(
val noCollectionMessage = AdapterItem.NoContentMessage( val noCollectionMessage = AdapterItem.NoContentMessage(
R.drawable.ic_tab_collection, R.drawable.ic_tab_collection,
R.string.no_collections_header, R.string.no_collections_header,
R.string.no_collections_description R.string.collections_description
) )
private fun normalModeAdapterItems( private fun normalModeAdapterItems(