mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Check more screens in the integration tests. Refactor flows
This commit is contained in:
committed by
Stefan Ceriu
parent
7becf6d0af
commit
569620c52f
@@ -35,6 +35,7 @@ struct A11yIdentifiers {
|
||||
static let roomMemberDetailsScreen = RoomMemberDetailsScreen()
|
||||
static let createRoomScreen = CreateRoomScreen()
|
||||
static let invitesScreen = InvitesScreen()
|
||||
static let inviteUsersScreen = InviteUsersScreen()
|
||||
static let welcomeScreen = WelcomeScreen()
|
||||
static let migrationScreen = MigrationScreen()
|
||||
static let notificationSettingsScreen = NotificationSettingsScreen()
|
||||
@@ -66,6 +67,8 @@ struct A11yIdentifiers {
|
||||
let settings = "home_screen-settings"
|
||||
let signOut = "home_screen-sign_out"
|
||||
let verificationBannerContinue = "home_screen-verification_continue"
|
||||
let invites = "home_screen-invites"
|
||||
let startChat = "home_screen-start_chat"
|
||||
|
||||
let roomNamePrefix = "home_screen-room_name"
|
||||
func roomName(_ name: String) -> String {
|
||||
@@ -79,6 +82,10 @@ struct A11yIdentifiers {
|
||||
let decline = "invites-decline"
|
||||
}
|
||||
|
||||
struct InviteUsersScreen {
|
||||
let proceed = "invite_users-proceed"
|
||||
}
|
||||
|
||||
struct LoginScreen {
|
||||
let emailUsername = "login-email_username"
|
||||
let password = "login-password"
|
||||
@@ -99,6 +106,10 @@ struct A11yIdentifiers {
|
||||
let name = "room-name"
|
||||
let avatar = "room-avatar"
|
||||
let attachmentPicker = "room-attachment_picker"
|
||||
let attachmentPickerPhotoLibrary = "room-attachment_picker_photo_library"
|
||||
let attachmentPickerDocuments = "room-attachment_picker_documents"
|
||||
let attachmentPickerCamera = "room-attachment_picker_camera"
|
||||
let attachmentPickerLocation = "room-attachment_picker_location"
|
||||
let timelineItemActionMenu = "room-timeline_item_action_menu"
|
||||
}
|
||||
|
||||
@@ -136,6 +147,13 @@ struct A11yIdentifiers {
|
||||
}
|
||||
|
||||
struct SettingsScreen {
|
||||
let done = "settings-done"
|
||||
let account = "settings-account"
|
||||
let notifications = "settings-notifications"
|
||||
let analytics = "settings-analytics"
|
||||
let reportBug = "settings-report_bug"
|
||||
let about = "settings_about"
|
||||
let developerOptions = "settings_developer-options"
|
||||
let logout = "settings-logout"
|
||||
}
|
||||
|
||||
@@ -153,6 +171,7 @@ struct A11yIdentifiers {
|
||||
|
||||
struct StartChatScreen {
|
||||
let closeStartChat = "start_chat-close"
|
||||
let createRoom = "start_chat-create_room"
|
||||
let inviteFriends = "start_chat-invite_friends"
|
||||
let searchNoResults = "start_chat-search_no_results"
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ struct RoomAttachmentPicker: View {
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceGallery, icon: Image(systemName: "photo.fill"))
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
|
||||
|
||||
Button {
|
||||
context.showAttachmentPopover = false
|
||||
@@ -46,6 +47,7 @@ struct RoomAttachmentPicker: View {
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceFiles, icon: Image(systemName: "paperclip"))
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
|
||||
|
||||
Button {
|
||||
context.showAttachmentPopover = false
|
||||
@@ -53,6 +55,7 @@ struct RoomAttachmentPicker: View {
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceCamera, icon: Image(systemName: "camera.fill"))
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerCamera)
|
||||
|
||||
Button {
|
||||
context.showAttachmentPopover = false
|
||||
@@ -60,6 +63,7 @@ struct RoomAttachmentPicker: View {
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceLocation, icon: Image(asset: Asset.Images.locationPin))
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerLocation)
|
||||
}
|
||||
.padding(.top, isPresented ? 20 : 0)
|
||||
.background {
|
||||
|
||||
@@ -119,6 +119,7 @@ struct HomeScreen: View {
|
||||
HomeScreenInvitesButton(title: L10n.actionInvitesList, hasBadge: context.viewState.hasUnreadPendingInvitations) {
|
||||
context.send(viewAction: .selectInvites)
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.homeScreen.invites)
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
.padding(.vertical, -8.0)
|
||||
}
|
||||
@@ -178,6 +179,7 @@ struct HomeScreen: View {
|
||||
} label: {
|
||||
Image(systemName: "square.and.pencil")
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.homeScreen.startChat)
|
||||
}
|
||||
|
||||
/// Often times the scroll view's content size isn't correct yet when this method is called e.g. when cancelling a search
|
||||
|
||||
@@ -29,6 +29,7 @@ struct HomeScreenUserMenuButton: View {
|
||||
} label: {
|
||||
Label(L10n.commonSettings, systemImage: "gearshape")
|
||||
}
|
||||
.accessibilityLabel(A11yIdentifiers.homeScreen.settings)
|
||||
}
|
||||
Section {
|
||||
MatrixUserShareLink(userID: context.viewState.userID) {
|
||||
|
||||
@@ -130,6 +130,7 @@ struct InviteUsersScreen: View {
|
||||
Button(context.viewState.actionText) {
|
||||
context.send(viewAction: .proceed)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.inviteUsersScreen.proceed)
|
||||
.disabled(context.viewState.isActionDisabled)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ struct SettingsScreen: View {
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .developerOptions)
|
||||
})
|
||||
.accessibilityIdentifier("developerOptionsButton")
|
||||
.accessibilityLabel(A11yIdentifiers.settingsScreen.developerOptions)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ struct SettingsScreen: View {
|
||||
kind: .button {
|
||||
context.send(viewAction: .account)
|
||||
})
|
||||
.accessibilityIdentifier("notificationsButton")
|
||||
.accessibilityLabel(A11yIdentifiers.settingsScreen.account)
|
||||
}
|
||||
|
||||
// Message layout
|
||||
@@ -130,7 +130,7 @@ struct SettingsScreen: View {
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .notifications)
|
||||
})
|
||||
.accessibilityIdentifier("notificationsButton")
|
||||
.accessibilityLabel(A11yIdentifiers.settingsScreen.notifications)
|
||||
}
|
||||
|
||||
// Analytics
|
||||
@@ -139,7 +139,7 @@ struct SettingsScreen: View {
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .analytics)
|
||||
})
|
||||
.accessibilityIdentifier("analyticsButton")
|
||||
.accessibilityLabel(A11yIdentifiers.settingsScreen.analytics)
|
||||
|
||||
// Report Bug
|
||||
ListRow(label: .default(title: L10n.commonReportABug,
|
||||
@@ -147,7 +147,7 @@ struct SettingsScreen: View {
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .reportBug)
|
||||
})
|
||||
.accessibilityIdentifier("reportBugButton")
|
||||
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.reportBug)
|
||||
|
||||
// About
|
||||
ListRow(label: .default(title: L10n.commonAbout,
|
||||
@@ -155,7 +155,7 @@ struct SettingsScreen: View {
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .about)
|
||||
})
|
||||
.accessibilityIdentifier("aboutButton")
|
||||
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.about)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,6 +191,7 @@ struct SettingsScreen: View {
|
||||
|
||||
private var doneButton: some View {
|
||||
Button(L10n.actionDone, action: close)
|
||||
.accessibilityLabel(A11yIdentifiers.settingsScreen.done)
|
||||
}
|
||||
|
||||
private func close() {
|
||||
|
||||
@@ -72,6 +72,7 @@ struct StartChatScreen: View {
|
||||
.imageScale(.small)
|
||||
}
|
||||
.buttonStyle(FormButtonStyle(accessory: .navigationLink))
|
||||
.accessibilityLabel(A11yIdentifiers.startChatScreen.createRoom)
|
||||
}
|
||||
.compoundFormSection()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user