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 be public.

    Declaration

    Swift

    init(valuesCollection: [Value])

    Parameters

    valuesCollection

    Array of values that should be passed to application.

  • launchEnvironments Extension method

    Dictionary added to XCUIApplication launchEnviroment.

    Declaration

    Swift

    public var launchEnvironments: [String : String]? { get }
  • init(arrayLiteral:) Extension method

    Default implementation of initializer required by ExpressibleByArrayLiteral protocol. It uses init(valuesCollection: [Value])

    Declaration

    Swift

    public init(arrayLiteral elements: Value...)
  • launchEnvironments Extension method

    launchEnvironments value depends on shouldCleanBefore, if true - CleanFlag (defined in CleanableLaunchEnvironment) is added at the beginning of launchEnvironment 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 }