Fixed UI test problems introduced after the accessibility identifier … (#586)

* Fixed UI test problems introduced after the accessibility identifier changes
* Disable parallel UITests, they don't seem to work properly
* Fix UITests `elementFallbackLanguage`
This commit is contained in:
Stefan Ceriu
2023-02-16 12:42:50 +02:00
committed by GitHub
parent e91e0513b6
commit f44075e67e
6 changed files with 20 additions and 8 deletions
@@ -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"
}
@@ -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)
@@ -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 {