AppCode 2018.1 Help

Quick Test Support

Basics

Quick is one of the XCTest-based frameworks and can be used for testing the Swift projects in AppCode. It's support includes:

  • Creating Quick-specific Run/Debug configurations
  • Built-in test runner the progress bar and a tree view of all the tests running
  • Ability to re-run the tests
  • Ability to navigate to the source code of a particular test

Running Quick tests

To use Quick tests in your project, add this framework to your project and create the test cases. Now you can run your tests in one of the following ways:

  1. To run or debug the tests from the context, place caret on the test method and press ⌃⇧R or ⌃⇧D. Note, that the Run/Debug configuration created for such test runs are created locally and won’t be visible in the Xcode project.

  2. Click the run run 2x left gutter icon.

You can observe test results in the Test runner:

ac quickTestResults

Creating Quick tests Run/Debug configuration

Though you can simply run the Quick test target from your project as an ordinary configuration in AppCode, to take advantage of the built-in test runner, create specific Quick test configuration (one or more). For every target it can be done automatically when you run a test/set of tests, or explicitly.

  1. To create a configuration automatically, just run a test case from context or using the left gutter icon. AppCode create and saves the Run/Debug configuration automatically, as follows:

    ac QuickRunDebugConfig 1

  2. To create a configuration manually, do the following:

    • In the main menu, select Run | Edit Configurations. In the dialog that opens:
      • Click add.png on the toolbar or press ⌘N. Select XCTest from the list.
      • For the Quick run/debug configuration:
        • In the Target field, select the Quick target from the list of available targets.
        • Specify its name in the Name text box. This name will be shown in the list of the available run/debug configurations.
        • Select the Class/Method radio button to run all the tests of a suite. Select Pattern radio button to run all the tests of a particular pattern.
        • Specify the class name in the class text box. Note, that this option is available only when the Class/Method radio button is selected.
        • Specify the pattern name in the Pattern text box. Note, that this option is available only when the Pattern radio button is selected.
        • Specify common run/debug configuration parameters.
        • Apply the changes and close the dialog box.
        ac quickSelectTest

Last modified: 5 April 2018