{"id":16281224,"url":"https://github.com/vchrombie/bdd-testing-behave","last_synced_at":"2025-04-08T17:44:19.013Z","repository":{"id":105088663,"uuid":"465024627","full_name":"vchrombie/bdd-testing-behave","owner":"vchrombie","description":"behaviour driven development testing with python and behave demo","archived":false,"fork":false,"pushed_at":"2022-03-01T20:30:04.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T14:17:16.744Z","etag":null,"topics":["bdd-tests","behave","behavior-driven-development"],"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/vchrombie.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":"2022-03-01T19:13:30.000Z","updated_at":"2022-03-01T21:23:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"4efde6f2-f650-459f-83fd-c585c5a403dd","html_url":"https://github.com/vchrombie/bdd-testing-behave","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"d66e49aacdf46b94d5897130808897e4e45926d6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchrombie%2Fbdd-testing-behave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchrombie%2Fbdd-testing-behave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchrombie%2Fbdd-testing-behave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchrombie%2Fbdd-testing-behave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vchrombie","download_url":"https://codeload.github.com/vchrombie/bdd-testing-behave/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247895757,"owners_count":21014379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bdd-tests","behave","behavior-driven-development"],"created_at":"2024-10-10T19:05:55.597Z","updated_at":"2025-04-08T17:44:18.988Z","avatar_url":"https://github.com/vchrombie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bdd-testing-behave\n\n\u003cimg src=\"https://behave.readthedocs.io/en/stable/_static/behave_logo1.png\" align=\"right\"\u003e\n\n## Installation\n\n```\n$ poetry add behave\n```\n\n## Structure\n\n```\n.\n|____calculator.py\n|____features\n| |____steps\n| | |____steps.py\n| |____calculator.feature\n| |____environment.py\n```\n\n- `calculator.py` contains the source code the calculator app\n- `features/` contains all the files related to `behave` (feature configurations, steps, etc.)\n- `features/calculator.feature` contains the feature configurations for the calculator (features, scenarios, rules, etc.)\n- `features/environment.py` used to define code to run before and after certain events\n- `features/steps/` contains the steps implementations\n- `features/steps/steps.py` contains the steps for calculator\n\n## Example\n\n### tests pass\n```\n(.venv) $ behave\nFeature: Test Calculator Functionality # features/calculator.feature:2\n\n  Scenario: Addition                  # features/calculator.feature:4\n    Given I have the numbers 10 and 5 # features/steps/steps.py:4 0.001s\n    When I add them                   # features/steps/steps.py:11 0.000s\n    Then I expect the result to be 15 # features/steps/steps.py:21 0.000s\n\n  Scenario: Subtraction               # features/calculator.feature:9\n    Given I have the numbers 10 and 5 # features/steps/steps.py:4 0.000s\n    When I sub them                   # features/steps/steps.py:11 0.000s\n    Then I expect the result to be 5  # features/steps/steps.py:21 0.000s\n\n  Scenario: Multiplication            # features/calculator.feature:14\n    Given I have the numbers 10 and 5 # features/steps/steps.py:4 0.000s\n    When I mult them                  # features/steps/steps.py:11 0.000s\n    Then I expect the result to be 50 # features/steps/steps.py:21 0.000s\n\n  Scenario: Division                  # features/calculator.feature:19\n    Given I have the numbers 10 and 5 # features/steps/steps.py:4 0.000s\n    When I div them                   # features/steps/steps.py:11 0.000s\n    Then I expect the result to be 2  # features/steps/steps.py:21 0.000s\n\n1 feature passed, 0 failed, 0 skipped\n4 scenarios passed, 0 failed, 0 skipped\n12 steps passed, 0 failed, 0 skipped, 0 undefined\nTook 0m0.003s\n```\n\n### tests fail\n```\n(.venv) $ behave\nFeature: Test Calculator Functionality # features/calculator.feature:2\n\n  . . .\n\n  Scenario: Modulus                   # features/calculator.feature:24\n    Given I have the numbers 10 and 5 # features/steps/steps.py:4 0.000s\n    When I mod them                   # features/steps/steps.py:11 0.000s\n    Then I expect the result to be 1  # features/steps/steps.py:21 0.000s\n      Assertion Failed: Expected 1, got 0\n      Captured stdout:\n      STEP: Given I have the numbers 10 and 5\n      STEP: When I add them\n      STEP: Then I expect the result to be 1\n\n\n\nFailing scenarios:\n  features/calculator.feature:24  Modulus\n\n0 features passed, 1 failed, 0 skipped\n4 scenarios passed, 1 failed, 0 skipped\n14 steps passed, 1 failed, 0 skipped, 0 undefined\nTook 0m0.002s\n```\n\n\n## Resources\n\n- https://behave.readthedocs.io/en/stable/tutorial.html\n- https://medium.com/@hmurari/bdd-quickstart-with-python-4cf366cfc11c\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvchrombie%2Fbdd-testing-behave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvchrombie%2Fbdd-testing-behave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvchrombie%2Fbdd-testing-behave/lists"}