Fix flaky UI tests: increase calendar wait timeouts and disable parallel UI testing
Calendar navigation buttons used shortTimeout (5s) which was too tight under simulator load, causing cascading failures in wizard and trip saving tests. Bumped to defaultTimeout (15s) and disabled parallel execution for UI tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
</TestableReference>
|
</TestableReference>
|
||||||
<TestableReference
|
<TestableReference
|
||||||
skipped = "NO"
|
skipped = "NO"
|
||||||
parallelizable = "YES">
|
parallelizable = "NO">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "1CA7F90D2F0D647400490ABD"
|
BlueprintIdentifier = "1CA7F90D2F0D647400490ABD"
|
||||||
|
|||||||
@@ -253,20 +253,20 @@ struct TripWizardScreen {
|
|||||||
let targetIdx = monthOrder.firstIndex(of: targetMonth) {
|
let targetIdx = monthOrder.firstIndex(of: targetMonth) {
|
||||||
if currentIdx > targetIdx {
|
if currentIdx > targetIdx {
|
||||||
previousMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
previousMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
previousMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
previousMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
} else if currentIdx < targetIdx {
|
} else if currentIdx < targetIdx {
|
||||||
nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
}
|
}
|
||||||
monthAttempts += 1
|
monthAttempts += 1
|
||||||
}
|
}
|
||||||
@@ -280,27 +280,27 @@ struct TripWizardScreen {
|
|||||||
let startFallback = dayCells.element(boundBy: 0)
|
let startFallback = dayCells.element(boundBy: 0)
|
||||||
let endFallback = dayCells.element(boundBy: min(4, max(1, dayCells.count - 1)))
|
let endFallback = dayCells.element(boundBy: min(4, max(1, dayCells.count - 1)))
|
||||||
startFallback.scrollIntoView(in: app.scrollViews.firstMatch)
|
startFallback.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
startFallback.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
startFallback.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
endFallback.scrollIntoView(in: app.scrollViews.firstMatch)
|
endFallback.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
endFallback.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
endFallback.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select start date — scroll calendar grid into view first
|
// Select start date — scroll calendar grid into view first
|
||||||
startBtn.scrollIntoView(in: app.scrollViews.firstMatch)
|
startBtn.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
startBtn.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
startBtn.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
|
|
||||||
// Select end date
|
// Select end date
|
||||||
let endBtn = dayButton(endDay)
|
let endBtn = dayButton(endDay)
|
||||||
if endBtn.exists {
|
if endBtn.exists {
|
||||||
endBtn.scrollIntoView(in: app.scrollViews.firstMatch)
|
endBtn.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
endBtn.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
endBtn.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
} else {
|
} else {
|
||||||
let dayCells = app.buttons.matching(NSPredicate(format: "identifier BEGINSWITH 'wizard.dates.day.'"))
|
let dayCells = app.buttons.matching(NSPredicate(format: "identifier BEGINSWITH 'wizard.dates.day.'"))
|
||||||
guard dayCells.count > 1 else { return }
|
guard dayCells.count > 1 else { return }
|
||||||
let fallback = dayCells.element(boundBy: min(4, max(1, dayCells.count - 1)))
|
let fallback = dayCells.element(boundBy: min(4, max(1, dayCells.count - 1)))
|
||||||
fallback.scrollIntoView(in: app.scrollViews.firstMatch)
|
fallback.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
fallback.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
fallback.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ final class TripWizardFlowTests: BaseUITestCase {
|
|||||||
// Navigate forward 3 times
|
// Navigate forward 3 times
|
||||||
for _ in 0..<3 {
|
for _ in 0..<3 {
|
||||||
wizard.nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
wizard.nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
wizard.nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
wizard.nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Month label should have changed
|
// Month label should have changed
|
||||||
@@ -113,14 +113,14 @@ final class TripWizardFlowTests: BaseUITestCase {
|
|||||||
// Go forward 3 months
|
// Go forward 3 months
|
||||||
for _ in 0..<3 {
|
for _ in 0..<3 {
|
||||||
wizard.nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
wizard.nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
wizard.nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
wizard.nextMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
}
|
}
|
||||||
|
|
||||||
let afterForward = wizard.monthLabel.label
|
let afterForward = wizard.monthLabel.label
|
||||||
|
|
||||||
// Go back 1 month
|
// Go back 1 month
|
||||||
wizard.previousMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
wizard.previousMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
|
||||||
wizard.previousMonthButton.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
wizard.previousMonthButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
|
||||||
|
|
||||||
XCTAssertNotEqual(wizard.monthLabel.label, afterForward,
|
XCTAssertNotEqual(wizard.monthLabel.label, afterForward,
|
||||||
"Month should change after navigating backward")
|
"Month should change after navigating backward")
|
||||||
|
|||||||
Reference in New Issue
Block a user