mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Integration test improvements (#3330)
* Send a message from integration tests and check that it doesn't show up in the app logs * Increase photo library timeout * Wait for image tapping to process * Send a message using the rich text editor too * Wait for the various pickers to finish loading * Set all logs to `trace` in integration tests * Close formatting options after sending the second message * Make sure logs are actually sent to tracing and get redirected to the right file * Switch from using a custom `trace` log configuration to the lowest level `TracingConfiguration` we support
This commit is contained in:
@@ -126,6 +126,9 @@ enum A11yIdentifiers {
|
||||
let timelineItemActionMenu = "room-timeline_item_action_menu"
|
||||
let joinCall = "room-join_call"
|
||||
let scrollToBottom = "room-scroll_to_bottom"
|
||||
|
||||
let messageComposer = "room-message_composer"
|
||||
let sendButton = "room-send_button"
|
||||
|
||||
let composerToolbar = ComposerToolbar()
|
||||
|
||||
|
||||
@@ -13,7 +13,13 @@ enum RustTracing {
|
||||
/// name and other log management metadata during rotation.
|
||||
static let filePrefix = "console"
|
||||
/// The directory that stores all of the log files.
|
||||
static var logsDirectory: URL { .appGroupContainerDirectory }
|
||||
static var logsDirectory: URL {
|
||||
if ProcessInfo.isRunningIntegrationTests {
|
||||
"/Users/Shared"
|
||||
} else {
|
||||
.appGroupContainerDirectory
|
||||
}
|
||||
}
|
||||
|
||||
private(set) static var currentTracingConfiguration: TracingConfiguration?
|
||||
static func setup(configuration: TracingConfiguration) {
|
||||
@@ -23,7 +29,15 @@ enum RustTracing {
|
||||
// as the app is unlikely to be running continuously.
|
||||
let maxFiles: UInt64 = 24 * 7
|
||||
|
||||
setupTracing(config: .init(filter: configuration.filter,
|
||||
// Log everything on integration tests to check whether
|
||||
// the logs contain any sensitive data. See `UserFlowTests.swift`
|
||||
let filter = if ProcessInfo.isRunningIntegrationTests {
|
||||
TracingConfiguration(logLevel: .trace, target: nil).filter
|
||||
} else {
|
||||
configuration.filter
|
||||
}
|
||||
|
||||
setupTracing(config: .init(filter: filter,
|
||||
writeToStdoutOrSystem: true,
|
||||
writeToFiles: .init(path: logsDirectory.path(percentEncoded: false),
|
||||
filePrefix: configuration.fileName,
|
||||
|
||||
@@ -143,6 +143,7 @@ struct ComposerToolbar: View {
|
||||
.disabled(context.viewState.sendButtonDisabled)
|
||||
.animation(.linear(duration: 0.1).disabledDuringTests(), value: context.viewState.sendButtonDisabled)
|
||||
.keyboardShortcut(.return, modifiers: [.command])
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.sendButton)
|
||||
}
|
||||
|
||||
private var messageComposer: some View {
|
||||
@@ -174,6 +175,7 @@ struct ComposerToolbar: View {
|
||||
.focused($composerFocused)
|
||||
.padding(.leading, context.composerFormattingEnabled ? 7 : 0)
|
||||
.padding(.trailing, context.composerFormattingEnabled ? 4 : 0)
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.messageComposer)
|
||||
.onTapGesture {
|
||||
guard !composerFocused else { return }
|
||||
composerFocused = true
|
||||
|
||||
Reference in New Issue
Block a user