LaunchEnvironmentWithMultipleValues
public protocol LaunchEnvironmentWithMultipleValues : LaunchEnvironmentProtocol, ExpressibleByArrayLiteral
Protocol defining minimal requirements for launch environment option with multiple values.
Provides default implementation for ExpressibleByArrayLiteral
protocol.
Example:
public struct ArrayLaunchEnvironment: LaunchEnvironmentWithMultipleValues {
public typealias Value = String
public let valuesCollection: [String]
public init(valuesCollection: [Value]) {
self.valuesCollection = valuesCollection
}
}
let array = ArrayLaunchEnvironment(valuesCollection: ["Value1", "Value2"])
let array = ["Value1", "Value2"] as ArrayLaunchEnvironment
Note
internal
initializer would be generated automatically but it would not fulfill requirement of public
protocol.
-
Array to store all resource values from which launch enviroment value is composed.
Declaration
Swift
var valuesCollection: [Value] { get }
-
Initializes
LaunchEnvironmentWithMultipleValues
with same value types as generated automatically but forces it to bepublic
.Declaration
Swift
init(valuesCollection: [Value])
Parameters
valuesCollection
Array
of values that should be passed to application.
-
launchEnvironments
Extension methodDictionary added to
XCUIApplication
launchEnviroment
.Declaration
Swift
public var launchEnvironments: [String : String]? { get }
-
init(arrayLiteral:)
Extension methodDefault implementation of initializer required by
ExpressibleByArrayLiteral
protocol. It usesinit(valuesCollection: [Value])
Declaration
Swift
public init(arrayLiteral elements: Value...)
-
launchEnvironments
Extension methodlaunchEnvironments
value depends onshouldCleanBefore
, iftrue
-CleanFlag
(defined inCleanableLaunchEnvironment
) is added at the beginning oflaunchEnvironment
value.Example:
CleanableArrayLaunchEnvironment(shouldCleanBefore: true, valuesCollection: ["MADE_BY", "PGS_WITH_LOVE"]).launchEnvironments
Output:
["CleanableArrayLaunchEnvironment": "AM_CLEAN_DATA_FLAG,PGS_WITH_LOVE,PGS_WITH_LOVE"]
Declaration
Swift
var launchEnvironments: [String : String]? { get }