add screenshots for UI test

This commit is contained in:
Flavio Alescio 2023-05-11 12:26:53 +02:00 committed by Flescio
parent f8b7b86641
commit da0b35ea6f
19 changed files with 75 additions and 2 deletions

View File

@ -30,6 +30,7 @@ struct A11yIdentifiers {
static let softLogoutScreen = SoftLogoutScreen() static let softLogoutScreen = SoftLogoutScreen()
static let startChatScreen = StartChatScreen() static let startChatScreen = StartChatScreen()
static let roomMemberDetailsScreen = RoomMemberDetailsScreen() static let roomMemberDetailsScreen = RoomMemberDetailsScreen()
static let createRoomScreen = CreateRoomScreen()
static let invitesScreen = InvitesScreen() static let invitesScreen = InvitesScreen()
struct AnalyticsPromptScreen { struct AnalyticsPromptScreen {
@ -130,4 +131,9 @@ struct A11yIdentifiers {
let inviteFriends = "start_chat-invite_friends" let inviteFriends = "start_chat-invite_friends"
let searchNoResults = "start_chat-search_no_results" let searchNoResults = "start_chat-search_no_results"
} }
struct CreateRoomScreen {
let roomName = "create-room-room-name"
let roomTopic = "create-room-room-topic"
}
} }

View File

@ -39,10 +39,8 @@ struct CreateRoomScreen: View {
roomSection roomSection
topicSection topicSection
if !context.viewState.selectedUsers.isEmpty { if !context.viewState.selectedUsers.isEmpty {
// TODO: check clipping outside form
selectedUsersSection selectedUsersSection
} }
// TODO: Spacer not working properly
Spacer() Spacer()
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
securitySection securitySection
@ -67,6 +65,7 @@ struct CreateRoomScreen: View {
text: $context.roomName, text: $context.roomName,
prompt: Text(L10n.screenCreateRoomRoomNamePlaceholder), prompt: Text(L10n.screenCreateRoomRoomNamePlaceholder),
axis: .horizontal) axis: .horizontal)
.accessibilityIdentifier(A11yIdentifiers.createRoomScreen.roomName)
.padding(EdgeInsets(top: 10, leading: 16, bottom: 10, trailing: 16)) .padding(EdgeInsets(top: 10, leading: 16, bottom: 10, trailing: 16))
.background(Color.element.formRowBackground) .background(Color.element.formRowBackground)
.clipShape(RoundedRectangle(cornerRadius: 8)) .clipShape(RoundedRectangle(cornerRadius: 8))
@ -84,6 +83,7 @@ struct CreateRoomScreen: View {
text: $context.roomTopic, text: $context.roomTopic,
prompt: Text(L10n.screenCreateRoomTopicPlaceholder), prompt: Text(L10n.screenCreateRoomTopicPlaceholder),
axis: .vertical) axis: .vertical)
.accessibilityIdentifier(A11yIdentifiers.createRoomScreen.roomTopic)
.lineLimit(3, reservesSpace: false) .lineLimit(3, reservesSpace: false)
} header: { } header: {
Text(L10n.screenCreateRoomTopicLabel) Text(L10n.screenCreateRoomTopicLabel)

View File

@ -27,4 +27,23 @@ class CreateRoomScreenUITests: XCTestCase {
let app = Application.launch(.createRoomNoUsers) let app = Application.launch(.createRoomNoUsers)
app.assertScreenshot(.createRoom, step: 1) app.assertScreenshot(.createRoom, step: 1)
} }
func testLongInputNameText() {
let app = Application.launch(.createRoom)
let roomName: String
if UIDevice.current.userInterfaceIdiom == .pad {
roomName = "Room name very very very very very very very very very very very very very very very very long"
} else {
roomName = "Room name very very very very long"
}
app.textFields[A11yIdentifiers.createRoomScreen.roomName].clearAndTypeText(roomName)
app.assertScreenshot(.createRoom, step: 2)
}
func testLongInputTopicText() {
let app = Application.launch(.createRoom)
let roomTopic = "Room topic\nvery\nvery\nvery long"
app.textViews[A11yIdentifiers.createRoomScreen.roomTopic].clearAndTypeText(roomTopic)
app.assertScreenshot(.createRoom, step: 3)
}
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.