AppCode 2023.1 Help

Explore test results

After AppCode finishes running your tests, it shows the results in the Run tool window on the Test Runner tab.

The console on the right shows the output of the current test session. It allows you to see the detailed information on the test execution and why your tests failed or were ignored.

The Test Runner toolbar located above the list of test results allows you to show and hide successful and ignored tests, display how much time it took to run each test, export, import, and sort test results.

Next to each test on the Test Runner tab, the IDE displays an icon that marks the test status:

Icon

Description

Test error

Test error. This status is assigned to tests that caused an exception from the tested source code.

Test failed

Test failed. If at least one child test fails, all its parent tests are marked as failed.

Test in progress

Test in progress.

Test passed

Test passed successfully.

Terminated

Test terminated. This status is assigned to tests that were stopped.

If at least one test receives this status, then all unfinished tests and their parent tests are marked as terminated.

Tests in the Run tool window
  • To navigate between failed tests, use the Next Failed Test / Previous Failed Test buttons or press Ctrl+Alt+Up/Ctrl+Alt+Down.

  • To navigate between problem locations from the stack trace, use the Next Failed Test / Previous Failed Test buttons on the right toolbar.

Jump to source code

  • To jump to the test's source code, double-click the test in the tree or press F4.

  • If you want to go to the source code every time you click a test in the tree, click Options and select Navigate with Single Click.

  • To jump to the problem location from the stack trace, click the hyperlink.

Jump from a class or file to its test

  1. Open class in the editor. If you want to navigate from a method to its test, position the caret at this method.

  2. If more than one test is associated with the test subject, select the desired one from the list. The test for the current class opens in the dedicated tab of the editor and gets the focus.

Jump from a test to its test subject

  1. Open a test class in the editor.

  2. From the main menu or the editor context menu, select Navigate | Test Subject. Alternatively, press Ctrl+Shift+T.

    The test subject for the current test class opens in the dedicated tab of the editor and gets the focus.

View test results

Show passed and ignored tests

By default, AppCode doesn't show passed tests.

  • To show passed tests, click the Show Passed button.

  • To show ignored tests, click the Show Ignored button.

Sort tests

  • To sort tests alphabetically, click Sort Alphabetically.

  • To sort tests by their duration, click Sort by Duration.

View statistics

  • To view the execution time for tests, click the Settings button on the Test Runner toolbar and enable the Show Inline Statistics option.

    Show Inline Statistics: OFF

    Show Inline Statistics: ON

    Show Inline Statistics: OFF
    Show Inline Statistics: ON

View results of previous tests

AppCode automatically saves results of the last 10 tests. To open the list of recent tests:

  • Click the Test History icon on the Test Runner toolbar and select the necessary test from the list.

    For each test, the list displays the run configuration name and a time stamp:

    Viewing results of previous tests

    You can also export test results to a file if you want to keep them or share with your team.

Export and import test results

Export test results to a file

  1. Click Export Test Results on the Test Runner toolbar.

  2. Select the format in which you want to save the file:

    • HTML: generate an HTML file from a pre-defined template.

    • XML: use this format if you want to import this file later to AppCode.

    • Custom, apply XSL template: use your custom XSL template to generate an HTML file from the raw XML output. Click Browse button next to this option and select the *.xsl code style definition file.

  3. Specify the name of the output file and its location.

  4. If you want to open the file in your browser after you export it, select the Open exported file in browser checkbox. Click OK.

Import test results

  1. To load a previously exported file, click Import Tests from File on the Test Runner toolbar.

    If you haven't run any tests yet, and the tool window with the Test Runner toolbar is not available, press Ctrl+Shift+A and type Import Tests from File.

  2. In the dialog that opens, select the .xml file with test results and click Open.

Last modified: 14 February 2023