Add 22 new UI tests across 8 test files covering Home, Schedule, Progress, Settings, TabNavigation, TripSaving, and TripOptions. Add accessibility identifiers to 11 view files for test element discovery. Fix sport chip assertion logic (all sports start selected, tap deselects), scroll container issues on iOS 26 nested ScrollViews, toggle interaction, and delete trip flow. Update QA coverage map from 32 to 54 automated test cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66 lines
1.9 KiB
Swift
66 lines
1.9 KiB
Swift
//
|
|
// StabilityTests.swift
|
|
// SportsTimeUITests
|
|
//
|
|
// Stability stress tests: rapid tab switching, wizard open/close.
|
|
// QA Sheet: P-014, P-015
|
|
//
|
|
|
|
import XCTest
|
|
|
|
final class StabilityTests: BaseUITestCase {
|
|
|
|
/// P-014: Rapidly switch between all 5 tabs 50 times — no crash.
|
|
@MainActor
|
|
func testP014_RapidTabSwitching() {
|
|
let home = HomeScreen(app: app)
|
|
home.waitForLoad()
|
|
|
|
let tabs = [home.scheduleTab, home.myTripsTab, home.progressTab,
|
|
home.settingsTab, home.homeTab]
|
|
|
|
for cycle in 0..<10 {
|
|
for tab in tabs {
|
|
tab.tap()
|
|
}
|
|
// Every 5 cycles, verify the app is still responsive
|
|
if cycle % 5 == 4 {
|
|
home.switchToTab(home.homeTab)
|
|
XCTAssertTrue(
|
|
home.startPlanningButton.waitForExistence(
|
|
timeout: BaseUITestCase.shortTimeout),
|
|
"App should remain responsive after \(cycle + 1) tab cycles"
|
|
)
|
|
}
|
|
}
|
|
|
|
captureScreenshot(named: "P014-RapidTabs-Complete")
|
|
}
|
|
|
|
/// P-015: Open and close the wizard 20 times — no crash, no memory growth.
|
|
@MainActor
|
|
func testP015_RapidWizardOpenClose() {
|
|
let home = HomeScreen(app: app)
|
|
home.waitForLoad()
|
|
|
|
for i in 0..<20 {
|
|
home.tapStartPlanning()
|
|
|
|
let wizard = TripWizardScreen(app: app)
|
|
wizard.waitForLoad()
|
|
wizard.tapCancel()
|
|
|
|
// Verify we're back on home
|
|
if i % 5 == 4 {
|
|
XCTAssertTrue(
|
|
home.startPlanningButton.waitForExistence(
|
|
timeout: BaseUITestCase.defaultTimeout),
|
|
"Should return to Home after wizard cycle \(i + 1)"
|
|
)
|
|
}
|
|
}
|
|
|
|
captureScreenshot(named: "P015-RapidWizard-Complete")
|
|
}
|
|
}
|