Configure Victor With Factory Classes
Victor includes two "factory" classes that can create and construct all of the required Victor objects based on user-defined configurations.
The factory classes can supply reasonable default values for most configuration options.
CreateIosApplication
constructs an IosApplication
object
through which tests can interact
with the application and its views.
Configuration options.
The CreateIosApplication
factory class
uses these configuration options:
-
victor.frank.host
: The name of the host on which the Frank server listens for requests. -
victor.frank.port
: The port on which the Frank server listens for requests.
See below for complete descriptions of these configuration options and their default values.
Using the factory.
Configuration configuration = ...;
IosApplication application = CreateIosApplication.withConfiguration(configuration);
CreateIosDevice
constructs an IosDevice
through which tests can launch, shut down, and interact with the simulator.
Configuration options.
The CreateIosDevice
factory class
uses these configuration options:
-
victor.application.bundle.path
: The file path to your application bundle. -
victor.simulator.device.type
: The type of device to simulate. -
victor.simulator.sdk.version
The SDK version to simulate. -
victor.simulator.process.owner
Who is responsible for launching and shutting down the simulator.
See below for descriptions of these configuration options and their default values.
Using the factory.
Configuration configuration = ...;
IosDevice device = CreateIosDevice.withConfiguration(configuration);
The absolute path to the iOS application bundle to execute. This is typically the application's .app package.
No default value. You must supply a value for this configuration option. Victor cannot supply a default value.
The name of the host on which the Frank server listens for requests. Do not include a URI scheme (e.g. "http://") at the start of this value.
Default value: localhost
The port on which the Frank server listens for requests.
Default value:
37265
The type of device to simulate. The possible values are the same as those shown on the iOS Simulator's Hardware > Device menu. For current SDKs, the possible values are:
iPad
iPad (Retina)
iPhone
iPhone (Retina)
Determining the device type. Victor uses the device type that it finds by seeking in this order:
- The device type specified
by the
victor.simulator.device.type
configuration option in the user-supplied configuration. - The device type specified
by the
UIDeviceFamily
property in the application bundle's Info.plist file, if theUIDeviceFamily
property specifies exactly one device type. iPhone
Specifies who is responsible for starting and stopping the simulator.
If the value is victor
(the default value),
the constructed IosDevice
's
start()
method will launch the simulator,
and its stop()
method will shut it down.
If this option is defined and has any value other than victor
,
the constructed IosDevice
will neither start nor stop the simulator.
Instead, the user must start and stop the simulator in some other way.
This is useful for experimenting.
It allows you to launch the application on your own,
manually execute preparatory steps to bring the application to a desired state,
then run an automated test against the prepared application.
Default value:
victor
The version of SDK to use to run the simulator.
Determining the SDK version. Victor uses the first installed SDK that it finds by seeking in this order:
- The SDK version specified
by the
victor.simulator.sdk.version
configuration option in the user-supplied configuration. - The SDK version specified
by the
DTSDKName
property in the application bundle's Info.plist file. - The newest SDK installed on the computer.