Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Configure Victor With Factory Classes

Dale Emery edited this page Jun 6, 2012 · 1 revision

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

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

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);

victor.application.bundle.path

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.

victor.frank.host

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

victor.frank.port

The port on which the Frank server listens for requests.

Default value: 37265

victor.simulator.device.type

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:

  1. The device type specified by the victor.simulator.device.type configuration option in the user-supplied configuration.
  2. The device type specified by the UIDeviceFamily property in the application bundle's Info.plist file, if the UIDeviceFamily property specifies exactly one device type.
  3. iPhone

victor.simulator.process.owner

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

victor.simulator.sdk.version

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:

  1. The SDK version specified by the victor.simulator.sdk.version configuration option in the user-supplied configuration.
  2. The SDK version specified by the DTSDKName property in the application bundle's Info.plist file.
  3. The newest SDK installed on the computer.