新增完整 UI Test 回归套件,并完善启动隔离逻辑。
按模块拆分 XCUITest 用例与 Support 基础设施,UI Test 运行时跳过推送与排队 WebSocket,并将 Podfile 最低版本对齐 iOS 16。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
76
suixinkanUITests/Orders/OrdersFlowUITests.swift
Normal file
76
suixinkanUITests/Orders/OrdersFlowUITests.swift
Normal file
@ -0,0 +1,76 @@
|
||||
//
|
||||
// OrdersFlowUITests.swift
|
||||
// suixinkanUITests
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class OrdersFlowUITests: AuthenticatedUITestCase {
|
||||
/// 测试门店订单列表可进入详情页。
|
||||
func testStoreOrderDetailFlow() throws {
|
||||
TabBarNavigator.select(.orders, app: app)
|
||||
|
||||
app.application.staticTexts["订单管理"].tap()
|
||||
app.waitForGlobalLoadingToDisappear()
|
||||
|
||||
let firstOrderCard = app.application.otherElements
|
||||
.matching(NSPredicate(format: "identifier BEGINSWITH 'orders.store.card.'"))
|
||||
.firstMatch
|
||||
if !firstOrderCard.waitForExistence(timeout: 10) {
|
||||
throw XCTSkip("测试账号当前景区下暂无门店订单,跳过详情流测试。")
|
||||
}
|
||||
|
||||
firstOrderCard.tap()
|
||||
NavigationAssertions.waitForNavigationTitle("订单详情", in: app)
|
||||
BackNavigator.goBack(app: app)
|
||||
}
|
||||
|
||||
/// 测试核销订单列表可进入详情页。
|
||||
func testWriteOffOrderDetailFlow() throws {
|
||||
TabBarNavigator.select(.orders, app: app)
|
||||
|
||||
app.application.staticTexts["核销订单"].tap()
|
||||
app.waitForGlobalLoadingToDisappear()
|
||||
|
||||
let firstDetailButton = app.application.buttons
|
||||
.matching(NSPredicate(format: "identifier BEGINSWITH 'orders.writeoff.detail.'"))
|
||||
.firstMatch
|
||||
if !firstDetailButton.waitForExistence(timeout: 10) {
|
||||
throw XCTSkip("测试账号当前景区下暂无核销订单,跳过详情流测试。")
|
||||
}
|
||||
|
||||
firstDetailButton.tap()
|
||||
NavigationAssertions.waitForNavigationTitle("核销订单详情", in: app)
|
||||
BackNavigator.goBack(app: app)
|
||||
}
|
||||
|
||||
/// 测试押金订单链路可进入列表与详情。
|
||||
func testDepositOrderFlow() throws {
|
||||
DebugMenuNavigator.open(app: app)
|
||||
DebugMenuNavigator.tapMenu(title: "押金订单详情", app: app)
|
||||
NavigationAssertions.waitForNavigationTitle("押金订单", in: app)
|
||||
|
||||
let firstCell = app.application.cells.element(boundBy: 0)
|
||||
if firstCell.waitForExistence(timeout: 8) {
|
||||
firstCell.tap()
|
||||
NavigationAssertions.waitForNavigationTitle("押金订单详情", in: app)
|
||||
BackNavigator.goBack(app: app)
|
||||
} else {
|
||||
throw XCTSkip("测试账号暂无押金订单,跳过详情流测试。")
|
||||
}
|
||||
}
|
||||
|
||||
/// 测试扫码页可打开并关闭。
|
||||
func testScannerCanOpenAndClose() {
|
||||
TabBarNavigator.select(.orders, app: app)
|
||||
|
||||
let scanButton = app.application.buttons["扫码核销"]
|
||||
XCTAssertTrue(scanButton.waitForExistence(timeout: 6))
|
||||
scanButton.tap()
|
||||
|
||||
let closeButton = app.application.buttons["scanner.close"]
|
||||
XCTAssertTrue(closeButton.waitForExistence(timeout: 8))
|
||||
closeButton.tap()
|
||||
NavigationAssertions.waitForNavigationTitle("订单", in: app)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user