Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Table of Contents

Overview

Enterprise teams practicing Behavior-Driven Development (BDD) can author, store and sync feature files directly to/from Version Control Systems (VCS) like SVN, Git, GitLab, Bitbucket and Azure DevOps, using the built-in Gherkin editor in QMetry requirements. The two-way syncing between QMetry & VCS keeps developers, testers and product owners up-to-date with the latest source code change commits with automated step definitions. Using QMetry automation agents, test executions could be triggered directly from QMetry. Test cases are smartly created/reused authored based on the feature step definitions and link them to requirements. Test Suite stores the automation execution results ensuring complete feature traceability with requirements.

...

Organizations inject BDD (Behavior-driven Development) techniques to continuously maintain the quality of products. BDD scenarios align development and testing teams to a common goal. The Automation team transforms the provided usage scenarios into tests. The test run results are then analyzed that enable developers to develop and deliver the functionality as expected.

WorkflowImage Removed

...

  • Test Scenarios for upcoming features are written in Gherkin language by a Business Analyst or scenario writer.

  • Once finalized, the code is pushed to the repository configured with QMetry project.

  • Automation Engineers receive notification on updates of BDD Code. 

  • At the time of test execution, the automation engineers get the latest code from the repository and use it to run automation testing.

  • On completion of the test process -

    • automated test cases, test suites, test executions are created in QMetry

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

Pre-requisites

Users should have the following rights in QMetry:

  • Project module "Modify" rights

  • Requirement module "Modify" rights

Users can write BDD Code in -

  • QMetry

  • QMetry Jira Add-on

Configure BDD in QMetry

Steps

...

3. Click on the + sign to add BDD Configuration.Image Removed

...

4. The Add Configuration screen opens. Enter the following details on it:

  • Version Control System: Select the version control system your organization is using as code repository.

  • Type:The field appears on the screen when GIT/Bitbucket/GitLab/Azure DevOps is selected as the Version Control System. Select the edition of the GIT/Bitbucket/GitLab/Azure DevOps i.e. Cloud or Server.

Git Integration

  • Repository URL: Enter the Repository URL for the version control system selected above. Enter Access Token. Follow these steps to generate access token for GitHub. 

...

GitLab Integration

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

  • Version Control System:

     Select

     Select GITLAB as the version control system your organization is using as code repository.

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

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

  • Enter Access Token. 

    Follow 

    Follow these steps to generate access token for GitLab. Provide all the Scopes access.

...

Bitbucket Integration

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

  • Version Control System:

     Select

     Select BITBUCKET as the version control system your organization is using as code repository.

  • Type:

     The

     The field appears on the screen when GIT/Bitbucket is selected as the Version Control System. Select the edition of the GIT/Bitbucket i.e. Cloud or Server.

  • Repository URL:

     Enter

     Enter the cloned Repository URL for Bitbucket.

→ Steps to generate the cloned URL in Bitbucket:

...

2. Copy the cloned repository URL and paste it in QMetry.

...

  • Username, Password: Enter User Name and Password for the Repository. For Bitbucket Cloud, users need to generate the App Password. Read more about How to generate the App Password below.

...

→ How to generate the App Password for Bitbucket Cloud?

...

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

...

4. The Add app password screen opens. Enter Label, choose permissions to be granted and then click Create to create a password with defined permissions.

...

5. The New app password window pops up showing the password.

...

After entering details regarding the the Version Control System above  above - Git or GitLab or Bitbucket, follow the steps mentioned below.

1. Click Click Test to  to verify the provided Repository credentials.

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

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

...

To edit the configuration details, click on the Edit button.

...

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

  • Version Control System: Select AZUREDEVOPS as the version control system your organization is using as a code repository.

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

  • Repository URL: Enter the cloned Repository URL for Azure DevOps.

Steps to generate the cloned URL in AzureDevOps:

Expand
titleExpand to view steps...

1. Log into AzureDevOps, open the team project for your Azure DevOps organization and select Repos, then select Files.

Image Modified

2. Click Clone in the upper right. Copy the cloned repository URL and paste it into QMetry.Image Removed

Image Added


  • Enter Access Token. Follow these steps to generate an access token for Azure DevOps. Provide Full access for Scopes.

...

BDD in QMetry

Note

BDD section in the Requirements module will be visible only when a version control system is configured for the QMetry project.

...

3. Write the BDD Code in the editor.Image Removed

...

4. Enter the following details in support of the code:

  • Version Control: Version Control Systems configured for the Project populate for the field. Select the Version Control System you want to use for the requirement.

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

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

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

...

  • File Name: Enter the name (with file extension) of file that you want to pull/push from/to the repository. The File name should contain only characters, digit and "_" with a file extension. No other special characters and spaces are allowed in the file name. Now QMetry also supports files generated through BDD code in QAS (i.e. one with .bdd extension).  

  • Notify Automation Engineer: Select users to whom notification for BDD update details should be sent.

     By

     By default all the users which are currently on Watchers list for the requirement will be automatically selected. You can select other users of the current project. Thus, multiple users can be notified while pushing BDD modifications to Version Control System.

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

5. You can do either of the following -

  • Save: It will save the BDD content along with other details of requirement in QMetry database. The BDD content will be saved requirement version wise and not at entity level.

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

If you are writing BDD code while creating requirement, then you can only save the code.

...

Pull Code from Repository

...

The BDD panel will be available in Jira add-on for the issue types synced with "Requirement" in QMetry.

Pre-requisites

Writing BDD Code in QMetry Jira Add-on

...

5. Enter the following details in support of the code:

  • Version Control: Version Control Systems configured for the Project populate for the field. Select the Version Control System you want to use for the requirement.

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

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

  • File Name: Enter the name (with file extension) of file that you want to pull/push from/to the repository. The File name should contain only characters, digit and "_" with a file extension. No other special characters and spaces are allowed in the file name. Now QMetry also supports files generated through BDD code in QAS (i.e. one with .bdd extension).  

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

  • Notify User: Select users to whom notification for BDD update details should be sent.

     By

     By default all the users which are currently on Watchers list for the requirement will be automatically selected. You can select other users of the current project.

  • Comment: Enter Comments related to the file. Mandatory for Push to Repository.

You can do either of the following -

  • Save: It will save the BDD content in Jira.

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

...

Pull Code from Repository

...

3. Click on the Pull button. It will pull the latest code from repository and save it automatically in QMetry.

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 QMetry for more details.

On completion of the test process,

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

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

Reusing Existing Test Cases

...

The Test Case ID of existing test case is mentioned in the BDD code using annotation. Individual test case ID can be mentioned for individual scenarios.

  • If the test case is of "Automation" type and the test steps differ, then its version will be updated after execution of the BDD code.

  • If the test case is of "Manual" type, then its new version will be created with "Automation" type test case.

The test scenarios written in the Requirement BDD section are added as test steps of the test case mentioned with annotations.

...

In BDD code, Test Case ID "BDD-TC-18" is mentioned using annotation as @testEntityKey=BDD-TC-18.Image Removed

...

In repository-

...

When the BDD code is executed,

  • If Test Case ID "BDD-TC-18" is a manual test case, then its new version will be created as automated test case.

  • If Test Case ID "BDD-TC-18" is an automated test case, then a new version of it will be created if there is difference in test steps.

Test Scenarios written in the BDD code are added as test steps to the test case.

...

Linking Test Cases to Requirement

...

On the requirements details page, open the Test Case tab  and verify that the test case is linked to the mentioned Requirement ID.Image Removed

...