Download this file
| 1 | import XCTest |
| 2 | @MainActor final class NativeUITests: XCTestCase { |
| 3 | func testNativeFormAndNavigation() { |
| 4 | let app=XCUIApplication();app.launch() |
| 5 | XCTAssertTrue(app.buttons["Add note"].waitForExistence(timeout: 10)) |
| 6 | |
| 7 | app.buttons["Add note"].tap() |
| 8 | let title=app.textFields["Title"] |
| 9 | XCTAssertTrue(title.waitForExistence(timeout: 5)); title.tap(); title.typeText("Native UI note") |
| 10 | let body=app.textViews.firstMatch;body.tap();body.typeText("A new note created through the native iPhone form.") |
| 11 | app.buttons["Save"].tap() |
| 12 | let result = app.cells.containing(.staticText, identifier: "Native UI note").firstMatch |
| 13 | XCTAssertTrue(result.waitForExistence(timeout: 10)) |
| 14 | // Independent reviewer mutation, 2026-09-12: removing this tap fails the |
| 15 | // detail-only sourcePassage assertions on iPad. Observed red, then restored. |
| 16 | result.tap() |
| 17 | if app.windows.firstMatch.frame.width < 600 { |
| 18 | XCTAssertTrue(app.navigationBars["Source"].waitForExistence(timeout: 5)) |
| 19 | } |
| 20 | let source = app.staticTexts["sourcePassage"] |
| 21 | XCTAssertTrue(source.waitForExistence(timeout: 5)) |
| 22 | XCTAssertEqual(source.label, "A new note created through the native iPhone form.") |
| 23 | |
| 24 | let capture=XCTAttachment(screenshot: app.screenshot());capture.lifetime = .keepAlways;add(capture) |
| 25 | } |
| 26 | } |
| 27 | |