---
title: "BDD Step Library"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/44577261/BDD%20Step%20Library"
format: markdown
---
<details>
<summary>Table of Contents</summary>

> Macro (toc)
</details>

# Introduction

The BDD Step Library provides an overview of all the automated ([Gherkin](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565320)) Steps used in the context of the projects included in the library, allowing users to manage and refactor the Steps easily.

A library can be related to a [single project](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578443) or shared between [multiple projects](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578399) so they can access the same Gherkin Steps.

The library is **automatically populated** when Gherkin Tests and Preconditions are created or updated:

- Gherkin Steps used in the changed tests/preconditions that do not exist in the library are automatically created.
- Steps in the library that are no longer used by any Gherkin tests/preconditions are automatically deleted (except for static Steps).

The Steps in the library will then appear as suggestions in the Gherkin editor when editing the scenario definition of Gherkin Tests or [Preconditions](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565159).

> ℹ️ Gherkin reserved keywords (e.g. *Given*, *When*, *Then*, *And*) are not stored in the BDD Step Library.

# BDD Step Library Screen

## Access

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Areas

Figure 4 depicts the key areas of the BDD Step Library screen:

![Figure 4 - Areas](media://85fc6c8f-72ef-4de4-a487-7a53c140007c)

Here, you can:

- Add a new Test Step (Figure 4 - 1).
- Manage the Test Step filters (Figure 4 - 2).
- See the Steps list (Figure 4 - 3):
  - Step definition (Figure 4 - 4).
  - Static Step tag (Figure 4 - 5).
  - Deprecated step tag (Figure 4 - 6).
  - Step labels (Figure 4 - 7).
- See the details of the select Step (Figure 4 - 8).

### Gherkin Step Definition

Changing the Step definition directly in the library results in a refactor of all the Gherkin tests and preconditions using it. The Gherkin definition of all those Issues will be automatically updated to reflect the updated step definition.

Each Step in the library must have a unique definition. An error message will be displayed if you try to change the Step definition to an already existing definition (Figure 5 - 1).

![Figure 5 - Error.png](media://9f55ea78-21e6-46ff-a911-f321f66c7e57)

> ℹ️ The Step definition must not include a Gherkin step keyword (e.g. *Given*, *When*, *Then*, *And*). The Step keyword to be used must be defined at the Test/Precondition level.

To search Steps by Gherkin definition, you can use the [text search filter](#Text search filter) (Figure 4 - 2).

### Step Description (Figure 4 - 4)

A description to provide some extra information or context regarding the Step.

### Step Labels (Figure 4 - 7)

Steps can be labeled to be easily found when [filtering steps](#Labels filter). Since a Step may be related to different things simultaneously, you can add multiple labels to the Step.

### Deprecated Step (Figure 4 - 6)

Steps tagged as *DEPRECATED* are **not displayed as suggestions in the Gherkin editor** when editing Gherkin Tests or Preconditions.

Deprecated steps can also be hidden from the Steps list in the library by disabling the *[Deprecated Steps](#Deprecated steps filter)*[ filter](#Deprecated steps filter).

### Static Step (Figure 4 - 5)> Macro (anchor)



By default, Steps are automatically deleted from the library when any Gherkin Test or Precondition is no longer using them. However, you can mark a Step as static if you want to **keep it in the library even if it is no longer being used**. Static Steps will never be automatically deleted, but they can still be [manually deleted](#Delete steps).

Static Steps can be easily found using the *[Only static Steps](#Static steps filter)*[ filter](#Static steps filter).

# Operations

## Editing Steps

> ℹ️ Steps can only be edited directly in the library if you are included in the permission groups defined for the library (see [project library settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578443) and [global libraries settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578399) for information about library permission groups configuration). If you don't have permission to edit the Steps, the Step details section will be displayed in read-only mode.

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Creating Steps

> ℹ️ Steps can only be manually created directly in the library if you are included in the permission groups defined for the library (see [project library settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578443) and [global libraries settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578399) for information about library permission groups configuration).

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> Steps can be manually created by clicking *New step* button (Figure 8 - 1).
> 
> ![Figure 8 - New step](media://9ffb5d21-8ac8-4d2a-bdbc-9bf5a4ee3307)
> 
> > Macro (rw-step)
> 
> A placeholder Step for the Step being created will appear selected at the top of the Steps list (Figure 8 - 2), and the Step details section will display the empty fields ready to be filled (Figure 8 - 3).
> 
> > ℹ️ Steps created directly in the library are always **static by default**. This can not be changed while creating the Step (the static step checkbox will display in read-only mode), but can later be edited after creating the Step.
> > ℹ️ 
> > ℹ️ Each Step in the library must have a **unique definition** (Figure 8 - 3). An error message will be displayed (Figure 9) if you try to manually create a Step with an already existing definition (only after clicking *Save* - Figure 8 - 4).
> 
> ![Figure 9 - Error.png](media://46e8cde8-63ec-4a75-8114-8ba02845f8b6)
> 
> > Macro (rw-step)
> 
> Once you're done, click the *Save* button (Figure 8 - 4). After saving the Step, the placeholder Step in the Steps list will be replaced by the created Step definition (Figure 10 - 1).
> 
> ![Figure 10 - Definition](media://81d4bc9c-b3ec-4603-bc70-d100d36734d8)

## Deleting Steps> Macro (anchor)



> ℹ️ Steps can only be manually deleted directly in the library if you are included in the permission groups defined for the library (see [Project Library settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578443) and [Global Libraries settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578399) for information about library permission group configuration).

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > ℹ️ - The *Delete* button is **only available for Static steps** (Figure 11 - 2) since those are the only Steps that can be manually deleted. Non-static steps are automatically deleted when they are no longer being used by any Issue.
> > ℹ️ - If the Step is **static but is being used** by some Issue(s), the *Delete*** **button will appear disabled since only unused Steps are allowed to be deleted.

## Filtering Steps

Steps can be easily searched by using the [filters section at the top of the screen](#Filters section). The steps list will only display the Steps included in the defined filters. You can filter Steps by executing these operations:

![Figure 12 - Steps](media://286c4c94-9dc5-477e-9741-f84c282a1227)

- **Text search (Figure 12 - 9):** w<span style="color: #172b4d">rite text to find Steps that include it that text in their Gherkin definition.</span>  > Macro (anchor)
- **Labels (Figure 12 - 11):** select labels to find Steps that have at least one of those labels.> Macro (anchor)
- **Deprecated Steps (Figure 12 - 10):** enable this option to include deprecated Steps in the steps displayed in the Steps list. > Macro (anchor)
- **Only unused Steps (Figure 12 - 10):** enable this option to only display Steps not being used by any Issue in the Steps list.
- **Only static Steps (Figure 12 - 10):** enable this option to only display static Steps in the Steps list.> Macro (anchor)

> ℹ️ The applied filters are saved when they are changed so that when you come back to the BDD Step Library page, you find those filters applied.

## Finding Issues Using a Step> Macro (anchor)



> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

  


<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577312).
</details>