Merge pull request #6651 from vector-im/feature/adm/enable-ftue
FTUE - Enable onboarding FTUE flows
This commit is contained in:
commit
01bc275311
|
@ -0,0 +1 @@
|
||||||
|
FTUE - Enable improved login and register onboarding flows
|
|
@ -23,7 +23,6 @@ import androidx.test.espresso.Espresso.pressBack
|
||||||
import androidx.test.espresso.action.ViewActions
|
import androidx.test.espresso.action.ViewActions
|
||||||
import androidx.test.espresso.action.ViewActions.click
|
import androidx.test.espresso.action.ViewActions.click
|
||||||
import androidx.test.espresso.assertion.ViewAssertions
|
import androidx.test.espresso.assertion.ViewAssertions
|
||||||
import androidx.test.espresso.matcher.ViewMatchers
|
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||||
|
@ -182,13 +181,8 @@ class ElementRobot {
|
||||||
val activity = EspressoHelper.getCurrentActivity()!!
|
val activity = EspressoHelper.getCurrentActivity()!!
|
||||||
val popup = activity.findViewById<View>(com.tapadoo.alerter.R.id.llAlertBackground)!!
|
val popup = activity.findViewById<View>(com.tapadoo.alerter.R.id.llAlertBackground)!!
|
||||||
activity.runOnUiThread { popup.performClick() }
|
activity.runOnUiThread { popup.performClick() }
|
||||||
|
|
||||||
waitUntilViewVisible(withId(R.id.bottomSheetFragmentContainer))
|
|
||||||
waitUntilViewVisible(ViewMatchers.withText(R.string.action_skip))
|
|
||||||
clickOn(R.string.action_skip)
|
|
||||||
assertDisplayed(R.string.are_you_sure)
|
|
||||||
clickOn(R.string.action_skip)
|
|
||||||
waitUntilViewVisible(withId(R.id.bottomSheetFragmentContainer))
|
waitUntilViewVisible(withId(R.id.bottomSheetFragmentContainer))
|
||||||
|
pressBack()
|
||||||
}.onFailure { Timber.w(it, "Verification popup missing") }
|
}.onFailure { Timber.w(it, "Verification popup missing") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,31 +34,46 @@ import im.vector.app.waitForView
|
||||||
|
|
||||||
class OnboardingRobot {
|
class OnboardingRobot {
|
||||||
|
|
||||||
|
private val defaultVectorFeatures = DefaultVectorFeatures()
|
||||||
|
|
||||||
fun crawl() {
|
fun crawl() {
|
||||||
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
|
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
|
||||||
crawlGetStarted()
|
crawlCreateAccount()
|
||||||
crawlAlreadyHaveAccount()
|
crawlAlreadyHaveAccount()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun crawlGetStarted() {
|
private fun crawlCreateAccount() {
|
||||||
clickOn(R.id.loginSplashSubmit)
|
if (defaultVectorFeatures.isOnboardingCombinedRegisterEnabled()) {
|
||||||
assertDisplayed(R.id.useCaseHeaderTitle, R.string.ftue_auth_use_case_title)
|
// TODO https://github.com/vector-im/element-android/issues/6652
|
||||||
clickOn(R.id.useCaseOptionOne)
|
} else {
|
||||||
OnboardingServersRobot().crawlSignUp()
|
clickOn(R.id.loginSplashSubmit)
|
||||||
pressBack()
|
assertDisplayed(R.id.useCaseHeaderTitle, R.string.ftue_auth_use_case_title)
|
||||||
pressBack()
|
clickOn(R.id.useCaseOptionOne)
|
||||||
|
OnboardingServersRobot().crawlSignUp()
|
||||||
|
pressBack()
|
||||||
|
pressBack()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun crawlAlreadyHaveAccount() {
|
private fun crawlAlreadyHaveAccount() {
|
||||||
clickOn(R.id.loginSplashAlreadyHaveAccount)
|
if (defaultVectorFeatures.isOnboardingCombinedLoginEnabled()) {
|
||||||
OnboardingServersRobot().crawlSignIn()
|
// TODO https://github.com/vector-im/element-android/issues/6652
|
||||||
pressBack()
|
} else {
|
||||||
|
clickOn(R.id.loginSplashAlreadyHaveAccount)
|
||||||
|
OnboardingServersRobot().crawlSignIn()
|
||||||
|
pressBack()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createAccount(userId: String, password: String = "password", homeServerUrl: String = "http://10.0.2.2:8080") {
|
fun createAccount(userId: String, password: String = "password", homeServerUrl: String = "http://10.0.2.2:8080") {
|
||||||
initSession(true, userId, password, homeServerUrl)
|
if (defaultVectorFeatures.isOnboardingCombinedRegisterEnabled()) {
|
||||||
|
createAccountViaCombinedRegister(homeServerUrl, userId, password)
|
||||||
|
} else {
|
||||||
|
initSession(true, userId, password, homeServerUrl)
|
||||||
|
}
|
||||||
|
|
||||||
waitUntilViewVisible(withText(R.string.ftue_account_created_congratulations_title))
|
waitUntilViewVisible(withText(R.string.ftue_account_created_congratulations_title))
|
||||||
if (DefaultVectorFeatures().isOnboardingPersonalizeEnabled()) {
|
if (defaultVectorFeatures.isOnboardingPersonalizeEnabled()) {
|
||||||
clickOn(R.string.ftue_account_created_personalize)
|
clickOn(R.string.ftue_account_created_personalize)
|
||||||
|
|
||||||
waitUntilViewVisible(withText(R.string.ftue_display_name_title))
|
waitUntilViewVisible(withText(R.string.ftue_display_name_title))
|
||||||
|
@ -75,8 +90,47 @@ class OnboardingRobot {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun createAccountViaCombinedRegister(homeServerUrl: String, userId: String, password: String) {
|
||||||
|
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
|
||||||
|
assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_create_account)
|
||||||
|
clickOn(R.id.loginSplashSubmit)
|
||||||
|
clickOn(R.id.useCaseOptionOne)
|
||||||
|
|
||||||
|
waitUntilViewVisible(withId(R.id.createAccountRoot))
|
||||||
|
clickOn(R.id.editServerButton)
|
||||||
|
writeTo(R.id.chooseServerInput, homeServerUrl)
|
||||||
|
closeSoftKeyboard()
|
||||||
|
clickOn(R.id.chooseServerSubmit)
|
||||||
|
waitUntilViewVisible(withId(R.id.createAccountRoot))
|
||||||
|
|
||||||
|
writeTo(R.id.createAccountInput, userId)
|
||||||
|
writeTo(R.id.createAccountPasswordInput, password)
|
||||||
|
clickOn(R.id.createAccountSubmit)
|
||||||
|
}
|
||||||
|
|
||||||
fun login(userId: String, password: String = "password", homeServerUrl: String = "http://10.0.2.2:8080") {
|
fun login(userId: String, password: String = "password", homeServerUrl: String = "http://10.0.2.2:8080") {
|
||||||
initSession(false, userId, password, homeServerUrl)
|
if (defaultVectorFeatures.isOnboardingCombinedLoginEnabled()) {
|
||||||
|
loginViaCombinedLogin(homeServerUrl, userId, password)
|
||||||
|
} else {
|
||||||
|
initSession(false, userId, password, homeServerUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun loginViaCombinedLogin(homeServerUrl: String, userId: String, password: String) {
|
||||||
|
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
|
||||||
|
assertDisplayed(R.id.loginSplashSubmit, R.string.login_splash_create_account)
|
||||||
|
clickOn(R.id.loginSplashAlreadyHaveAccount)
|
||||||
|
|
||||||
|
waitUntilViewVisible(withId(R.id.loginRoot))
|
||||||
|
clickOn(R.id.editServerButton)
|
||||||
|
writeTo(R.id.chooseServerInput, homeServerUrl)
|
||||||
|
closeSoftKeyboard()
|
||||||
|
clickOn(R.id.chooseServerSubmit)
|
||||||
|
waitUntilViewVisible(withId(R.id.loginRoot))
|
||||||
|
|
||||||
|
writeTo(R.id.loginInput, userId)
|
||||||
|
writeTo(R.id.loginPasswordInput, password)
|
||||||
|
clickOn(R.id.loginSubmit)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initSession(
|
private fun initSession(
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
package im.vector.app.ui.robot.settings
|
package im.vector.app.ui.robot.settings
|
||||||
|
|
||||||
import androidx.test.espresso.Espresso.pressBack
|
import androidx.test.espresso.Espresso.pressBack
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||||
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
|
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
|
||||||
import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton
|
import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.espresso.tools.waitUntilActivityVisible
|
|
||||||
import im.vector.app.espresso.tools.waitUntilViewVisible
|
import im.vector.app.espresso.tools.waitUntilViewVisible
|
||||||
import im.vector.app.features.settings.font.FontScaleSettingActivity
|
|
||||||
|
|
||||||
class SettingsPreferencesRobot {
|
class SettingsPreferencesRobot {
|
||||||
|
|
||||||
|
@ -34,8 +33,7 @@ class SettingsPreferencesRobot {
|
||||||
clickOn(R.string.settings_theme)
|
clickOn(R.string.settings_theme)
|
||||||
clickDialogNegativeButton()
|
clickDialogNegativeButton()
|
||||||
clickOn(R.string.font_size)
|
clickOn(R.string.font_size)
|
||||||
waitUntilActivityVisible<FontScaleSettingActivity> {
|
waitUntilViewVisible(withId(R.id.fons_scale_recycler))
|
||||||
pressBack()
|
pressBack()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,9 @@ class DefaultVectorFeatures : VectorFeatures {
|
||||||
override fun isOnboardingAlreadyHaveAccountSplashEnabled() = true
|
override fun isOnboardingAlreadyHaveAccountSplashEnabled() = true
|
||||||
override fun isOnboardingSplashCarouselEnabled() = true
|
override fun isOnboardingSplashCarouselEnabled() = true
|
||||||
override fun isOnboardingUseCaseEnabled() = true
|
override fun isOnboardingUseCaseEnabled() = true
|
||||||
override fun isOnboardingPersonalizeEnabled() = false
|
override fun isOnboardingPersonalizeEnabled() = true
|
||||||
override fun isOnboardingCombinedRegisterEnabled() = false
|
override fun isOnboardingCombinedRegisterEnabled() = true
|
||||||
override fun isOnboardingCombinedLoginEnabled() = false
|
override fun isOnboardingCombinedLoginEnabled() = true
|
||||||
override fun allowExternalUnifiedPushDistributors(): Boolean = Config.ALLOW_EXTERNAL_UNIFIED_PUSH_DISTRIBUTORS
|
override fun allowExternalUnifiedPushDistributors(): Boolean = Config.ALLOW_EXTERNAL_UNIFIED_PUSH_DISTRIBUTORS
|
||||||
override fun isScreenSharingEnabled(): Boolean = true
|
override fun isScreenSharingEnabled(): Boolean = true
|
||||||
override fun forceUsageOfOpusEncoder(): Boolean = false
|
override fun forceUsageOfOpusEncoder(): Boolean = false
|
||||||
|
|
Loading…
Reference in New Issue