按模块拆分 XCUITest 用例与 Support 基础设施,UI Test 运行时跳过推送与排队 WebSocket,并将 Podfile 最低版本对齐 iOS 16。 Co-authored-by: Cursor <cursoragent@cursor.com>
44 lines
1.8 KiB
Swift
44 lines
1.8 KiB
Swift
//
|
|
// UITestExpectationVerifier.swift
|
|
// suixinkanUITests
|
|
//
|
|
// Created by Codex on 2026/6/26.
|
|
//
|
|
|
|
import XCTest
|
|
|
|
/// 根据首页菜单目录断言页面打开结果。
|
|
enum UITestExpectationVerifier {
|
|
/// 校验调试菜单打开后的目标页。
|
|
static func verify(
|
|
_ expectation: UITestHomeMenuCatalog.Expectation,
|
|
app: SuixinkanApp,
|
|
file: StaticString = #filePath,
|
|
line: UInt = #line
|
|
) {
|
|
switch expectation {
|
|
case .navigationTitle(let title):
|
|
NavigationAssertions.waitForNavigationTitle(title, in: app, file: file, line: line)
|
|
case .anyNavigationTitle(let titles):
|
|
_ = NavigationAssertions.waitForAnyNavigationTitle(titles, in: app, file: file, line: line)
|
|
case .tab(let tab):
|
|
switch tab {
|
|
case .orders:
|
|
NavigationAssertions.waitForNavigationTitle("订单", in: app, file: file, line: line)
|
|
case .statistics:
|
|
NavigationAssertions.waitForNavigationTitle("数据", in: app, file: file, line: line)
|
|
case .home:
|
|
XCTAssertTrue(app.application.staticTexts["常用应用"].waitForExistence(timeout: 8) || app.application.staticTexts["请选择景区"].exists, file: file, line: line)
|
|
case .profile:
|
|
NavigationAssertions.waitForNavigationTitle("个人信息", in: app, file: file, line: line)
|
|
}
|
|
case .staticText(let text):
|
|
NavigationAssertions.waitForStaticText(text, in: app, file: file, line: line)
|
|
case .unsupportedPlaceholder(let title):
|
|
_ = NavigationAssertions.waitForAnyNavigationTitle([title], in: app, file: file, line: line)
|
|
}
|
|
|
|
NavigationAssertions.assertNotStuckOnLoading(app: app, file: file, line: line)
|
|
}
|
|
}
|