Commit bb6e57f79e
Verified · cmc
gitbayUITests/LiveSmokeUITests.swift +39 −1
| @@ -293,7 +293,12 @@ final class LiveSmokeUITests: XCTestCase { | ||
| 293 | 293 | /// swallowed silently, so this taps until the tab reports selected. |
| 294 | 294 | func selectTab(_ name: String, |
| 295 | 295 | file: StaticString = #filePath, line: UInt = #line) { |
| 296 | let tab = app.tabBars.buttons[name].firstMatch | |
| 296 | // iPadOS renders a TabView as a sidebar or top bar rather than a | |
| 297 | // bottom tab bar, so the control is not under app.tabBars there. | |
| 298 | var tab = app.tabBars.buttons[name].firstMatch | |
| 299 | if !tab.waitForExistence(timeout: 5) { | |
| 300 | tab = app.buttons[name].firstMatch | |
| 301 | } | |
| 297 | 302 | XCTAssertTrue(tab.waitForExistence(timeout: 15), |
| 298 | 303 | "\(name) tab missing", file: file, line: line) |
| 299 | 304 | // The app is interactive once its own chrome is hittable. |
| @@ -996,3 +1001,36 @@ extension LiveSmokeUITests { | ||
| 996 | 1001 | .waitForExistence(timeout: 20), "build detail shows no timing") |
| 997 | 1002 | } |
| 998 | 1003 | } |
| 1004 | ||
| 1005 | extension LiveSmokeUITests { | |
| 1006 | ||
| 1007 | /// Store screenshots on iPad. It navigates by tab and through | |
| 1008 | /// Explore rather than reusing the iPhone checkpoint: that one drives | |
| 1009 | /// the repo list's `.searchable`, which iPadOS lays out differently, | |
| 1010 | /// and chasing those differences is the iPad pass this release | |
| 1011 | /// deferred. Tabs and a list row work on both. | |
| 1012 | func testIPadScreenshotCheckpoint() throws { | |
| 1013 | signInIfNeeded() | |
| 1014 | snap("dashboard") | |
| 1015 | ||
| 1016 | selectTab("Explore") | |
| 1017 | snap("explore") | |
| 1018 | ||
| 1019 | // First public repo in the list — no search field involved. | |
| 1020 | let firstRepo = app.cells.firstMatch | |
| 1021 | XCTAssertTrue(firstRepo.waitForExistence(timeout: 20), "explore listed nothing") | |
| 1022 | firstRepo.tap() | |
| 1023 | XCTAssertTrue(app.staticTexts["Files"].firstMatch.waitForExistence(timeout: 20), | |
| 1024 | "repo screen did not open") | |
| 1025 | snap("repo") | |
| 1026 | ||
| 1027 | selectTab("Feed") | |
| 1028 | snap("feed") | |
| 1029 | ||
| 1030 | selectTab("My Profile") | |
| 1031 | XCTAssertTrue(app.staticTexts | |
| 1032 | .containing(NSPredicate(format: "label BEGINSWITH 'Repositories'")).firstMatch | |
| 1033 | .waitForExistence(timeout: 20), "profile did not load") | |
| 1034 | snap("profile") | |
| 1035 | } | |
| 1036 | } | |