Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1c37bb7d7 | ||
|
|
d2466d9a66 | ||
|
|
4af2d96294 | ||
|
|
d17aa962ce |
@@ -36,6 +36,7 @@ final class Milestone2UITests: XCTestCase {
|
||||
"ICCERY_UI_TESTING": "1",
|
||||
"ICCERY_TEST_ROOT": testRoot.path,
|
||||
"ICCERY_ARGYLL_BINARY_DIR": binDir.path,
|
||||
"ICCERY_CUPS_BIN_DIR": binDir.path,
|
||||
"ICCERY_TEST_SAVE_TARGET":
|
||||
workDir.appendingPathComponent("mytarget.ti1").path,
|
||||
"ICCERY_TEST_WORKDIR": workDir.path,
|
||||
@@ -218,11 +219,12 @@ final class Milestone2UITests: XCTestCase {
|
||||
XCTAssertTrue(FileManager.default.fileExists(
|
||||
atPath: workDir.appendingPathComponent("mytarget.ti2").path))
|
||||
|
||||
// Print panel is live from M3; a default printer is selected
|
||||
// so both the all-pages and per-page print buttons are enabled.
|
||||
// Print panel is live from M3. GitHub macos-14 has no system
|
||||
// queues, so mock CUPS (`ICCERY_CUPS_BIN_DIR`) must enumerate
|
||||
// before Print All / per-page enable (run 34867767434).
|
||||
XCTAssertTrue(element("rawPrintPanel").exists)
|
||||
XCTAssertTrue(app.buttons["btnPrintAll"].isEnabled)
|
||||
XCTAssertTrue(app.buttons["btnPrintPage-0"].isEnabled)
|
||||
_ = waitUntilEnabled("btnPrintAll", timeout: 15)
|
||||
_ = waitUntilEnabled("btnPrintPage-0", timeout: 15)
|
||||
XCTAssertTrue(app.buttons["btnAdvanceToStage3"].isEnabled)
|
||||
}
|
||||
|
||||
|
||||
@@ -154,15 +154,34 @@ final class Milestone4UITests: XCTestCase {
|
||||
|
||||
/// Runs the mock handheld chartread session to completion
|
||||
/// (start → calibrate → strip A → strip B → Done & Save).
|
||||
///
|
||||
/// `isEnabled` can be true in AX while the SwiftUI action is still
|
||||
/// a no-op (runs 35251, 35443). Re-click until the session is
|
||||
/// actually running (`btnCancel` is shown whenever
|
||||
/// `isChartreadRunning`), then wait for Calibrate.
|
||||
private func driveOnePass(startButton: String) {
|
||||
let start = app.buttons[startButton]
|
||||
XCTAssertTrue(start.waitForExistence(timeout: 10))
|
||||
let deadline = Date().addingTimeInterval(10)
|
||||
while Date() < deadline, !start.isEnabled {
|
||||
XCTAssertTrue(start.waitForExistence(timeout: 10), startButton)
|
||||
let enabledBy = Date().addingTimeInterval(10)
|
||||
while Date() < enabledBy, !start.isEnabled {
|
||||
RunLoop.current.run(until: Date().addingTimeInterval(0.1))
|
||||
}
|
||||
XCTAssertTrue(start.isEnabled)
|
||||
start.click()
|
||||
XCTAssertTrue(start.isEnabled, "\(startButton) never enabled")
|
||||
|
||||
let sessionBy = Date().addingTimeInterval(25)
|
||||
while Date() < sessionBy, !chartreadSessionRunning {
|
||||
if start.exists, start.isEnabled {
|
||||
start.click()
|
||||
}
|
||||
RunLoop.current.run(until: Date().addingTimeInterval(0.4))
|
||||
}
|
||||
XCTAssertTrue(
|
||||
chartreadSessionRunning,
|
||||
"\(startButton) click never started chartread; "
|
||||
+ "notice=\(element("noticeText").value as? String ?? "") "
|
||||
+ "start.exists=\(start.exists)"
|
||||
)
|
||||
|
||||
_ = waitFor("btnCalibrate", timeout: 25)
|
||||
app.buttons["btnCalibrate"].click()
|
||||
driveStripsUntilDone()
|
||||
@@ -170,6 +189,14 @@ final class Milestone4UITests: XCTestCase {
|
||||
app.buttons["btnDoneRead"].firstMatch.click()
|
||||
}
|
||||
|
||||
/// `btnCancel` is in the tree for the whole chartread session;
|
||||
/// Calibrate/Trigger only appear after the first classified prompt.
|
||||
private var chartreadSessionRunning: Bool {
|
||||
element("btnCancel").exists
|
||||
|| element("btnCalibrate").exists
|
||||
|| element("btnTrigger").exists
|
||||
}
|
||||
|
||||
/// Clicks Trigger for each remaining strip until `btnDoneRead`
|
||||
/// appears — the button is re-polled each pass so a click that
|
||||
/// races a state transition isn't lost.
|
||||
|
||||
Reference in New Issue
Block a user