{"id":15144439,"url":"https://github.com/ericchiachi/bdd-library","last_synced_at":"2026-01-20T05:01:21.990Z","repository":{"id":205030635,"uuid":"713197345","full_name":"ericchiachi/BDD-Library","owner":"ericchiachi","description":"BDD Library is a Robot Framework library that supports the use of Gherkin syntax, include Feature, Scenario, Scenario Outline(with Example), and Embedding table.","archived":false,"fork":false,"pushed_at":"2023-11-07T08:45:39.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T17:33:32.380Z","etag":null,"topics":["acceptance-testing","gherkin","robotframework"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericchiachi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-02T03:01:34.000Z","updated_at":"2024-10-02T11:25:31.000Z","dependencies_parsed_at":"2023-11-07T09:45:38.204Z","dependency_job_id":null,"html_url":"https://github.com/ericchiachi/BDD-Library","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"ebdad8819beb233f6a42d410539f7315df96ed80"},"previous_names":["ericchiachi/bdd-library"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericchiachi/BDD-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericchiachi%2FBDD-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericchiachi%2FBDD-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericchiachi%2FBDD-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericchiachi%2FBDD-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericchiachi","download_url":"https://codeload.github.com/ericchiachi/BDD-Library/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericchiachi%2FBDD-Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28596087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acceptance-testing","gherkin","robotframework"],"created_at":"2024-09-26T10:41:19.130Z","updated_at":"2026-01-20T05:01:21.974Z","avatar_url":"https://github.com/ericchiachi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BDD Library\n\n## Introduction\n\nBDD Library is a [Robot Framework](https://github.com/robotframework/robotframework) library that supports the use of [Gherkin syntax](https://cucumber.io/docs/gherkin/reference/), include `Feature`, `Scenario`, `Scenario Outline`(with `Example`), `Background`, and `Embedding table` style.\n\nThe BDD Library is written in python. It utilizes a Listener Interface to retrieve the original test script containing Gherkin syntax and parses it as an executable script.\n\n## Usage\n\nRobot Framework natively supports only the `Given`, `When`, `Then`, `And`, `But` keywords. By utilizing the BDD Library, you can use the entire Gherkin syntax for your testing scenarios.\n\n## Setup\n\nBelow is an example of how to use the BDD Library. Simply include **BDDLibrary** in the **Settings** segment.\n\n    *** Settings ***\n    Library    BDDLibrary\n\n## Example\n\nIn this section, we will provide a brief introduction to these keywords. For more examples, please refer to the examples located within the `./Test` directory.\n\nFor the definitions and purposes of these keywords, please refer to [Gherkin keywords](https://cucumber.io/docs/gherkin/reference/#keywords).\n\n### 1. Feature\n\nThe `Feature` keyword is used to describe the scope of a software feature. A Feature typically encompasses multiple related scenarios.\n\nIn Robot Framework, the fundamental unit of a file is a `Suite`. According to its definition, a Suite should be capable of containing multiple features. However, when a suite contains multiple features, it can be confusing for readers as they would need to check the rows of a scenario to determine which feature it belongs to. To prevent this confusion, we limit a suite file to containing only one feature.\n\nWhen using BDD Library, the `Feature` must be the first test element in Test Case section. The syntax is `Feature`, followed by a `:` , `space`, and a brief description of the feature.\n\nIf you need to descript the feature in more detail, you can use `[Documentation]` to provide additional information.\n\n    *** Test Cases***\n    Feature: Example of Feature and Scenario keyword\n        [Documentation]    In BDDLibrary, Feature must be the first test element\n\n    Scenario: Scenario will be executed with Feature\n        Then The scenario should be execute\n\n### 2. Scenario\n\nIn `Scenario` keyword, we use concrete example to descript feature, which consists of multiple steps.\n\nWhen using BDD Library, the `Scenario` must come after `Feature`. The syntax is `Scenario`, followed by a `:` , a `space`, and a brief description of the scenario.\n\nA Feature can contain multiple Scenarios.\n\n    *** Test Cases***\n    Feature: Example of Feature and Scenario keyword\n        [Documentation]    In BDDLibrary, Feature must be the first test element\n\n    Scenario: Scenario will be executed with Feature\n        Then The scenario should be execute\n    \n    Scenario: Multiple Scenarios will be executed\n        Then The scenario should be execute\n\n### 3. Scenario Outline (with Examples)\n\nTo run a scenario multiple times with different combinations of data, you can utilize a `Scenario Outline`.\n\nWhen using BDD Library, the `Scenario Outline` must come after `Feature`. The syntax is `Scenario Outline`, followed by a `:` , a `space`, and a brief description of the scenario. In your test script, you should mark the given data with `\u003c` and `\u003e`, indicating where different combinations of data will be inserted.\n\nAt the end of a Scenario Outline, you should include an `Examples` section, which consists of a `:` followed by a `Data table`. The data table typically includes the following components:\n\n- The first line of Data Table specifies the `Name` of the datas.\n- Subsequent lines contain `Values` of the datas.\n- Each different datas seperated by `|` charactor.\n\nHere is an example:\n\n    Scenario Outline: Keyword: `Example` should work when multiple keys exist\n    Given I have an empty list\n    When I append \u003cname\u003e into the list\n    Then The list should contain \u003cname\u003e\n    But The list should not contain \u003cnotExistingName\u003e\n    Examples:\n    ...    | name | notExistingName |\n    ...    | Bob | Jackson |\n    ...    | Alice | John |\n\n### 4. Embedding Table\n\nTo execute a specified step in a Scenario multiple times with different values, you can utilize an `Embedding Table`. To do this, you can place a `Data Table` after a specified step, and the step will be executed multiple times within the scenario, with each execution using different `Values` from the data table as parameters.\n\n    Scenario: Embedding keyword should repeat the keyword with table multi times\n    Given There is a bank with following accounts\n    ...    | name | balance |\n    ...    | John | 10000 |\n    ...    | Alice | 1000 |\n    ...    | Bob | 100 |\n    When Each person pick up 1000 from their account\n    Then The balance should be same as following\n    ...    | name | balance |\n    ...    | John | 9000 |\n    ...    | Alice | 0 |\n    ...    | Bob | -900 |\n\nWhen implementing a keyword with an Embedding Table, you should structure it as follows:\n\n1. the first argument must be a [Scalar Variable](https://docs.robotframework.org/docs/variables). BDD Library will pass a dictionary into the argument, whos key is the `Names` of data table, and value is the `Values` of data table.\n\n2. The second argument must be a [List Varaible](https://docs.robotframework.org/docs/variables) which is a placeholder, BDD Library will pass a None to it.\n\n[//]: # (This use to end the list)\n\n    There is a bank with following accounts\n    [Arguments]    ${accountInfo}    @{placeHolder}\n    Set To Dictionary    ${accounts}    ${accountInfo}[name]=${accountInfo}[balance]\n\nAnother benefit of using an Embedding Table is that it allows you to display complex data in a single step. This can enhance the readability and comprehensibility of your scenarios. Even if a step needs to be executed only once, if the provided data is important for the reader's understanding, it is recommended to use the Embedding Table to present that data. This can make your scenarios more informative and easier to follow.\n\nEmbedding Table can also use with Scenario Outline, in the previous example, if the values have no direct relationship, you can utilize a Scenario Outline to split the scenario into distinct parts.\n\n    Scenario Outline: Embedding keyword could use with Scenario Outline\n    Given There is a bank with following accounts\n    ...    | name | balance |\n    ...    | \u003cName\u003e | \u003cOriginBalance\u003e |\n    When Each person pick up 1000 from their account\n    Then The balance should be same as following\n    ...    | name | balance |\n    ...    | \u003cName\u003e | \u003cNewBalance\u003e |\n    Examples:\n    ...    | Name | OriginBalance | NewBalance |\n    ...    | John | 10000 | 9000 |\n    ...    | Alice | 1000 | 0 |\n    ...    | Bob | 100 | -900 |\n\n### 5. Background\n\nWhen there is repeating Given step in a Feature, you can grouping them under Background section. The BDD Library will then automatically include these background steps before each Scenario.\n\nWhen using BDD Library, the `Background` must be the second test element in Test Case section, there should be no Scenario placed before the Background. The syntax is `Background`, followed by a `:`, and the execatable step of background.\n\n    Feature: Background Keyword\n        [Documentation]    An acceptance criteria of Background keyword\n        \n    Background:\n        Given I have a list that only contains Bob\n\n    Scenario: Steps in `Background` should execute before Scenario\n        When I append Isaac into the list\n        Then The list should contain Bob\n        And The list should contain Isaac\n\n### 6. Tags\n\nRobot Framework supports users in executing specified test cases by using tags. However, because there are no defined criteria for tagging the `Feature` and `Background` keywords, these keywords will not be processed by the BDD Library when users execute tests based on scenario tags. This will result in an exception.\n\nTo prevent exception, we recommend assigning a `Default Tags` to all test elements within the suite and using the `[Tags]` tag to override the default tag as needed.\n\n    Default Tags    Test-Background-Keyword\n\n    *** Test Cases ***\n    Feature: Background Keyword\n        [Documentation]    An acceptance criteria of Background keyword\n        \n    Background:\n        Given I have a list that only contains Bob\n\n    Scenario: Keyword `Background` should execute before test case\n        [Tags]    Test-Background-Execute-Before-Each-Test\n        When I append Isaac into the list\n        Then The list should contain Bob\n        And The list should contain Isaac\n\nIn the example case, you can execute the case with a command as follows:\n\n    robot -i Test-Background-Keyword -i Test-Background-Execute-Before-Each-Test\n\n## Contributor\n\nThis library was developed by the individuals listed below. Please don't hesitate to contact us if you encounter any issues.\n\n- [Paul](https://github.com/Paul0730)\n- [Eric Chang](https://github.com/ericchiachi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericchiachi%2Fbdd-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericchiachi%2Fbdd-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericchiachi%2Fbdd-library/lists"}