From 5a759d777dfdee9cfbfb8ffe7a6bd26d66e226be Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 23 Feb 2023 15:07:33 +0000 Subject: [PATCH] Add UI_TESTS_SCREEN as a disabled env var for quicker debugging. (#619) --- ElementX/Sources/Other/Tests.swift | 2 +- ElementX/SupportingFiles/target.yml | 3 +++ UITests/Sources/Application.swift | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Other/Tests.swift b/ElementX/Sources/Other/Tests.swift index a87d20a0e..3bf55a812 100644 --- a/ElementX/Sources/Other/Tests.swift +++ b/ElementX/Sources/Other/Tests.swift @@ -29,7 +29,7 @@ public enum Tests { /// Flag indicating whether the app is running the UI tests. static var isRunningUITests: Bool { #if DEBUG - ProcessInfo.processInfo.environment["IS_RUNNING_UI_TESTS"] == "1" + ProcessInfo.processInfo.environment["UI_TESTS_SCREEN"] != nil #else false #endif diff --git a/ElementX/SupportingFiles/target.yml b/ElementX/SupportingFiles/target.yml index 48f5a584a..27455dc4f 100644 --- a/ElementX/SupportingFiles/target.yml +++ b/ElementX/SupportingFiles/target.yml @@ -25,6 +25,9 @@ schemes: - variable: HTTPS_PROXY value: 192.168.0.111:9090 isEnabled: false + - variable: UI_TESTS_SCREEN + value: "" + isEnabled: false test: config: Debug gatherCoverageData: true diff --git a/UITests/Sources/Application.swift b/UITests/Sources/Application.swift index 503da5844..8f80851d9 100644 --- a/UITests/Sources/Application.swift +++ b/UITests/Sources/Application.swift @@ -21,7 +21,6 @@ struct Application { static func launch(_ identifier: UITestsScreenIdentifier) -> XCUIApplication { let app = XCUIApplication() app.launchEnvironment = [ - "IS_RUNNING_UI_TESTS": "1", "UI_TESTS_SCREEN": identifier.rawValue ]