also looking at this
fix(native): preserve workspace sources and native overlay lifecycle
#384
20 files
+500
-227
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -11,9 +11,9 @@ final class NativeRenderUITests: XCTestCase { | ||
| 11 | 11 | /// The typed value itself is checked at once; only its echo is waited |
| 12 | 12 | /// for, and a missing last keystroke still fails after `timeout`. |
| 13 | 13 | @discardableResult |
| 14 | private func waitForLabel(_ element: XCUIElement, _ expected: String, timeout: TimeInterval = 3, file: StaticString = #filePath, line: UInt = #line) -> Bool { | |
| 14 | private func waitForLabel(_ element: XCUIElement, _ expected: String, timeout: TimeInterval = 10, file: StaticString = #filePath, line: UInt = #line) -> Bool { | |
| 15 | 15 | let matched = XCTWaiter().wait(for: [XCTNSPredicateExpectation(predicate: NSPredicate(format: "label == %@", expected), object: element)], timeout: timeout) == .completed |
| 16 | XCTAssertTrue(matched, "\(element.identifier) reads \"\(element.label)\", not \"\(expected)\", \(timeout)s after typing", file: file, line: line) | |
| 16 | XCTAssertTrue(matched, "\(element.identifier) reads \(String(reflecting: element.label)), not \(String(reflecting: expected)), \(timeout)s after typing", file: file, line: line) | |
| 17 | 17 | return matched |
| 18 | 18 | } |
| 19 | 19 | |
| @@ -147,6 +147,14 @@ final class NotificationTapColdStartTests: XCTestCase { | ||
| 147 | 147 | .firstMatch |
| 148 | 148 | XCTAssertTrue(banner.waitForExistence(timeout: timeout), "no banner for \(text) ever appeared") |
| 149 | 149 | banner.tap() |
| 150 | XCTAssertTrue(app.wait(for: .runningForeground, timeout: 60), "tapping the banner did not start the app") | |
| 150 | // SpringBoard can leave an app launched by a notification in the | |
| 151 | // background while it finishes dismissing the banner. Give that | |
| 152 | // launch a short chance to reach the foreground itself, then activate | |
| 153 | // the already-running process. Activating a not-running app is not a | |
| 154 | // fallback: the final wait still proves the notification tap launched | |
| 155 | // it rather than hiding a missed banner behind a fresh launch. | |
| 156 | if app.wait(for: .runningForeground, timeout: 10) { return } | |
| 157 | if app.state == .runningBackground { app.activate() } | |
| 158 | XCTAssertTrue(app.wait(for: .runningForeground, timeout: 50), "tapping the banner did not start the app") | |
| 151 | 159 | } |
| 152 | 160 | } |