LaunchEnvironmentManager

public final class LaunchEnvironmentManager

Handles launch environments passed by the UI test runner. Launch environments passed by the AutoMate are working.

LaunchEnvironmentManager should be initialized in the application delegate in method application(_:didFinishLaunchingWithOptions:).

Example:

let launchManager = aunchEnvironmentManager()
launchManager.add(handler: defaultEventKitHander, for: .events)
launchManager.add(handler: defaultEventKitHander, for: .reminders)
launchManager.add(handler: defaultContactsHander, for: .contacts)
launchManager.add(handler: defaultIsInUITestHandler, for: .isInUITest)
launchManager.add(handler: AnimationHandler(), for: .animation)
launchManager.setup()
  • Initialize object with launch environments. By default ProcessInfo.processInfo.environment is used.

    Declaration

    Swift

    public init(environment: [String: String] = ProcessInfo.processInfo.environment)

    Parameters

    environment

    launch environment passed to the application.

  • Process launch environemtns and pass them to correct handlers.

    Declaration

    Swift

    public func setup()
  • Add new Handler object which process data from launch environments with given key.

    Declaration

    Swift

    public func add(handler: Handler, for key: LaunchOptionKey)

    Parameters

    handler

    Object implementing Handler protocol.

    key

    Key for which handler will be executed.

  • Add new Handler object which process data from launch environments with given key.

    Declaration

    Swift

    public func add(handler: Handler, for key: AutoMateLaunchOptionKey)

    Parameters

    handler

    Object implementing Handler protocol.

    key

    Key for which handler will be executed.