新增完整 UI Test 回归套件,并完善启动隔离逻辑。
按模块拆分 XCUITest 用例与 Support 基础设施,UI Test 运行时跳过推送与排队 WebSocket,并将 Podfile 最低版本对齐 iOS 16。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
42
suixinkanUITests/Support/DebugMenuNavigator.swift
Normal file
42
suixinkanUITests/Support/DebugMenuNavigator.swift
Normal file
@ -0,0 +1,42 @@
|
||||
//
|
||||
// DebugMenuNavigator.swift
|
||||
// suixinkanUITests
|
||||
//
|
||||
// Created by Codex on 2026/6/26.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
/// DEBUG 首页菜单调试页导航封装。
|
||||
enum DebugMenuNavigator {
|
||||
/// 进入「我的 → 首页调试」列表。
|
||||
static func open(app: SuixinkanApp, file: StaticString = #filePath, line: UInt = #line) {
|
||||
TabBarNavigator.select(.profile, app: app)
|
||||
let debugEntry = app.application.staticTexts["首页调试"]
|
||||
XCTAssertTrue(debugEntry.waitForExistence(timeout: 8), "未找到首页调试入口。", file: file, line: line)
|
||||
debugEntry.tap()
|
||||
NavigationAssertions.waitForNavigationTitle("首页菜单调试", in: app, file: file, line: line)
|
||||
}
|
||||
|
||||
/// 在调试菜单中点击指定标题。
|
||||
static func tapMenu(
|
||||
title: String,
|
||||
app: SuixinkanApp,
|
||||
file: StaticString = #filePath,
|
||||
line: UInt = #line
|
||||
) {
|
||||
let cell = app.application.staticTexts[title]
|
||||
XCTAssertTrue(cell.waitForExistence(timeout: 8), "调试菜单未找到:\(title)", file: file, line: line)
|
||||
cell.tap()
|
||||
app.waitForGlobalLoadingToDisappear()
|
||||
}
|
||||
|
||||
/// 返回调试菜单列表。
|
||||
static func returnToMenu(app: SuixinkanApp) {
|
||||
if app.application.navigationBars["首页菜单调试"].exists {
|
||||
return
|
||||
}
|
||||
BackNavigator.goBack(app: app)
|
||||
NavigationAssertions.waitForNavigationTitle("首页菜单调试", in: app)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user