Skip to content

Android tests

In order to run iOS tests you have to define configurations for every test bundle in emceeplan. Each configuration must be populated at least with artifact bundles and devices.

There are different build artifacts depending on type of test you want to run. In any case, xcodebuild build-for-testing will produce these artifacts for you. You may use local file paths in emceeplan, thus Emcee will be responsible for serving build artifacts for workers. Or you may upload them on some server and use direct URLs in emceeplan so Emcee workers would be able to download and use them to run tests.

Different test types require different set of build artifacts to be provided to Emcee in order to successfully execute tests.

UI Tests#

Also known as XC UI native tests. In this test scenario, main app is launched and then controlled by another app (XCTRunner.app). The latter also runs your tests. This allows to achieve black box-like test mode.

The required artifacts are:

  • appBundle, app under test, .app bundle of the app being tested

  • runnerBundle, Xcode will add XCTRunner.app into DerivedData folder, typically named after your UI tests target, e.g. UITests-Runner.app

  • xcTestBundle, .xctest bundle - usually it is located inside UITests-Runner.app/PlugIns/.

tests:
  configurations:
    - platform: ios
      xcTestBundle: derivedData/Build/Products/Debug-iphonesimulator/EmceeSampleUITests-Runner.app/PlugIns/EmceeSampleUITests.xctest
      appBundle: derivedData/Build/Products/Debug-iphonesimulator/EmceeSample.app
      runnerBundle: derivedData/Build/Products/Debug-iphonesimulator/EmceeSampleUITests-Runner.app
      device:
        #...

Application Tests#

In this test scenario, the app under test starts and runs your test bundle, thus, the app itself acts like a test hosting app. Tests have access to all objects and memory of the app under test. This allows to write gray or white box tests.

The required artifacts are:

  • appBundle, .app bundle to host tests

  • xcTestBundle, .xctest bundle - usually it is located inside YourApp.app/PlugIns/.

tests:
  configurations:
    - platform: ios
      xcTestBundle: derivedData/Build/Products/Debug-iphonesimulator/EmceeSample.app/PlugIns/EmceeSampleHostedTests.xctest
      appBundle: derivedData/Build/Products/Debug-iphonesimulator/EmceeSample.app
      device:
        #...

Unit Tests#

This test environment does not require a hosting app. Tests are loaded and executed by xctest process. Usually things like CocoaPods dev pods can be tested in logic test mode.

The required artifacts are:

  • xcTestBundle, xctest bundle - usually it is located inside your Derived Data folder.
tests:
  configurations:
    - platform: ios
      xcTestBundle: derivedData/Build/Products/Debug-iphonesimulator/EmceeSampleTestsWithoutHost.xctest
      device:
        #...