mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Performance tests (#1301)
* Add signposts to performance tests. - Update flow to include support for the migration screen. * If the welcome screen shows, click on the button. * Ensure a clean simulator each run. * Add accessibility identifier for migration screen if required. * Handle walking into the room and back out again. * use iphone 14 pro to match what's used in xcode. * Remove ApplicationTests as duplicated in LoginTests. We measure app startup time in LoginTests as part of the flow - we may as well avoid spending 60s doing only that measurement in ApplicationTests * Sleep 10s, the ui is otherwise showing up in random order. * Revert "Remove ApplicationTests as duplicated in LoginTests." This reverts commit 8670710315bcd0d6c3c3046f534b32b4c728b837. * Update script to parse out correct values from results file. * Allow cancellation of password prompt in any order. * Remove test timeout, performance tests will always take a while. * Adjust parsing further * Remove ApplicationTests. * Move to a more elegant way to wait for something to disappear. * Linting. * Fix unit tests. --------- Co-authored-by: Doug <douglase@element.io> Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
@@ -165,6 +165,7 @@ class AuthenticationCoordinator: CoordinatorProtocol {
|
||||
|
||||
private func showLoginScreen() {
|
||||
let parameters = LoginScreenCoordinatorParameters(authenticationService: authenticationService,
|
||||
analytics: analytics,
|
||||
userIndicatorController: userIndicatorController)
|
||||
let coordinator = LoginScreenCoordinator(parameters: parameters)
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ struct LoginScreenCoordinatorParameters {
|
||||
/// The service used to authenticate the user.
|
||||
let authenticationService: AuthenticationServiceProxyProtocol
|
||||
|
||||
let analytics: AnalyticsService
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
|
||||
@@ -119,15 +120,18 @@ final class LoginScreenCoordinator: CoordinatorProtocol {
|
||||
startLoading(isInteractionBlocking: true)
|
||||
|
||||
Task {
|
||||
parameters.analytics.signpost.beginLogin()
|
||||
switch await authenticationService.login(username: username,
|
||||
password: password,
|
||||
initialDeviceName: UIDevice.current.initialDeviceName,
|
||||
deviceID: nil) {
|
||||
case .success(let userSession):
|
||||
callback?(.signedIn(userSession))
|
||||
parameters.analytics.signpost.endLogin()
|
||||
stopLoading()
|
||||
case .failure(let error):
|
||||
stopLoading()
|
||||
parameters.analytics.signpost.endLogin()
|
||||
switch error {
|
||||
case .isOnWaitlist:
|
||||
callback?(.isOnWaitlist(.init(username: username,
|
||||
|
||||
@@ -52,6 +52,7 @@ final class HomeScreenCoordinator: CoordinatorProtocol {
|
||||
attributedStringBuilder: parameters.attributedStringBuilder,
|
||||
selectedRoomPublisher: parameters.selectedRoomPublisher,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
analytics: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
|
||||
viewModel.callback = { [weak self] action in
|
||||
|
||||
@@ -23,6 +23,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
private let userSession: UserSessionProtocol
|
||||
private let attributedStringBuilder: AttributedStringBuilderProtocol
|
||||
private let appSettings: AppSettings
|
||||
private let analytics: AnalyticsService
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
|
||||
private let roomSummaryProvider: RoomSummaryProviderProtocol?
|
||||
@@ -38,10 +39,12 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
attributedStringBuilder: AttributedStringBuilderProtocol,
|
||||
selectedRoomPublisher: CurrentValuePublisher<String?, Never>,
|
||||
appSettings: AppSettings,
|
||||
analytics: AnalyticsService,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.userSession = userSession
|
||||
self.attributedStringBuilder = attributedStringBuilder
|
||||
self.appSettings = appSettings
|
||||
self.analytics = analytics
|
||||
self.userIndicatorController = userIndicatorController
|
||||
|
||||
roomSummaryProvider = userSession.clientProxy.roomSummaryProvider
|
||||
@@ -98,6 +101,11 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
return
|
||||
}
|
||||
|
||||
// End the initial sync performance timing once the room list is about to be displayed.
|
||||
if roomListMode == .rooms, self.state.roomListMode == .skeletons {
|
||||
analytics.signpost.endSync()
|
||||
}
|
||||
|
||||
self.state.roomListMode = roomListMode
|
||||
|
||||
MXLog.info("Received room summary provider update, setting view room list mode to \"\(self.state.roomListMode)\"")
|
||||
|
||||
@@ -228,6 +228,7 @@ struct HomeScreen_Previews: PreviewProvider {
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL),
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
analytics: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
|
||||
return NavigationStack {
|
||||
|
||||
@@ -177,6 +177,7 @@ struct HomeScreenRoomCell_Previews: PreviewProvider {
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL),
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
analytics: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
|
||||
let rooms: [HomeScreenRoom] = summaryProvider.roomListPublisher.value.compactMap { summary -> HomeScreenRoom? in
|
||||
|
||||
@@ -43,6 +43,7 @@ struct MigrationScreen: View {
|
||||
.font(.compound.bodyLG)
|
||||
.multilineTextAlignment(.center)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
.accessibilityIdentifier(A11yIdentifiers.migrationScreen.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ struct WelcomeScreen: View {
|
||||
Text(context.viewState.buttonTitle)
|
||||
}
|
||||
.buttonStyle(.elementAction(.xLarge))
|
||||
.accessibilityIdentifier(A11yIdentifiers.welcomeScreen.letsGo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user