Commit 85bee320af
Unsigned
Layout: unified · split
gitbay/gitbayApp.swift +11 −3
| @@ -17,9 +17,17 @@ struct gitbayApp: App { | |||
| 17 | .tint(.gbAccent) | 17 | .tint(.gbAccent) |
| 18 | // The screenshot checkpoint forces appearance per run; | 18 | // The screenshot checkpoint forces appearance per run; |
| 19 | // simulator clones ignore the base device's setting. | 19 | // simulator clones ignore the base device's setting. |
| 20 | .preferredColorScheme( | 20 | .preferredColorScheme(Self.forcedColorScheme) |
| 21 | ProcessInfo.processInfo.arguments.contains("-gb-dark") ? .dark : nil | ||
| 22 | ) | ||
| 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 | app = XCUIApplication() | 33 | app = XCUIApplication() |
| 34 | // xcodebuild runs tests on simulator clones, so the base | 34 | // xcodebuild runs tests on simulator clones, so the base |
| 35 | // device's appearance never applies; force it per run. | 35 | // device's appearance never applies; force it per run. |
| 36 | if ProcessInfo.processInfo.environment["GITBAY_UITEST_DARK"] == "1" { | 36 | switch ProcessInfo.processInfo.environment["GITBAY_UITEST_DARK"] { |
| 37 | app.launchArguments.append("-gb-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 | app.launch() | 41 | app.launch() |
| 40 | if name.contains("testRepoManagementFlows") { | 42 | if name.contains("testRepoManagementFlows") { |