ContactLaunchEnvironment
public struct ContactLaunchEnvironment : CleanableLaunchEnvironmentWithMultipleValues, AutoMateLaunchEnvironment
Launch environment supporting Contacts
.
Expects bundle and file name for every file containing data of contacts to be added to address book at test launch.
Structure is defined in example project’s file contacts.json.
Example:
let johnContacts: ContactLaunchEnvironment = [ LaunchEnvironmentResourceValue(fileName: "john", bundleName: "Data") ]
let severalContacts = ContactLaunchEnvironment(resources: (fileName: "michael", bundleName: "Test data"), (fileName: "emma", bundleName: nil))
let severalContacts = ContactLaunchEnvironment(shouldCleanBefore: true, resources: (fileName: "michael", bundleName: "Test data"), (fileName: "emma", bundleName: nil))
Warning
SettingshouldCleanBefore
to true
will remove all contacts from a device.
-
Defines associated type from
LaunchEnvironmentProtocol
to beLaunchEnvironmentResourceValue
.Declaration
Swift
public typealias Value = LaunchEnvironmentResourceValue
-
Defines
LaunchEnvironmentResourceValue
asAutoMateKey.contacts
.Declaration
Swift
public static let key: AutoMateKey
-
Array to store all resource values from which launch enviroment value is composed.
Declaration
Swift
public let valuesCollection: [LaunchEnvironmentResourceValue]
-
Flag that indicates if all
CNContact
s should be removed before saving new ones.Declaration
Swift
public let shouldCleanBefore: Bool
-
Initializes
EventLaunchEnvironment
that can be passed toTestLauncher
. If handler is added toLaunchEnvironmentManager
default handling is provided by AutoMate - AppBuddy.Declaration
Swift
public init(shouldCleanBefore: Bool, valuesCollection: [Value])
Parameters
shouldCleanBefore
Bool
flag indicating ifCNContact
s should be removed before saving new ones.valuesCollection
Array
of all resource values to be passed.