Commit 44dcfe14d4

44dcfe14d426ead41592580ff596e8f093f70df6

parent: 33a6a7e764

Unsigned

cmc <hello@cleberg.net> · 2026-08-28 21:20 UTC

screenshots: never capture a screen that is still loading

snap() fired the moment a screen appeared, so the iPad dashboard shipped
as a bare spinner — dashboard, explore and feed all snapped without
waiting for anything. It now waits out any activity indicator and for the
first row to exist before capturing.

Layout: unified · split

gitbayUITests/LiveSmokeUITests.swift +13 −1
@@ -731,7 +731,19 @@ extension LiveSmokeUITests {
731 .waitForExistence(timeout: 20), "sign-in did not land") 731 .waitForExistence(timeout: 20), "sign-in did not land")
732 } 732 }
733 733
734 private func snap(_ name: String) { 734 /// Capture a screen, but not while it is still loading. These go to
735 /// the App Store, and a spinner shipped as a screenshot once already.
736 private func snap(_ name: String, file: StaticString = #filePath, line: UInt = #line) {
737 let spinner = app.activityIndicators.firstMatch
738 if spinner.exists {
739 XCTAssertTrue(waitForDisappearance(spinner, timeout: 30),
740 "\(name) still loading after 30s", file: file, line: line)
741 }
742 // A list that has loaded has rows; an empty state has text. Either
743 // way something must be on screen besides chrome.
744 let content = app.cells.firstMatch
745 _ = content.waitForExistence(timeout: 10)
746
735 let attachment = XCTAttachment(screenshot: app.screenshot()) 747 let attachment = XCTAttachment(screenshot: app.screenshot())
736 attachment.name = name 748 attachment.name = name
737 attachment.lifetime = .keepAlways 749 attachment.lifetime = .keepAlways