Back to QMetry All Products Help Page
Import and Create Test Cases Using BDD Feature File
Introduction
QTM4J supports importing test cases via a BDD feature file. It is an effective approach to ensuring software behaves as expected while fostering clear communication and collaboration among all team members. By using Gherkin syntax in feature files, teams can write tests that are simple to understand, easy to maintain, and straightforward to execute, resulting in a seamless and efficient testing process.
Benefits of Using BDD Feature Files to Import Test Cases
Improved Collaboration: Writing tests in plain language fosters better collaboration between business analysts, developers, and testers. Everyone can understand the tests, regardless of their technical expertise.
Clear Specifications: Feature files provide clear and concise documentation of the expected system behavior. These can serve as living documentation that evolves alongside the software.
Automation: Once the feature files are defined, they can be used for automated regression testing, ensuring the system continues to behave as expected over time.
Reduced Miscommunication: Because the tests are written in natural language, misunderstandings and miscommunications between stakeholders are minimized.
Test Reusability: Steps defined in feature files can be reused across multiple scenarios, leading to cleaner and more maintainable tests.
→ Pre-requisite: To display the BDD section on the Story issue page in Jira, the BDD Panel option should be enabled in the Project Settings. Refer to BDD in QMetry Test Management for Jira (QTM4J) for more details on configuring BDD and enabling the BDD panel.
→ Required Permissions: The following table shows permissions required to perform the corresponding operations.
Operation | Required Permissions |
---|---|
Import Test Case |
|
Update Test Case |
|
Link Test Case |
|
Link Requirement |
|
Add Labels |
|
Parameter |
|
Business Rules
The files with the following attributes are supported:
Format: .feature files
File Size: Files with a total size of up to 10 MB, with each file having a maximum size of 1 MB
Limit of Number of Files: Individual files up to a maximum 10 files
Test Cases can be reused using the Test Case Key. The latest version of the test case that matches the Test Case Key will be updated.
Requirements can be linked to test cases using the Story Key. The test case version will be linked to the mentioned Story Key.
When the feature file is imported from the Test Case list view, the Examples in the feature file will become the @Parameters in steps and variables will become Parameters.
The feature has been tested exclusively within the Cucumber framework.
To know more about the guidelines followed for parsing the file, refer to Reference | Cucumber.
Mapping of Feature File with QTM4J Fields for Import
The following table displays the mapping of the feature file with QTM4J fields.
Scenario | QTM4J Test Case Mapping | Example/Note |
Scenario Name | Test Case Summary | NA |
Feature Name | Description | NA |
Steps | Test Steps | Includes Keyword and Step |
Data Table in Steps | Steps Summary |
|
Docstrings in Steps | Steps Summary |
|
Tags | Labels
| The tags at the Feature File level and at the Scenario/Outline level will be added as labels. |
@testcasekey | Test Case Key | When importing the feature file, test cases can be reused by adding an annotation to the file.
|
@storykey | Jira Requirements | When importing the feature file, existing Jira stories can be reused by adding an annotation to the file.
|
Background Steps (Scenario Level) | Steps | These Background steps will be added as initial steps of the test case created from the scenario. |
Background Step (Feature File Level) | Steps (i.e., initial steps of all test cases) | These Background steps will be added as initial steps of all the test cases created from the scenarios under the Feature. |
Rule | Description | The first line of the Rule will be appended to the Description of the test case along with the Feature name separated by a semicolon ( ;). |
Examples (Scenario Outline) | Parameters | Examples will become the @Parameters in Steps. Variables will be Parameters in Test Data. If duplicate parameter values exist in the .feature file, they will be created as a single value under Configuration > Parameters and will be reused under Test Case > Steps tab > Parameters section. |