Skip to content

Commit

Permalink
test local env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Espinola committed Jun 21, 2024
1 parent d85155a commit ad50786
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Example/CreativeUITest/Protocols/BaseXCTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
version = "2.2">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<AutocreatedTestPlanReference>
</AutocreatedTestPlanReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
Expand Down Expand Up @@ -37,13 +48,29 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<EnvironmentVariables>
<EnvironmentVariable
key = "COM_ATTENTIVE_EXAMPLE_HOST"
value = "local"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "69D3C148299EF2D10027934F"
BuildableName = "CreativeUITest.xctest"
BlueprintName = "CreativeUITest"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down

0 comments on commit ad50786

Please sign in to comment.