Fix for UI tests now showing the status bar. (#2065)

This commit is contained in:
Doug 2023-11-13 07:30:41 +00:00 committed by GitHub
parent b5cc2cbf61
commit a2c2f872cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -42,7 +42,7 @@ class UserIndicatorController: ObservableObject, UserIndicatorControllerProtocol
var window: UIWindow? {
didSet {
let hostingController = UIHostingController(rootView: UserIndicatorPresenter(userIndicatorController: self))
let hostingController = UIHostingController(rootView: UserIndicatorPresenter(userIndicatorController: self).statusBarHidden(ProcessInfo.isRunningUITests))
hostingController.view.backgroundColor = .clear
window?.rootViewController = hostingController
}

View File

@ -35,7 +35,7 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, WindowManagerDelegate {
windowManager.delegate = self
ServiceLocator.shared.register(userIndicatorController: UserIndicatorControllerMock.default)
ServiceLocator.shared.register(userIndicatorController: UserIndicatorController())
AppSettings.configureWithSuiteName("io.element.elementx.uitests")
AppSettings.reset()
@ -63,8 +63,10 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, WindowManagerDelegate {
}
func windowManagerDidConfigureWindows(_ windowManager: WindowManager) {
guard let screenID = ProcessInfo.testScreenID, screenID == .appLockFlow || screenID == .appLockFlowDisabled else { return }
ServiceLocator.shared.userIndicatorController.window = windowManager.overlayWindow
// Set up the alternate window for the App Lock flow coordinator tests.
guard let screenID = ProcessInfo.testScreenID, screenID == .appLockFlow || screenID == .appLockFlowDisabled else { return }
let screen = MockScreen(id: screenID == .appLockFlow ? .appLockFlowAlternateWindow : .appLockFlowDisabledAlternateWindow, windowManager: windowManager)
windowManager.alternateWindow.rootViewController = UIHostingController(rootView: screen.coordinator.toPresentable().statusBarHidden())
alternateWindowMockScreen = screen

View File

@ -0,0 +1 @@
Fix for the status bar being visible during UI tests.