Commit 5e66f22e43
5e66f22e43a45f05e4a28aebbf50632f25492faa
parent: af4bf316f0
Verified · cmc
cmc <hello@cleberg.net> · 2026-08-28T19:59:23Z
screenshots: let the checkpoint force light as well as dark
The app forced dark on request and otherwise followed the device, so a
"light" run on a dark clone produced dark screenshots — both appearance
sets came out identical. GITBAY_UITEST_DARK=0 now forces light; unset
still follows the system, as a real launch does.
gitbay/gitbayApp.swift
+11 −3
| @@ -17,9 +17,17 @@ struct gitbayApp: App { |
| 17 | 17 | .tint(.gbAccent) |
| 18 | 18 | // The screenshot checkpoint forces appearance per run; |
| 19 | 19 | // simulator clones ignore the base device's setting. |
| 20 | | .preferredColorScheme( |
| 21 | | ProcessInfo.processInfo.arguments.contains("-gb-dark") ? .dark : nil |
| 22 | | ) |
| 20 | .preferredColorScheme(Self.forcedColorScheme) |
| 23 | 21 | } |
| 24 | 22 | } |
| 23 | |
| 24 | /// A clone follows whatever appearance it was created with, so the |
| 25 | /// checkpoint has to name the one it wants. Neither flag means the |
| 26 | /// app follows the system, as it does for real users. |
| 27 | private static var forcedColorScheme: ColorScheme? { |
| 28 | let args = ProcessInfo.processInfo.arguments |
| 29 | if args.contains("-gb-dark") { return .dark } |
| 30 | if args.contains("-gb-light") { return .light } |
| 31 | return nil |
| 32 | } |
| 25 | 33 | } |
gitbayUITests/LiveSmokeUITests.swift
+4 −2
| @@ -33,8 +33,10 @@ final class LiveSmokeUITests: XCTestCase { |
| 33 | 33 | app = XCUIApplication() |
| 34 | 34 | // xcodebuild runs tests on simulator clones, so the base |
| 35 | 35 | // device's appearance never applies; force it per run. |
| 36 | | if ProcessInfo.processInfo.environment["GITBAY_UITEST_DARK"] == "1" { |
| 37 | | app.launchArguments.append("-gb-dark") |
| 36 | switch ProcessInfo.processInfo.environment["GITBAY_UITEST_DARK"] { |
| 37 | case "1": app.launchArguments.append("-gb-dark") |
| 38 | case "0": app.launchArguments.append("-gb-light") |
| 39 | default: break // follow the device, as a real launch does |
| 38 | 40 | } |
| 39 | 41 | app.launch() |
| 40 | 42 | if name.contains("testRepoManagementFlows") { |