Repository Public
1// Author: Simon-Pierre Boucher — contact@spboucher.ai2// File: Tests/LocalChatIOSUITests/IOSSmokeTests.swift3// Description: UI smoke tests of the iOS / iPadOS app in the Simulator on a throw-away store: launch, tabs or sidebar sections, new chat, composer.4import XCTest56final class IOSSmokeTests: XCTestCase {7 @MainActor func testLaunchNavigateAndCompose() throws {8 let app = XCUIApplication()9 app.launchArguments = ["-LCEphemeral"]10 app.launch()11 let newChat = app.buttons["new-chat"].firstMatch12 XCTAssertTrue(newChat.waitForExistence(timeout: 30))13 if app.tabBars.firstMatch.exists {14 for tab in ["Models", "Studio", "Settings", "Chats"] { app.tabBars.buttons[tab].tap() }15 } else {16 for section in ["models", "arena", "observatory", "knowledge", "agents", "settings", "chat"] { app.buttons["section-\(section)"].firstMatch.tap() }17 }18 newChat.tap()19 let field = app.textFields["composer-field"].firstMatch.exists ? app.textFields["composer-field"].firstMatch : app.textViews["composer-field"].firstMatch20 XCTAssertTrue(field.waitForExistence(timeout: 10))21 field.tap(); field.typeText("Hello from the UI test")22 XCTAssertTrue(app.buttons["send-button"].firstMatch.isEnabled)23 }24}25