BDD in QMetry Test Management for Jira (QTM4J)

 

Overview

Enterprise teams practicing Behavior-Driven Development (BDD) can author, store and sync feature files directly to/from Version Control Systems (VCS) like BitBucket, GitHub, and GitLab using the Gherkin editor in Jira stories. The two-way syncing between QMetry Test Management for Jira & VCS keeps developers, testers and product owners up-to-date with the latest source code change commits.

  • BDD editor is provided on the Jira Story issue page, where Business Analysts/Automation testers can write down acceptance criteria in the Gherkin language.

  • The BDD panel is available to all issue types which are configured as a Story in QMetry Project Settings.

  • Supported Version Control Systems are Github/Gitlabs/BitBucket - Cloud & Self-hosted (Server/On-premise).

  • Testers can push as well as pull the BDD content to/from the repository through the BDD editor if the version control system is configured with QMetry Test Management for Jira project.

  • Project Administrator can turn off the BDD panel afterward if it is not required on a given project.

Pre-requisites

Users should have the following rights in QMetry Test Management for Jira:

  • Project administrator rights

  • Configuration View and Modify permissions

  • Requirement View and Edit permissions

To write the BDD Code on the issue page -

  • The Jira issue type should have been mapped as Story in QMetry Project Settings.

Configure BDD in QMetry Test Management for Jira

Steps

Follow the steps described below to configure BDD in QMetry Test Management for Jira.

1. Open the project and go to Projects Settings.

2. Go to QMetry Project Settings.

3. On the QMetry Project Settings screen, open the BDD tab and click on the New BDD Configuration button.

4. The New BDD Configuration screen opens. You can configure BitBucket, GitHub and GitLab as version control systems. Read more details about the integration of each Version Control System in the next sections.

GitHub Integration

The New BDD Configuration screen opens. Enter the following details on it:

  • Version Control: Select GitHub as the version control system for the code repository.

  • Type: Select the edition of the GitHub i.e. Cloud or Server.

  • Repository URL: Enter the Repository URL for the version control system selected above.

  • Access Token: Enter Access Token. Follow these steps to generate an access token for GitHub. 

After entering details regarding the Version Control System, click Test to verify the provided Repository credentials.

Once the Test is verified successfully, click Save to save the repository details in QMetry Test Management for Jira.

GitLab  Integration

The New BDD Configuration screen opens. Enter the following details on it:

  • Version Control System: Select GitLab as the version control system for the code repository.

  • Type: Select the edition of the GitLab i.e. Cloud or Server.

  • Repository URL: Enter the Repository URL for the version control system selected above.

  • Access Token: Enter Access Token. Follow these steps to generate an access token for GitLab. Provide all Scopes access.

After entering details regarding the Version Control System, click Test to verify the provided Repository credentials.

Once the Test is verified successfully, click Save to save the repository details in QMetry Test Management for Jira.

Bitbucket Integration

The New BDD Configuration screen opens. Enter the following details on it:

  • Version Control: Select BitBucket as the version control system for the code repository.

  • Type: Select the edition of the Bitbucket i.e. Cloud or Server.

  • Repository URL: Enter the cloned Repository URL for Bitbucket.

1. Log into Bitbucket and clone the repository.

2. Copy the cloned repository URL and paste it into QMetry Test Management for Jira.

  • Username, Password: Enter Username and Password for the Repository. 

For Bitbucket Server, users can configure the repository using Username and the Password.

→ Username: It is a normal Bitbucket username of the integration user.

→ Password: It is the password of the integration user. Authentication through SSO system is not supported.

For Bitbucket Cloud, users can configure the repository using Username and the App Password.

→ Username: It is a username as per Bitbucket profile settings in Account Settings.

→ App Password: The App password. Read more about How to generate the App Password below.

How to generate the App Password for Bitbucket Cloud?

1. Log into Bitbucket and go to User Profile > Personal Settings.

2. On the Personal Settings screen, click on App passwords under Access Management.

3. Click on the Create app password button to create a new app password.

4. Give the app password a name related to the application that will use the password.

5. Select the specific access and permissions you want this application password to have. It is recommended to select all permissions. Then click Create to create a password with defined permissions.

6. Copy the generated password and paste it into the application you want to give access.

 

After entering details regarding the Version Control System, click Test to verify the provided Repository credentials.

Once the Test is verified successfully, click Save to save the repository details in QMetry Test Management for Jira.

The configured version control system for BDD is displayed on the BDD Configuration tab.

Edit BDD Configuration

To edit the configuration details, hover over the configuration record and click on the Edit icon.

You can edit fields except the Version Control and Type fields.

Delete BDD Configuration

To delete the configuration with the project, hover over the configuration record and click on the Delete icon.

The confirmation message pops up. Click Delete to proceed.

Enable BDD Panel in Jira Story

To display the BDD panel on the Story issue page in Jira, enable the BDD Panel option. If the BDD Panel is disabled, then the BDD panel will not appear on the Story issue page even if the version control systems for BDD are configured with the project.

BDD Code in Jira Story

The BDD section in the Jira Story will be visible only when a version control system is configured for the QMetry Test Management for Jira project and the BDD panel is enabled.

Gherkin editor is provided in the Jira Story. Test Scenarios for the stories are written in BDD code. Once the code is finalized, it can be pushed to GitHub/GitLab/Bitbucket for the use of automation testing. It combines stories/requirements and corresponding scenarios in one place and reduces isolated communication with Automation engineers.

Write Code and Push it to Repository

Steps to write BDD Code in Jira Story issue page and then Push the code to the repository:

1. Open the Jira Story issue page.

2. Go to the QTM4J BDD section. You can see the QTM4J BDD section with the Gherkin editor.

3. Write the BDD Code in the editor. To push/pull the BDD code in the repository, you need to configure the repository with the Jira Story.

4. Configure repository with Jira Story:

(A) Click on the Configure Repository link.

 

The Configure Repository screen opens.

(B) Once you write the BDD Code in the editor, enter the following details in support of the code:

  • Version Control: Version Control Systems that are configured for the Project populate in the field. Select the Version Control System you want to use for the story.

  • Repository URL: Repository populates in accordance with the Version Control System selected above.

  • Branch: Select branch based upon repository selection. You will be able to choose the folder of the respective branch. Branch access depends on the user through whom the BDD integration is done.

  • Folder Path: Click on the Browse button to select the folder from the tree structure to store the BDD file. If a folder path is not given, it will push it into the root directory of the repository.

  • File Name: Enter the name (with file extension) of the file that you want to pull/push from/to the repository.

  • Comment: Enter Comments related to the file. It is mandatory when you are pushing the code to the repository.

5. Save the code. You can Push the code to the repository.

  • Save: It will save the BDD content along with other details of the story in QMetry Test Management for Jira.

  • Push: It will create a feature file with the given name and push it into the specified repository on the given folder path.

The code that is pushed from the Jira Story looks like the following in the Version Control System.

Pull Code from Repository

You can pull the code directly from the repository instead of writing it in the Jira Story. Also, whenever the code in the repository is updated, you can pull the updated code from the repository to QMetry Test Management for Jira and sync the code.

Steps

1. Open the Story issue page.

2. Go to the QTM4J BDD section on the page. Click on the Configure Repository link and configure the repository as described earlier in above section.

3. Click on the Pull button. After showing the warning message, it will pull the latest code from the repository.

 

4. Click Save to save the BDD code in QMetry Test Management for Jira.

BDD Code Execution

  1. The BDD Code is pushed to repository.

  2. The file is created in repository with the extension that you mentioned in file name.

  3. The Repository reference is provided in Jenkins and the Build is triggered from Jenkins.

  4. Build results are published to QMetry Test Management according to the Parameters set in Jenkins. Refer to Jenkins Plugin for QTM4J for more details.

On completion of the test process,

  • automated test cases, test cycles, test executions are created in QMetry.

  • the automation test results are updated on the Execution screen.

Quick Options on BDD Panel

Once the repository is configured with the Jira Story, the Push, Pull and Save options are enabled.

  • Save: Click on Save to edit the code in the panel and Save it in QMetry Test Management for Jira.

  • Push & Pull: Click on the Push/Pull option to push/pull the code directly to/from the repository.

  • Expand View: Click on the Expand View option to open the Configure Repository screen and make any configuration changes.