From ad50786944ebd5076c2faf216da9163bde832254 Mon Sep 17 00:00:00 2001 From: Vladimir Espinola Date: Fri, 21 Jun 2024 15:50:50 -0400 Subject: [PATCH] test local env variable --- .../Protocols/BaseXCTestCase.swift | 10 +++++-- .../xcschemes/CreativeUITest.xcscheme | 29 ++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Example/CreativeUITest/Protocols/BaseXCTestCase.swift b/Example/CreativeUITest/Protocols/BaseXCTestCase.swift index 7b8299b..61ff844 100644 --- a/Example/CreativeUITest/Protocols/BaseXCTestCase.swift +++ b/Example/CreativeUITest/Protocols/BaseXCTestCase.swift @@ -58,8 +58,14 @@ extension BaseXCTestCase { /// Assert that the SMS app is opened with prepopulated text if running locally. (AWS Device Farm doesn't allow use of SMS apps). var canLaunchExternalApps: Bool { - ProcessInfo + let host = ProcessInfo .processInfo - .environment["COM_ATTENTIVE_EXAMPLE_HOST"] == nil + .environment["COM_ATTENTIVE_EXAMPLE_HOST"] + + if host != "local" { + XCTFail("COM_ATTENTIVE_EXAMPLE_HOST is not for AWS Farm: \(host)") + } + + return host == "local" } } diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/CreativeUITest.xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/CreativeUITest.xcscheme index 961ca82..160f2df 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/CreativeUITest.xcscheme +++ b/Example/Example.xcodeproj/xcshareddata/xcschemes/CreativeUITest.xcscheme @@ -1,11 +1,22 @@ + version = "2.2"> + + + + + + + + + + + + + +