From 217c273dd2266d774ec5cfea9b111424aba15599 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sun, 11 Oct 2026 00:54:36 +0700 Subject: [PATCH] test(connections): match the mixed checkbox value XCUITest reports --- TableProUITests/ConnectionImportReviewUITests.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TableProUITests/ConnectionImportReviewUITests.swift b/TableProUITests/ConnectionImportReviewUITests.swift index 5a5d69ed35..411a07c3c4 100644 --- a/TableProUITests/ConnectionImportReviewUITests.swift +++ b/TableProUITests/ConnectionImportReviewUITests.swift @@ -1,3 +1,4 @@ +import AppKit import XCTest final class ConnectionImportReviewUITests: UITestCase { @@ -78,10 +79,10 @@ final class ConnectionImportReviewUITests: UITestCase { return (app, sheet) } + // XCUITest reports a mixed checkbox as NSControl.StateValue.mixed (-1), not the AXValue of 2. private func isMixed(_ checkbox: XCUIElement) -> Bool { - if let number = checkbox.value as? Int { return number == 2 } - let text = (checkbox.value as? String) ?? "" - return text == "2" || text.lowercased() == "mixed" + if let number = checkbox.value as? Int { return number == NSControl.StateValue.mixed.rawValue } + return (checkbox.value as? String) == String(NSControl.StateValue.mixed.rawValue) } private static func text(_ string: String) -> NSPredicate {