Test Management System Integration in IntelliJ IDEA Ultimate
IntelliJ IDEA 2021.1 Ultimate introduces the new Test Management plugin, which provides support for TestRail, one of the most popular Test Management Systems [TMS].
The new plugin supports browsing test suites and case hierarchies, provides easy navigation for TMS items, generates unit-tests for selected test scenarios, and helps find non-automated test cases or obsolete test methods.
The Test Management plugin is part of the Test Automation Kit bundle, which can be installed with a single click.
Read on for a brief overview of the features that are already supported in the plugin and the new improvements we are working on.
Once you’ve installed the Test Management plugin, you will have access to the new TMS tool window in IntelliJ IDEA Ultimate. Here you can create a new connection to a TestRail server and select a specific project to sync.
The IDE will automatically sync the list of test cases and test runs, including all the necessary metadata. You can browse the hierarchy of TMS items, such as suites, test cases, and active test runs. A preview window will display additional details about the selected element.
TMS projects often have their own unique properties and parameters. The Filter action in the TMS tool window allows you to filter items according to these custom properties. Code completion in the filter window helps you select from all available values for each property.
The Filter action makes it easy to browse relevant items, for instance, non-automated tests related to a specific subsystem.
As soon as the IDE is synced with the test management system, all imported items (cases, plans, and runs) can be found using Search Everywhere.
If you want to search through test management system items, you just have to use Navigate | TMS item from the main menu or type the /tms prefix in the search query.
All test management items can be mentioned in source code comments. Clicking the element will display a preview popup with detailed information about it.
Any custom Java/Kotlin annotation can be specified as a special TMS element reference. A method with these annotations is treated as referencing a TMS element, allowing you to easily navigate to it and, more importantly, find usages of it.
The New Test From Test Cases action allows you to generate unit tests from a selected set of test scenarios for Java and Kotlin. By default, test classes and methods are generated with “steps” inserted as comments into the method body. Thanks to the rich templating support in the Intelli Platform, generated test templates can be easily customized to fit each team’s needs.
If you copy a test case to the clipboard, IntelliJ IDEA Ultimate is smart enough to paste it as a test method in Java or Kotlin following the same template.!
If you have set up custom annotation classes as references to TMS elements, the Test Management plugin makes it possible to analyze which test cases are referenced from code and which are not. This makes it easy to find all test cases that need to be automated.
Also, it is very important to find possibly outdated or obsolete automated tests that point to non-existent test cases. The Find All Unresolved TMS Links action will show you all the test methods that have broken links to TMS elements.
How to try it
To give these features a try, make sure you are using the latest version of IntelliJ IDEA Ultimate 2021.1 and install the Test Management plugin from Test Automation Kit.