Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ jobs:
-derivedDataPath "$DERIVED_DATA" \
-parallel-testing-enabled NO \
test \
-only-testing:TiebaPureUITests/TiebaPureUITests/testIPadLandscapeReaderListUsesAvailableWidth
-only-testing:TiebaPureUITests/TiebaPureUITests/testIPadLandscapeReaderListUsesAvailableWidth \
-retry-tests-on-failure -test-iterations 2 \
-test-repetition-relaunch-enabled YES

- name: Release build and bundled notices
run: |
Expand Down
23 changes: 10 additions & 13 deletions TiebaPureUITests/TiebaPureUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5628,31 +5628,28 @@ final class TiebaPureUITests: XCTestCase {
guard UIDevice.current.userInterfaceIdiom == .pad else {
throw XCTSkip("仅在 iPad 设备矩阵中运行。")
}
let app = launchApp()
XCUIDevice.shared.orientation = .landscapeLeft
addTeardownBlock {
XCUIDevice.shared.orientation = .portrait
}

let landscape = XCTNSPredicateExpectation(
predicate: NSPredicate { object, _ in
guard let application = object as? XCUIApplication else { return false }
return application.frame.width > application.frame.height
},
object: app
)
XCTAssertEqual(XCTWaiter.wait(for: [landscape], timeout: 8), .completed)
XCUIDevice.shared.orientation = .landscapeLeft
let app = launchApp()

let firstThreadRow = threadRows(in: app).firstMatch
XCTAssertTrue(firstThreadRow.waitForExistence(timeout: 8))
let appFrame = app.frame
XCTAssertGreaterThan(
appFrame.width,
appFrame.height,
"iPad 横屏布局测试必须在横屏窗口中运行"
)
XCTAssertGreaterThanOrEqual(
firstThreadRow.frame.width,
app.frame.width * 0.35,
appFrame.width * 0.35,
"iPad 横屏帖子行应使用足够的横向空间展示标题"
)
XCTAssertLessThan(
firstThreadRow.frame.maxX,
app.frame.midX,
appFrame.midX,
"左侧帖子列表不能挤占右侧详情栏"
)
}
Expand Down
Loading