Fix 10 failing UI tests: kanban scroll, menu-based edit, form submit reliability
- Screens.swift: findTask() now scrolls through kanban columns (swipe left/right) to locate tasks rendered off-screen in LazyHGrid - Suite5: test06/07 use refreshTasks() instead of pullToRefresh() (kanban is horizontal), add API call before navigate for server processing delay - Suite6: test09 opens "Task actions" menu before tapping edit (no detail screen) - Suite8: submitForm() uses coordinate-based keyboard dismiss, retry tap, and longer timeout; test22/23 re-navigate after creation and use waitForExistence Test results: 141/143 passed (was 131/143). Remaining 2 failures are pre-existing (Suite1 test11) and flaky/unrelated (Suite3 testR307). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,28 @@ struct TaskListScreen {
|
||||
}
|
||||
|
||||
func findTask(title: String) -> XCUIElement {
|
||||
app.staticTexts.containing(NSPredicate(format: "label CONTAINS %@", title)).firstMatch
|
||||
let predicate = NSPredicate(format: "label CONTAINS %@", title)
|
||||
let match = app.staticTexts.containing(predicate).firstMatch
|
||||
|
||||
// If found immediately, return
|
||||
if match.waitForExistence(timeout: 3) { return match }
|
||||
|
||||
// Scroll through kanban columns (swipe left up to 6 times)
|
||||
let scrollView = app.scrollViews.firstMatch
|
||||
guard scrollView.exists else { return match }
|
||||
|
||||
for _ in 0..<6 {
|
||||
scrollView.swipeLeft()
|
||||
if match.waitForExistence(timeout: 1) { return match }
|
||||
}
|
||||
|
||||
// Scroll back and try right direction
|
||||
for _ in 0..<6 {
|
||||
scrollView.swipeRight()
|
||||
if match.waitForExistence(timeout: 1) { return match }
|
||||
}
|
||||
|
||||
return match
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user