You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.6 KiB
Kotlin
90 lines
2.6 KiB
Kotlin
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
package org.mozilla.fenix.ui
|
|
|
|
import androidx.test.uiautomator.UiDevice
|
|
import org.junit.Rule
|
|
import org.junit.Test
|
|
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
|
|
|
import androidx.test.platform.app.InstrumentationRegistry
|
|
import org.mozilla.fenix.ui.robots.homeScreen
|
|
|
|
/**
|
|
* Tests for verifying the presence of home screen and first-run homescreen elements
|
|
*
|
|
*/
|
|
|
|
class HomeScreenTest {
|
|
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
|
|
|
|
private val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
|
|
|
@get:Rule
|
|
val activityTestRule = HomeActivityTestRule()
|
|
|
|
@Test
|
|
fun homeScreenItemsTest() {
|
|
homeScreen { }.dismissOnboarding()
|
|
|
|
homeScreen {
|
|
verifyHomeScreen()
|
|
verifyNavigationToolbar()
|
|
verifyHomePrivateBrowsingButton()
|
|
verifyHomeMenu()
|
|
verifyHomeWordmark()
|
|
verifyOpenTabsHeader()
|
|
verifyAddTabButton()
|
|
verifyNoTabsOpenedHeader()
|
|
verifyNoTabsOpenedText()
|
|
verifyCollectionsHeader()
|
|
verifyNoCollectionsHeader()
|
|
verifyNoCollectionsText()
|
|
verifyHomeToolbar()
|
|
verifyHomeComponent()
|
|
}
|
|
}
|
|
|
|
@Test
|
|
fun firstRunHomeScreenItemsTest() {
|
|
homeScreen {
|
|
verifyHomeScreen()
|
|
verifyNavigationToolbar()
|
|
verifyHomePrivateBrowsingButton()
|
|
verifyHomeMenu()
|
|
verifyHomeWordmark()
|
|
|
|
verifyWelcomeHeader()
|
|
|
|
verifyGetTheMostHeader()
|
|
verifyAccountsSignInButton()
|
|
verifyGetToKnowHeader()
|
|
|
|
swipeUpToDismissFirstRun()
|
|
|
|
verifyChooseThemeHeader()
|
|
verifyChooseThemeText()
|
|
verifyLightThemeToggle()
|
|
verifyLightThemeDescription()
|
|
verifyDarkThemeToggle()
|
|
verifyDarkThemeDescription()
|
|
verifyAutomaticThemeToggle()
|
|
verifyAutomaticThemeDescription()
|
|
|
|
verifyProtectYourselfHeader()
|
|
verifyTrackingProtectionToggle()
|
|
verifyProtectYourselfText()
|
|
|
|
verifyBrowsePrivatelyHeader()
|
|
verifyBrowsePrivatelyText()
|
|
verifyYourPrivacyHeader()
|
|
verifyYourPrivacyText()
|
|
|
|
verifyPrivacyNoticeButton()
|
|
verifyStartBrowsingButton()
|
|
}
|
|
}
|
|
}
|