Skip to content

Commit

Permalink
Fix UI tests on iPadOS
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi committed Jul 1, 2024
1 parent 7c137b7 commit 5b5dfc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Tests/UITests/TestApp/TestApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ struct UITestsApp: App {

var body: some Scene {
WindowGroup {
NavigationView {
NavigationStack {
MenuView()
}
.spezi(appDelegate)
.spezi(appDelegate)
}
}
}
Expand Down
19 changes: 8 additions & 11 deletions Tests/UITests/TestAppUITests/TestAppUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,28 @@ class TestAppUITests: XCTestCase {
app.launch()

XCTAssertTrue(app.staticTexts["Spezi Speech Tests"].waitForExistence(timeout: 1))

#if os(iOS)
try app.testSynthesisWithVoiceSelection()
#endif
}
}

extension XCUIApplication {

func testSynthesisWithVoiceSelection() throws {
let voiceSelectionTestViewButton = staticTexts["Speech Voice Selection Test View"]
let app = XCUIApplication()
app.launch()

let voiceSelectionTestViewButton = app.staticTexts["Speech Voice Selection Test View"]

XCTAssertTrue(voiceSelectionTestViewButton.waitForExistence(timeout: 1))
voiceSelectionTestViewButton.tap()

let picker = pickers["voicePicker"]
let picker = app.pickers["voicePicker"]
let optionToSelect = picker.pickerWheels.element(boundBy: 0)
optionToSelect.adjust(toPickerWheelValue: "Kathy")

Check failure on line 37 in Tests/UITests/TestAppUITests/TestAppUITests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests visionOS (Debug, TestApp-visionOS.xcresult, TestApp-visionOS.xcresult) / Test using xcodebuild or run fastlane

incorrect argument label in call (have 'toPickerWheelValue:', expected 'toNormalizedSliderPosition:')

Check failure on line 37 in Tests/UITests/TestAppUITests/TestAppUITests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests visionOS (Debug, TestApp-visionOS.xcresult, TestApp-visionOS.xcresult) / Test using xcodebuild or run fastlane

cannot convert value of type 'String' to expected argument type 'CGFloat'

Check failure on line 37 in Tests/UITests/TestAppUITests/TestAppUITests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests visionOS (Release, TestApp-visionOS-Release.xcresult, TestApp-visionOS-Re... / Test using xcodebuild or run fastlane

incorrect argument label in call (have 'toPickerWheelValue:', expected 'toNormalizedSliderPosition:')

Check failure on line 37 in Tests/UITests/TestAppUITests/TestAppUITests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests visionOS (Release, TestApp-visionOS-Release.xcresult, TestApp-visionOS-Re... / Test using xcodebuild or run fastlane

cannot convert value of type 'String' to expected argument type 'CGFloat'

Check failure on line 37 in Tests/UITests/TestAppUITests/TestAppUITests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests visionOS (Release, TestApp-visionOS-Release.xcresult, TestApp-visionOS-Re... / Test using xcodebuild or run fastlane

incorrect argument label in call (have 'toPickerWheelValue:', expected 'toNormalizedSliderPosition:')

Check failure on line 37 in Tests/UITests/TestAppUITests/TestAppUITests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests visionOS (Release, TestApp-visionOS-Release.xcresult, TestApp-visionOS-Re... / Test using xcodebuild or run fastlane

cannot convert value of type 'String' to expected argument type 'CGFloat'

let textField = textFields["Enter text to be spoken"]
let textField = app.textFields["Enter text to be spoken"]
XCTAssertTrue(textField.waitForExistence(timeout: 1))

textField.tap()
textField.typeText("Hello, this is a test of the Spezi Speech module.")

let speakButton = buttons["Speak"]
let speakButton = app.buttons["Speak"]
XCTAssertTrue(speakButton.waitForExistence(timeout: 1))
speakButton.tap()

Expand Down

0 comments on commit 5b5dfc7

Please sign in to comment.