TestLauncher

public struct TestLauncher

Configures given application with provided launch options and variables. TestLauncher is a wrapper around XCUIApplication.launchArguments and XCUIApplication.launchEnvironment. By using abstract type, LaunchOption, it is possible to pass parameters to the testing application.

AutoMate provides set of options which can set system locale, language, keyboard languages, or advanced options like CoreData SQL debug verbosity level.

Example:

let app = XCUIApplication()
TestLauncher(options: [
    SystemLanguages([.English, .German]),
    SystemLocale(language: .English, country: .Canada),
    SoftwareKeyboards([.EnglishCanada, .GermanGermany])
]).configure(app).launch()
  • Initializes TestLauncher with given options.

    Declaration

    Swift

    public init(options: [LaunchOption] = [])

    Parameters

    options

    Options to initialize with.

  • Passes stored settings to the provided application.

    Declaration

    Swift

    public func configure<T: Application>(_ application: T) -> T

    Parameters

    application

    Object implementing Application protocol that will receive the settings, eg. XCUIApplication.

    Return Value

    Application with passed settings.

  • Initializes TestLauncher with given options and configure application object with launch arguments and launch environments.

    Declaration

    Swift

    public static func configure<T: Application>(_ application: T, withOptions options: [LaunchOption] = []) -> T

    Parameters

    application

    Object implementing Application protocol that will receive the settings, eg. XCUIApplication.

    options

    Options to initialize TestLauncher and application.

    Return Value

    Application with passed settings.