diff --git a/HealthGPT/HealthGPT/HealthGPTView.swift b/HealthGPT/HealthGPT/HealthGPTView.swift index 090c54e..b8020cb 100644 --- a/HealthGPT/HealthGPT/HealthGPTView.swift +++ b/HealthGPT/HealthGPT/HealthGPTView.swift @@ -8,10 +8,10 @@ import SpeziChat import SpeziLLM +import SpeziLLMLocal import SpeziLLMOpenAI import SpeziSpeechSynthesizer import SwiftUI -import SpeziLLMLocal struct HealthGPTView: View { diff --git a/HealthGPT/Onboarding/LLMSource.swift b/HealthGPT/Onboarding/LLMSource.swift index 427d274..0347059 100644 --- a/HealthGPT/Onboarding/LLMSource.swift +++ b/HealthGPT/Onboarding/LLMSource.swift @@ -10,8 +10,8 @@ import Foundation enum LLMSource: String, CaseIterable, Identifiable, Codable { - case local case openai + case local var id: String { self.rawValue diff --git a/HealthGPT/Onboarding/LLMSourceSelection.swift b/HealthGPT/Onboarding/LLMSourceSelection.swift index c14bed0..6a25b56 100644 --- a/HealthGPT/Onboarding/LLMSourceSelection.swift +++ b/HealthGPT/Onboarding/LLMSourceSelection.swift @@ -48,6 +48,7 @@ struct LLMSourceSelection: View { } } .pickerStyle(.inline) + .accessibilityIdentifier("llmSourcePicker") } } diff --git a/HealthGPTUITests/OnboardingUITests.swift b/HealthGPTUITests/OnboardingUITests.swift index d0d0d51..0d23c15 100644 --- a/HealthGPTUITests/OnboardingUITests.swift +++ b/HealthGPTUITests/OnboardingUITests.swift @@ -43,6 +43,7 @@ extension XCUIApplication { func navigateOnboardingFlow(assertThatHealthKitConsentIsShown: Bool = true) throws { try navigateOnboardingFlowWelcome() try navigateOnboardingFlowDisclaimer() + try navigateOnboardingFlowLLMSourceSelection() try navigateOnboardingFlowApiKey() try navigateOnboardingFlowModelSelection() try navigateOnboardingFlowHealthKitAccess(assertThatHealthKitConsentIsShown: assertThatHealthKitConsentIsShown) @@ -66,6 +67,17 @@ extension XCUIApplication { XCTAssertTrue(buttons["I Agree"].waitForExistence(timeout: 10)) buttons["I Agree"].tap() } + + private func navigateOnboardingFlowLLMSourceSelection() throws { + XCTAssertTrue(staticTexts["LLM Source Selection"].waitForExistence(timeout: 5)) + + let picker = pickers["llmSourcePicker"] + let optionToSelect = picker.pickerWheels.element(boundBy: 0) + optionToSelect.adjust(toPickerWheelValue: "Open AI LLM") + + XCTAssertTrue(buttons["Save Choice"].waitForExistence(timeout: 5)) + buttons["Save Choice"].tap() + } private func navigateOnboardingFlowApiKey() throws { try textFields["OpenAI API Key"].enter(value: "sk-123456789")