Files
suixinkan_ios_new/suixinkanUITests/Support/BackNavigator.swift
汉秋 560b52fcc8 接入首页位置上报与在线倒计时,并优化上报交互体验。
持久化服务端 expired 过期时间戳以正确恢复倒计时,切换在线/离线与上报时展示定位 Loading,移除重复的成功 Alert,并将 Toast 调整为居中半透明样式。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 15:59:59 +08:00

35 lines
1.2 KiB
Swift

//
// BackNavigator.swift
// suixinkanUITests
//
// Created by Codex on 2026/6/26.
//
import XCTest
///
enum BackNavigator {
///
static func goBack(app: SuixinkanApp, file: StaticString = #filePath, line: UInt = #line) {
let navigationBar = app.application.navigationBars.element(boundBy: 0)
guard navigationBar.exists else {
XCTFail("当前页面没有可返回的导航栏。", file: file, line: line)
return
}
let backButton = navigationBar.buttons.element(boundBy: 0)
XCTAssertTrue(backButton.waitForExistence(timeout: 4), "未找到返回按钮。", file: file, line: line)
backButton.tap()
app.waitForGlobalLoadingToDisappear()
}
/// 使
static func dismissCustomTopBarIfNeeded(app: SuixinkanApp) {
let backCandidates = app.application.buttons.matching(NSPredicate(format: "label CONTAINS 'chevron.left'"))
if backCandidates.count > 0 {
backCandidates.element(boundBy: 0).tap()
app.waitForGlobalLoadingToDisappear()
}
}
}