1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import XCTest
final class QuoteLoadingTests: XCTestCase {
func testUncachedQuotedPostLoadsAtTopOfDetail() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Requires the iPhone tab layout")
continueAfterFailure = false
let app = XCUIApplication()
app.launchArguments = [
"-ui-testing", "-ui-testing-signed-in", "-ui-testing-rich-scroll", "-ui-testing-thread-delay"
]
app.launch()
let quote = app.buttons["quotedPostLink"].firstMatch
for _ in 0..<5 {
if quote.exists && quote.isHittable { break }
app.swipeUp()
}
XCTAssertTrue(quote.waitForExistence(timeout: 10))
quote.tap()
let navigation = app.navigationBars["Post"]
XCTAssertTrue(navigation.waitForExistence(timeout: 5))
let loading = app.otherElements["postDetailLoading"].firstMatch
XCTAssertTrue(loading.waitForExistence(timeout: 2))
XCTAssertLessThan(loading.frame.minY - navigation.frame.maxY, 45)
let quotedPost = "at://mae.example/app.bsky.feed.post/scroll-2-quote"
XCTAssertTrue(app.buttons["postText-\(quotedPost)"].firstMatch.waitForExistence(timeout: 10))
}
}