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.

Pre-requisites

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

To write the BDD Code on the issue page -

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:

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:

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:

1. Log into Bitbucket and clone the repository.

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

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.

→ 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:

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

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,

Quick Options on BDD Panel

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