import XCTest @MainActor final class NativeUITests: XCTestCase { func testNativeFormAndNavigation() { let app=XCUIApplication();app.launch() XCTAssertTrue(app.buttons["New event"].waitForExistence(timeout: 10)) app.buttons["New event"].tap() let title=app.textFields["eventTitle"] XCTAssertTrue(title.waitForExistence(timeout: 5)); title.tap(); title.typeText("Native UI event") app.buttons["Save"].tap() XCTAssertTrue(app.staticTexts["Native UI event"].firstMatch.waitForExistence(timeout: 10)) app.staticTexts["Native UI event"].firstMatch.tap() XCTAssertTrue(app.buttons["Edit event"].waitForExistence(timeout: 5)) app.buttons["Edit event"].tap() XCTAssertTrue(app.textFields["eventTitle"].waitForExistence(timeout: 5)) app.buttons["Cancel"].tap() let capture=XCTAttachment(screenshot: app.screenshot());capture.lifetime = .keepAlways;add(capture) } func testQuickAddUsesPreview() { let app = XCUIApplication(); app.launch() XCTAssertTrue(app.buttons["Quick add"].waitForExistence(timeout: 10)) app.buttons["Quick add"].tap() let input = app.descendants(matching: .any)["quickAddText"].firstMatch XCTAssertTrue(input.waitForExistence(timeout: 5)); input.tap() input.typeText("Native quick lunch tomorrow at 1pm for an hour") let save = app.buttons["quickAddSave"] XCTAssertTrue(save.waitForExistence(timeout: 10)); save.tap() XCTAssertTrue(app.descendants(matching: .any)["quickAddSaved"].firstMatch.waitForExistence(timeout: 10)) app.buttons["Done"].tap() XCTAssertTrue(app.staticTexts["Native quick lunch"].firstMatch.waitForExistence(timeout: 10)) } }