53 lines
1.8 KiB
Swift
53 lines
1.8 KiB
Swift
import XCTest
|
|
|
|
final class MindDumpUITests: XCTestCase {
|
|
|
|
override func setUpWithError() throws {
|
|
continueAfterFailure = false
|
|
}
|
|
|
|
/// Tapping the MindDumpButton, entering a title and saving should show the entry in the list
|
|
@MainActor
|
|
func testQuickDump_createsEntry() throws {
|
|
let app = XCUIApplication()
|
|
app.launchArguments = ["UI_TESTING"]
|
|
app.launch()
|
|
|
|
// Tap the MindDumpButton button
|
|
app.buttons["🧠"].tap()
|
|
|
|
// Type a title in the editor sheet
|
|
let titleField = app.textFields["Titel"]
|
|
XCTAssertTrue(titleField.waitForExistence(timeout: 2))
|
|
titleField.typeText("UI Test Eintrag")
|
|
|
|
// Add a note
|
|
app.buttons["Notiz"].tap()
|
|
let noteField = app.textFields["Notiz hinzufügen..."]
|
|
XCTAssertTrue(noteField.waitForExistence(timeout: 2))
|
|
noteField.tap()
|
|
noteField.typeText("Wichtige Notiz")
|
|
|
|
// Add high priority — tap the add-field button, then the picker row, then the option
|
|
app.buttons["Priorität"].tap()
|
|
app.buttons["Priorität, 🟡 Mittel"].tap()
|
|
app.buttons["🔴 Hoch"].tap()
|
|
|
|
// Tap "Fertig" to save
|
|
app.buttons["Fertig"].tap()
|
|
|
|
// Navigate into Inbox to see the entry
|
|
app.staticTexts["Inbox"].tap()
|
|
|
|
// Verify the entry appears in the list
|
|
let entryExists = app.descendants(matching: .any)["UI Test Eintrag"].waitForExistence(timeout: 3)
|
|
XCTAssertTrue(entryExists, "Entry title should be visible")
|
|
|
|
// Verify the note snippet is shown below the title
|
|
XCTAssertTrue(app.descendants(matching: .any)["Wichtige Notiz"].exists, "Note should be visible")
|
|
|
|
// Verify the red priority dot is shown
|
|
XCTAssertTrue(app.images["circle.fill"].exists, "Priority dot should be visible")
|
|
}
|
|
}
|