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

Victor Architecture

Dale Emery edited this page May 10, 2012 · 6 revisions

Victor Architecture

In the Simulator: A Frankified Application

The right side of the diagram shows an application running in an iOS simulator. This is a normal application with one special piece added: A Frank server.

The Frank server is a static library that you link into your application. The Frank server receives commands from your tests via HTTP, executes the commands within your application, and sends the results back to your tests via HTTP. The Frank server allows tests to send commands and queries to the application's application delegate and also to individual views and sets of views within the app.

An application with a Frank server is called a Frankified application.

Inside Victor: Drivers and Agents

The middle part of the diagram shows Victor's internal structure. There are conceptually two kinds of components in Victor: drivers and agents. A driver represents some entity that your tests interact with. An agent sends and receives messages between Victor and the simulator and application.

Drivers

A driver represents some entity that your tests interact with.

Victor includes drivers that represent devices, applications, and views:

  • An iOS device driver represents an iOS device such as an iPhone or iPad. The interface for iOS device drivers is IosDevice. An iOS device driver allows your tests to send commands to the simulated device. Victor's implementation is called SimulatedIosDevice because it interacts with the device through a simulator agent.

  • An iOS application driver represents your application running in a device. The interface for iOS application drivers is IosApplication. An iOS application driver allows your tests to send commands and queries to the application delegate in the application. Victor's implementation is called FrankIosApplication because it interacts with the application through a Frank agent.

  • An iOS view driver represents a view (or set of views) in an application. The interface for iOS view drivers is IosView. An iOS view driver allows your tests to send commands and queries to views in the application. Victor's implementation is called FrankIosView because it interacts with the views through a Frank agent.

Agents

An agent sends and receives messages between Victor and the simulator and application.

  • A Frank agent sends messages between Victor and the Frank server embedded into the application. The Frank agent sends and receives messages via HTTP. The "wire protocol" for the messages is called Frankly. For details of the Frankly protocol, see the Frank source code or the Victor source code.

  • A Simulator agent sends menu touch commands from Victor to the iOS simulator. A simulator agent interacts with the simulator by sending menu commands via AppleScript.

Victor includes two kinds of simulator agents:

  • A Victor simulator agent can launch an application in a simulator, stop the simulator, and invoke menu touch commands. It is called the Victor simulator agent because Victor is responsible for starting and stopping the simulator.

  • A user simulator agent does not stop or start the simulator, but instead interacts with an already running simulator. This allows you to launch your application manually, perform some preparatory steps, and execute a test against your prepared application. It is called the user simulator agent because the user is responsible for starting and stopping the simulator.

When you configure Victor, you create either a Victor simulator agent or a user simulator agent to interact with the simulator.

In Your Test Code: Tests and Configuration

Your test library will need code that configures Victor and makes the configured device driver and application driver available to test methods. The configuration code is typically executed by a base class that all of your test classes extend.