The Test Management plugin provides integration with test management tools for more transparent interaction between the DEV and QA teams. It supports browsing test suites and case hierarchies, navigation for TMS items, generates unit tests for selected test scenarios, and helps find non-automated test cases or obsolete test methods.
Connect to a remote TMS
While you cannot change test data in a remote TMS, you can still benefit from the integration by linking test data and code. For example, this is useful when searching for outdated tests or candidates for automation.
Press CtrlAlt0S to open the IDE settings and then select Tools | TMS.
In Remote Connections, click Add and select TestRail.
note
Currently, only TestRail 6.7 or later is supported.
Other test management systems will be added in future releases. Feel free to vote for the corresponding requests:
After you have entered valid credentials, specify the test project within the TMS.
Browse and navigate
After you have configured the connection to a test management system, the data gets synchronized and the list of TMS items appears in the TMS tool window. TMS item is the umbrella term for objects that represent test suites, test cases, and test runs in a test management system.
When you browse them, the preview window shows additional details about the selected element.
You can filter the list of TMS items in the TMS tool window according to specific criteria like tags, metadata, and so on.
Filter items
On the toolbar of the TMS tool window, click Edit Filters.
In the Edit Filters dialog, specify the criteria, according to which you want to filter the available TMS items.
After you click OK, the TMS tool window gets updated, and all irrelevant items are filtered out.
Search Everywhere allows you to quickly search for TMS items.
Search for TMS items
Go to Navigate | TMS Item.
Alternatively, press Shift twice and specify the /tms prefix followed by your query.
When a TMS item ID is mentioned in a source code comment, you can open a quick preview for it.
Preview a TMS item from a comment
Hold Ctrl and click the TMS item ID in the comment.
From the TMS tool window, you can get the list of all places that refer to the selected TMS item.
Locate referring code
In the TMS tool window, right-click a TMS item and select Find Usages. Alternatively, select a TMS item and press AltF7.
You can find test cases that are still not covered by unit tests and could possibly be automated. This is possible because of TMS link annotations, which serve as the guide for the analysis.
note
The features described in this chapter only work for tests marked with TMS link annotations.
Find candidates for automation
On the toolbar of the TMS tool window, click Edit Filters.
In the Edit Filters dialog, specify Only non-referenced from code.
Sometimes it happens that a test case has been removed from the TMS and is no longer relevant, however there are still some unit tests that cover it. Not only such tests clutter the codebase, they also take time to execute. TMS plugin helps you find such outdated tests.
Find outdated tests
On the toolbar of the TMS tool window, click Find Unresolved TMS Links.
The results are shown in the Problems tool window.
Generate unit tests
You can generate unit tests for a test case right from the TMS tool window. Unit test generation is only available for Java, Kotlin, and Python.
Select one or more test cases in the TMS tool window and click New Test from Test Cases on the toolbar.
Enter the name for the test class and select the module/package where it will be located.
A test class is generated and populated with test cases, which in turn contain test steps as commented code. The generated piece is framework-agnostic, so you can use it with any testing framework with little customization.
tip
Alternatively, you can copy a test case from the TMS tool window and paste it in the editor. If a suitable context is found, the test case will be converted to unit test boilerplate.
To copy a test case, select the desired one and press Ctrl0C. You can also click the Copy button located in the test case preview, or right-click the test case and select the Copy option from the menu.
If you are working with a specific testing framework, you might want to customize the template so that the generated code conforms to the conventions and has required annotations in place.
Customize the template
Press CtrlAlt0S to open the IDE settings and then select Editor | File and Code Templates.
Open the Other tab, select the required template under Unit test templates for TMS, and modify it as needed.
Our website uses some cookies and records your IP address for the purposes of accessibility, security, and managing your access to the telecommunication network. You can disable data collection and cookies by changing your browser settings, but it may affect how this website functions. Learn more.
With your consent, JetBrains may also use cookies and your IP address to collect individual statistics and provide you with personalized offers and ads subject to the Privacy Notice and the Terms of Use. JetBrains may use third-party services for this purpose. You can adjust or withdraw your consent at any time by visiting the Opt-Out page.