FTUE - Finalising personalisation journey (#5519)

* enabling the personalisation flow and promoting the strings for translation

* delegating the fake vector features to the static defaults, the fake exists for allowing overrides when needed

* incorporating the personalisation screens into the UI test signup

* adding changelog entry

* removing unused import

* putting the personalisation UI test flow behind the feature flag so that we can keep it disabled

* disabling the personalisation flow, we'll batch enable with other parts of the FTUE flow

* enabling the personalisation feature for registration unit tests which expect it to be enabled
This commit is contained in:
Adam Brown 2022-03-30 09:09:46 +01:00 committed by GitHub
parent 9c333c96c4
commit 9d3d574d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 28 deletions

1
changelog.d/5519.wip Normal file
View File

@ -0,0 +1 @@
Finalising FTUE onboarding account creation personalization steps but keeping feature disabled until other parts are complete

View File

@ -29,6 +29,7 @@ import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo
import im.vector.app.R import im.vector.app.R
import im.vector.app.espresso.tools.waitUntilViewVisible import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.waitForView import im.vector.app.waitForView
class OnboardingRobot { class OnboardingRobot {
@ -57,7 +58,21 @@ class OnboardingRobot {
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) initSession(true, userId, password, homeServerUrl)
waitUntilViewVisible(withText(R.string.ftue_account_created_congratulations_title)) waitUntilViewVisible(withText(R.string.ftue_account_created_congratulations_title))
clickOn(R.string.ftue_account_created_take_me_home) if (DefaultVectorFeatures().isOnboardingPersonalizeEnabled()) {
clickOn(R.string.ftue_account_created_personalize)
waitUntilViewVisible(withText(R.string.ftue_display_name_title))
writeTo(R.id.displayNameInput, "UI automation")
clickOn(R.string.ftue_personalize_submit)
waitUntilViewVisible(withText(R.string.ftue_profile_picture_title))
clickOn(R.string.ftue_personalize_skip_this_step)
waitUntilViewVisible(withText(R.string.ftue_personalize_complete_title))
clickOn(R.string.ftue_personalize_lets_go)
} else {
clickOn(R.string.ftue_account_created_take_me_home)
}
} }
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") {

View File

@ -10,22 +10,4 @@
<string name="cut_the_slack_from_teams" translatable="false">Cut the slack from teams.</string> <string name="cut_the_slack_from_teams" translatable="false">Cut the slack from teams.</string>
<!-- WIP --> <!-- WIP -->
<string name="ftue_account_created_personalize" translatable="false">Personalize profile</string>
<string name="ftue_account_created_take_me_home" translatable="false">Take me home</string>
<string name="ftue_account_created_congratulations_title" translatable="false">Congratulations!</string>
<string name="ftue_account_created_subtitle" translatable="false">Your account %s has been created.</string>
<string name="ftue_display_name_title" translatable="false">Choose a display name</string>
<string name="ftue_display_name_subtitle" translatable="false">This will be shown when you send messages.</string>
<string name="ftue_display_name_entry_title" translatable="false">Display Name</string>
<string name="ftue_display_name_entry_footer" translatable="false">You can change this later</string>
<string name="ftue_profile_picture_title" translatable="false">Add a profile picture</string>
<string name="ftue_profile_picture_subtitle" translatable="false">You can change this anytime.</string>
<string name="ftue_personalize_lets_go" translatable="false">Let\'s go</string>
<string name="ftue_personalize_complete_title" translatable="false">You\'re all set!</string>
<string name="ftue_personalize_complete_subtitle" translatable="false">Your preferences have been saved.</string>
<string name="ftue_personalize_submit" translatable="false">Save and continue</string>
<string name="ftue_personalize_skip_this_step" translatable="false">Skip this step</string>
</resources> </resources>

View File

@ -1863,6 +1863,25 @@
<string name="ftue_auth_use_case_join_existing_server">Looking to join an existing server?</string> <string name="ftue_auth_use_case_join_existing_server">Looking to join an existing server?</string>
<string name="ftue_auth_use_case_connect_to_server">Connect to server</string> <string name="ftue_auth_use_case_connect_to_server">Connect to server</string>
<string name="ftue_account_created_personalize">Personalize profile</string>
<string name="ftue_account_created_take_me_home">Take me home</string>
<string name="ftue_account_created_congratulations_title">Congratulations!</string>
<string name="ftue_account_created_subtitle">Your account %s has been created.</string>
<string name="ftue_display_name_title">Choose a display name</string>
<string name="ftue_display_name_subtitle">This will be shown when you send messages.</string>
<string name="ftue_display_name_entry_title">Display Name</string>
<string name="ftue_display_name_entry_footer">You can change this later</string>
<string name="ftue_profile_picture_title">Add a profile picture</string>
<string name="ftue_profile_picture_subtitle">You can change this anytime.</string>
<string name="ftue_personalize_lets_go">Let\'s go</string>
<string name="ftue_personalize_complete_title">You\'re all set!</string>
<string name="ftue_personalize_complete_subtitle">Your preferences have been saved.</string>
<string name="ftue_personalize_submit">Save and continue</string>
<string name="ftue_personalize_skip_this_step">Skip this step</string>
<string name="login_splash_title">It\'s your conversation. Own it.</string> <string name="login_splash_title">It\'s your conversation. Own it.</string>
<string name="login_splash_text1">Chat with people directly or in groups</string> <string name="login_splash_text1">Chat with people directly or in groups</string>
<string name="login_splash_text2">Keep conversations private with encryption</string> <string name="login_splash_text2">Keep conversations private with encryption</string>

View File

@ -73,6 +73,7 @@ class OnboardingViewModelTest {
private val fakeAuthenticationService = FakeAuthenticationService() private val fakeAuthenticationService = FakeAuthenticationService()
private val fakeRegisterActionHandler = FakeRegisterActionHandler() private val fakeRegisterActionHandler = FakeRegisterActionHandler()
private val fakeDirectLoginUseCase = FakeDirectLoginUseCase() private val fakeDirectLoginUseCase = FakeDirectLoginUseCase()
private val fakeVectorFeatures = FakeVectorFeatures()
lateinit var viewModel: OnboardingViewModel lateinit var viewModel: OnboardingViewModel
@ -224,7 +225,8 @@ class OnboardingViewModelTest {
} }
@Test @Test
fun `when registering account, then updates state and emits account created event`() = runTest { fun `given personalisation enabled, when registering account, then updates state and emits account created event`() = runTest {
fakeVectorFeatures.givenPersonalisationEnabled()
givenRegistrationResultFor(A_LOADABLE_REGISTER_ACTION, RegistrationResult.Success(fakeSession)) givenRegistrationResultFor(A_LOADABLE_REGISTER_ACTION, RegistrationResult.Success(fakeSession))
givenSuccessfullyCreatesAccount(A_HOMESERVER_CAPABILITIES) givenSuccessfullyCreatesAccount(A_HOMESERVER_CAPABILITIES)
val test = viewModel.test() val test = viewModel.test()
@ -242,7 +244,8 @@ class OnboardingViewModelTest {
} }
@Test @Test
fun `given registration has started and has dummy step to do, when handling action, then ignores other steps and executes dummy`() = runTest { fun `given personalisation enabled and registration has started and has dummy step to do, when handling action, then ignores other steps and executes dummy`() = runTest {
fakeVectorFeatures.givenPersonalisationEnabled()
givenSuccessfulRegistrationForStartAndDummySteps(missingStages = listOf(Stage.Dummy(mandatory = true))) givenSuccessfulRegistrationForStartAndDummySteps(missingStages = listOf(Stage.Dummy(mandatory = true)))
val test = viewModel.test() val test = viewModel.test()
@ -384,7 +387,7 @@ class OnboardingViewModelTest {
ReAuthHelper(), ReAuthHelper(),
FakeStringProvider().instance, FakeStringProvider().instance,
FakeHomeServerHistoryService(), FakeHomeServerHistoryService(),
FakeVectorFeatures(), fakeVectorFeatures,
FakeAnalyticsTracker(), FakeAnalyticsTracker(),
fakeUriFilenameResolver.instance, fakeUriFilenameResolver.instance,
fakeRegisterActionHandler.instance, fakeRegisterActionHandler.instance,

View File

@ -16,12 +16,14 @@
package im.vector.app.test.fakes package im.vector.app.test.fakes
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.VectorFeatures import im.vector.app.features.VectorFeatures
import io.mockk.every
import io.mockk.spyk
class FakeVectorFeatures : VectorFeatures { class FakeVectorFeatures : VectorFeatures by spyk<DefaultVectorFeatures>() {
override fun onboardingVariant() = VectorFeatures.OnboardingVariant.FTUE_AUTH
override fun isOnboardingAlreadyHaveAccountSplashEnabled() = true fun givenPersonalisationEnabled() {
override fun isOnboardingSplashCarouselEnabled() = true every { isOnboardingPersonalizeEnabled() } returns true
override fun isOnboardingUseCaseEnabled() = true }
override fun isOnboardingPersonalizeEnabled() = true
} }