Skip to content

Commit

Permalink
macOS UI test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
philippzagar committed Dec 21, 2024
1 parent 71c452e commit 60537e0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Tests/UITests/TestAppUITests/TestAppUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ class TestAppUITests: XCTestCase {
}

func testChatExport() throws { // swiftlint:disable:this function_body_length
// Skip chat export test on visionOS and macOS
#if os(visionOS)
throw XCTSkip("VisionOS is unstable and are skipped at the moment")
#elseif os(macOS)
throw XCTSkip("macOS export to a file is not possible (regular sharesheet is)")
#endif

let app = XCUIApplication()

Check warning on line 50 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

code after 'throw' will never be executed

Check warning on line 50 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

code after 'throw' will never be executed

Check warning on line 50 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

code after 'throw' will never be executed
let filesApp = XCUIApplication(bundleIdentifier: "com.apple.DocumentsApp")
let maxRetries = 10
Expand Down Expand Up @@ -150,8 +153,12 @@ class TestAppUITests: XCTestCase {
XCTAssert(app.staticTexts["SpeziChat"].waitForExistence(timeout: 1))
XCTAssert(app.buttons["Speaker strikethrough"].waitForExistence(timeout: 2))
XCTAssert(!app.buttons["Speaker"].waitForExistence(timeout: 2))


#if os(macOS)
app.buttons["Speaker strikethrough"].firstMatch.tap() // on macOS, need to match for first speaker that is found
#else
app.buttons["Speaker strikethrough"].tap()
#endif

XCTAssert(!app.buttons["Speaker strikethrough"].waitForExistence(timeout: 2))
XCTAssert(app.buttons["Speaker"].waitForExistence(timeout: 2))
Expand Down

0 comments on commit 60537e0

Please sign in to comment.