diff --git a/ElementX/Sources/Other/AccessibilityIdentifiers.swift b/ElementX/Sources/Other/AccessibilityIdentifiers.swift index f4fb8b35d..dd03369e5 100644 --- a/ElementX/Sources/Other/AccessibilityIdentifiers.swift +++ b/ElementX/Sources/Other/AccessibilityIdentifiers.swift @@ -23,6 +23,7 @@ struct A11yIdentifiers { static let loginScreen = LoginScreen() static let onboardingScreen = OnboardingScreen() static let roomScreen = RoomScreen() + static let roomDetailsScreen = RoomDetailsScreen() static let sessionVerificationScreen = SessionVerificationScreen() static let softLogoutScreen = SoftLogoutScreen() @@ -64,15 +65,20 @@ struct A11yIdentifiers { } struct RoomScreen { - let name = "room_name" - let avatar = "room_avatar" + let name = "room-name" + let avatar = "room-avatar" + } + + struct RoomDetailsScreen { + let avatar = "room_details-avatar" + let people = "room_details-people" } struct SessionVerificationScreen { let requestVerification = "session_verification-request_verification" let startSasVerification = "session_verification-start_sas_verification" let acceptChallenge = "session_verification-accept_challenge" - let declineChallenge = "session_verification-accept_challenge" + let declineChallenge = "session_verification-decline_challenge" let close = "session_verification-close" } diff --git a/ElementX/Sources/Screens/RoomDetails/View/RoomDetailsScreen.swift b/ElementX/Sources/Screens/RoomDetails/View/RoomDetailsScreen.swift index bae92a2ea..b69817909 100644 --- a/ElementX/Sources/Screens/RoomDetails/View/RoomDetailsScreen.swift +++ b/ElementX/Sources/Screens/RoomDetails/View/RoomDetailsScreen.swift @@ -52,6 +52,7 @@ struct RoomDetailsScreen: View { contentID: context.viewState.roomId, avatarSize: .room(on: .details), imageProvider: context.imageProvider) + .accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.avatar) Text(context.viewState.title) .foregroundColor(.element.primaryContent) @@ -119,6 +120,7 @@ struct RoomDetailsScreen: View { } .listRowInsets(listRowInsets) .foregroundColor(.element.primaryContent) + .accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.people) .disabled(context.viewState.isLoadingMembers) } header: { Text(ElementL10n.roomDetailsAboutSectionTitle) diff --git a/ElementX/Sources/UITests/UITestsAppCoordinator.swift b/ElementX/Sources/UITests/UITestsAppCoordinator.swift index c82aa96d1..af4cf0bbf 100644 --- a/ElementX/Sources/UITests/UITestsAppCoordinator.swift +++ b/ElementX/Sources/UITests/UITestsAppCoordinator.swift @@ -34,13 +34,13 @@ class UITestsAppCoordinator: AppCoordinatorProtocol { } func start() { + Bundle.elementFallbackLanguage = "en" + guard let screenID = Tests.screenID else { fatalError("Unable to launch with unknown screen.") } let mockScreen = MockScreen(id: screenID) navigationRootCoordinator.setRootCoordinator(mockScreen.coordinator) self.mockScreen = mockScreen - - Bundle.elementFallbackLanguage = "en" } func toPresentable() -> AnyView { diff --git a/UITests/Sources/Application.swift b/UITests/Sources/Application.swift index 94d594251..503da5844 100644 --- a/UITests/Sources/Application.swift +++ b/UITests/Sources/Application.swift @@ -24,7 +24,10 @@ struct Application { "IS_RUNNING_UI_TESTS": "1", "UI_TESTS_SCREEN": identifier.rawValue ] + + // Use the same fallback language as the real app so translation comparison works Bundle.elementFallbackLanguage = "en" + app.launch() return app } diff --git a/UITests/Sources/RoomDetailsScreenUITests.swift b/UITests/Sources/RoomDetailsScreenUITests.swift index 846300e92..e6e47d082 100644 --- a/UITests/Sources/RoomDetailsScreenUITests.swift +++ b/UITests/Sources/RoomDetailsScreenUITests.swift @@ -21,14 +21,16 @@ class RoomDetailsScreenUITests: XCTestCase { func testInitialStateComponents() { let app = Application.launch(.roomDetailsScreen) - XCTAssert(app.staticTexts[A11yIdentifiers.roomScreen.avatar].exists) + XCTAssert(app.staticTexts[A11yIdentifiers.roomDetailsScreen.avatar].exists) + XCTAssert(app.buttons[A11yIdentifiers.roomDetailsScreen.people].waitForExistence(timeout: 1)) app.assertScreenshot(.roomDetailsScreen) } func testInitialStateComponentsWithRoomAvatar() { let app = Application.launch(.roomDetailsScreenWithRoomAvatar) - XCTAssert(app.images[A11yIdentifiers.roomScreen.avatar].waitForExistence(timeout: 1)) + XCTAssert(app.images[A11yIdentifiers.roomDetailsScreen.avatar].waitForExistence(timeout: 1)) + XCTAssert(app.buttons[A11yIdentifiers.roomDetailsScreen.people].waitForExistence(timeout: 1)) app.assertScreenshot(.roomDetailsScreenWithRoomAvatar) } } diff --git a/UITests/SupportingFiles/UITests.xctestplan b/UITests/SupportingFiles/UITests.xctestplan index e7ea48c2c..a95a05b29 100644 --- a/UITests/SupportingFiles/UITests.xctestplan +++ b/UITests/SupportingFiles/UITests.xctestplan @@ -53,7 +53,6 @@ }, "testTargets" : [ { - "parallelizable" : true, "target" : { "containerPath" : "container:ElementX.xcodeproj", "identifier" : "0E28CD62691FDBC63147D5E3",