Skip to content

Latest commit

 

History

History

XCTestBootstrap

XCTestBootstrap

A macOS library for launching XCTest & XCUITest and managing connection with testmanager daemon.

Features

  • Prepares XCTest bundle.
  • Launches application and injects XCTest bundle.
  • Opens and manages connection with testmanager daemon during the test.
  • It works with iOS simulator & device tests.
  • It works with macOS tests.

Usage

In order to use XCTestBootstrap you need to provide class that implements <FBDeviceOperator> supplying basic device instructions like install application, launch application etc.

A good example is FBSimulatorControlOperator and FBSimulatorInteraction+XCTest\

  FBSimulatorTestPreparationStrategy *testPrepareStrategy =
  [FBSimulatorTestPreparationStrategy strategyWithTestRunnerBundleID:configuration.bundleID
                                                    testBundlePath:testBundlePath
                                                  workingDirectory:workingDirectory
                                                  ];
  FBSimulatorControlOperator *operator = [FBSimulatorControlOperator operatorWithSimulator:self.simulator];
  FBXCTestRunStrategy *testRunStrategy = [FBXCTestRunStrategy strategyWithDeviceOperator:operator testPrepareStrategy:testPrepareStrategy logger:simulator.logger];
  NSError *innerError = nil;
  FBTestManager *testManager = [testRunStrategy startTestManagerWithAttributes:configuration.arguments environment:configuration.environment error:&innerError];

FBTestManager needs to be kept alive in order to keep test running.

Contributing

See the CONTRIBUTING file for how to help out. There's plenty to work on the issues!

License

XCTestBootstrap is BSD-licensed. We also provide an additional patent grant.