Files
suixinkan_ios_new/suixinkanUITests/Modules/TasksUITests.swift
汉秋 aac8458b04 优化 UI Test 路由直达与会话复用,提升自定义 TabBar 下的稳定性。
新增启动参数直达首页与个人中心页面,引入 AppUITestRouteDriver 与 UITestSession 共享登录,并重构各模块用例的导航断言逻辑。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 11:25:36 +08:00

32 lines
1.0 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// TasksUITests.swift
// suixinkanUITests
//
import XCTest
final class TasksUITests: AuthenticatedUITestCase {
///
func testTaskListDetailAndCreateValidation() throws {
try openTaskManagement()
let firstCell = app.application.cells.element(boundBy: 0)
if firstCell.waitForExistence(timeout: 10) {
firstCell.tap()
NavigationAssertions.waitForNavigationTitle("任务详情", in: app)
BackNavigator.goBack(app: app)
} else {
throw XCTSkip("测试账号暂无任务数据,跳过详情流测试。")
}
app = try UITestSession.relaunch(openMenu: "发布任务")
NavigationAssertions.waitForNavigationTitle("发布任务", in: app)
}
///
private func openTaskManagement() throws {
app = try UITestSession.relaunch(openMenu: "任务管理")
NavigationAssertions.waitForNavigationTitle("任务管理", in: app)
}
}