Test Runner Tab
In this section:
- The color of the status bar indicates whether the tests have passed successfully. If at least one of the tests fails, the status bar turns red.
- The left-hand pane shows the tree view of all tests within the current run/debug
- The root node represents the test case selected to run.
- The nested nodes represent the hierarchy of test suites and test cases.
- The leaf nodes represent the individual tests.
The status of each test is indicated by an icon. Double-click a node to open the respective test class or test method in the editor.
- The testing toolbar provides controls that enable you to monitor the tests and analyze results. Some of the commands are duplicated on the context menus of the test tree nodes.
- The Output pane shows the output of the current test suit.
- The inline statistics show the list of executed tests with the execution time of each test.
|Show Passed||Click this button to show tests that passed successfully.|
|Show Ignored||Click this button to show the ignored tests in the tree view of all tests within the current run/debug configuration or test class.|
|Sort alphabetically||Click this button to sort tests in alphabetical order.|
|Sort by duration||Click this button to sort tests by duration.|
|Expand All/Collapse All|
Ctrl+NumPad Plus Ctrl+NumPad -
|Click these buttons to have all nodes in the tree view of tests expanded.
These buttons are only available if the tested application contains more than test case.
|Previous/Next Failed Test|
|Click these buttons to navigate between the failed tests.|
|Show coverage per test||Click this button to have the code coverage results shown
in the Project tool window.
The button is available after all the tests are executed provided that code coverage is enabled in the current run configuration.
|Export Test Results||Click this button
to have the results of the selected test saved in a file. In the
Export Test Results that opens, specify the file to save the output in
and the format in which the data will be saved. If you want to view the test results later, choose the XML format.
To view the saved test results later, click and specify the XML file where they are stored.
|Import Test Results||Click this button to view the test results that you previously saved in an XML file or the results that IntelliJ IDEA has kept in its internal history. The pop-up menu that opens shows a list of internally saved results of test sessions, each item is supplied with the name of the run configuration and a time stamp:|
|Click this cog button to access the context menu with the following options:
Test status icons
This pane shows output of each test, generated at runtime, including all the messages sent to the output stream, and the error messages. The following table shows the toolbar buttons and context menu commands available for the Output pane.
|Up the Stack Trace|
|Click this button to navigate up in the stack trace and have the cursor jump to the corresponding location in the source code.|
|Down the Stack Trace|
|Click this button to navigate down in the stack trace and have the cursor jump to the corresponding location in the source code.|
|Use Soft Wraps||Click this button to toggle the soft wrap mode of the output.|
|Scroll to the end||Click this button to navigate to the bottom of the stack trace and have the cursor jump to the corresponding location in the source code.|
|Click this button to configure printing out the console output in the Print dialog box that opens.|
|Clear All||Choose this item on the context menu to have all messages for the selected test deleted.|
|Copy Content||Ctrl+C||Choose this item on the context menu to have the current contents of the Output pane placed to the Clipboard.|
|Compare with Clipboard||Choose this item on the context menu to invoke the Differences viewer for files which shows the current contents of the Clipboard in the left-hand pane and the contents of the Output pane for the selected test in the right-hand pane.|
Context menu commands
|View assertEquals Difference||Alt+Enter||Choose this command to show the Differences viewer for the strings
This command is only available when assertion has failed.
|Run <test name>||Ctrl+Shift+F10||Run the selected test with the current temporary run/debug configuration or choose another configuration from the subordinate context menu.|
|Debug <test name>||Debug the selected test with the current temporary run/debug configuration or choose another configuration from the subordinate context menu.|
|Run <test name> with Coverage||Ctrl+Shift+F10||Run the selected test and collect coverage data in accordance with the current temporary run/debug configuration.|
|Create <test name>||Create a run/debug configuration on the base of the selected test.|
|Save <test name>||Save the temporary run/debug configurationn|
|Jump to Source||F4||Choose this command to move the focus to the editor, to the definition of a test class, or test method.|
|Show Source||Ctrl+Enter||Choose this command to open source code in the editor, but leave the focus with the Test Runner tab.|
|Navigate to testdata||If a test class has a file with testdata, IntelliJ IDEA selects this file in the Project tool window.|