{"id":19792044,"url":"https://github.com/xray-app/tutorial-python-behave","last_synced_at":"2026-06-09T06:31:18.159Z","repository":{"id":119027837,"uuid":"371097435","full_name":"Xray-App/tutorial-python-behave","owner":"Xray-App","description":"Tutorial with Behave test scenarios implemented with Python","archived":false,"fork":false,"pushed_at":"2022-02-01T15:35:19.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-28T15:16:50.128Z","etag":null,"topics":["behave","jira","python","testing","xray"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xray-App.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-05-26T16:16:51.000Z","updated_at":"2024-06-15T04:41:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f4091ce-6168-44c6-a7eb-e76347796999","html_url":"https://github.com/Xray-App/tutorial-python-behave","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Xray-App/tutorial-python-behave","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-python-behave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-python-behave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-python-behave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-python-behave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xray-App","download_url":"https://codeload.github.com/Xray-App/tutorial-python-behave/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-python-behave/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34095242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["behave","jira","python","testing","xray"],"created_at":"2024-11-12T07:05:46.298Z","updated_at":"2026-06-09T06:31:18.155Z","avatar_url":"https://github.com/Xray-App.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tutorial with Behave test scenarios integrated with Xray\n\n[![build workflow](https://github.com/Xray-App/tutorial-python-behave/actions/workflows/main-cloud.yml/badge.svg)](https://github.com/Xray-App/tutorial-python-behave/actions/workflows/main-cloud.yml)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FXray-App%2Ftutorial-python-behave.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FXray-App%2Ftutorial-python-behave?ref=badge_shield)\n[![license](https://img.shields.io/badge/License-BSD%203--Clause-green.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/Xray-App/community)\n\n## Overview\n\nCode that supports the tutorial [Testing using Behave in Python](https://docs.getxray.app/display/XRAYCLOUD/Testing+using+Behave+in+Python) showcasing the integration between [Xray Test Management](https://www.getxray.app/) on Jira and Behave.\n\nThe test automation code implements some basic and dummy tests (credits to the Behave team), just to briefly showcase Behave usage.\n\n## Prerequisites\n\nIn order to run this tutorial, you need to have Python 3.x (e.g. 3.8).\nDependencies can be installed using:\n\n```bash\npip3 install -r requirements.txt\n```\n\n## Running\n\nThe straighforward approach to run everything in a single shot is to invoke the auxiliary script [run_all_cloud_standard_workflow.sh](run_all_cloud_standard_workflow.sh).\nYou need to update the client_id and client_secret to interact with your Xray cloud instance (obtainable from Xray API Keys section); you also need to update the issue keys of the corresponding stories in Jira, that you'll use as basis to generate the .feature file(s).\n\nRemember that to be able to run the scenarios, we need to have the corresponding .feature files. The previous script assumes you are using Xray to manage the specification of the scenarios,\nso you need to extract them from Jira (more on the possible workflows [here](https://docs.getxray.app/pages/viewpage.action?pageId=31622264)).\n\nWhen you have the .feature files, containing the Feature along with the Scenario properly tagged, you can finally run the tests using the `behave` tool.\n\n```bash\nexport PYTHONPATH=.\nbehave --format=cucumber_json126:PrettyCucumberJSONFormatter -o results/cucumber.json  --format=json -o results/behave.json features\n```\n\nTests can also run inside a Docker container; local directory should be mounted so that Behave results are stored locally.\n\n```bash\ndocker build . -t behave_tests\ndocker run --rm -v $(pwd)/results:/source/results -t behave_tests\n```\n\n\n## Submitting results to Jira\n\nResults can be submitted to Jira so that they can be shared with the team and their impacts be easily analysed.\nThis can be achieved using [Xray Test Management](https://www.getxray.app/) as shown in further detail in this [tutorial](https://docs.getxray.app/pages/viewpage.action?pageId=76982913).\nThis repo contains an auxiliary script [import_results_cloud.sh](import_results_cloud.sh) that does that; it uses a configuration file to have Xray's client_id and client_secret.\n\n\n## Contact\n\nAny questions related with this code, please raise issues in this GitHub project. Feel free to contribute and submit PR's.\nFor Xray specific questions, please contact [Xray's support team](https://jira.getxray.app/servicedesk/customer/portal/2).\n\n## References\n\n- [Behave](https://behave.readthedocs.io/en/stable/)\n- [Possible workflows for implementing Cucumber/Behave](https://docs.getxray.app/pages/viewpage.action?pageId=31622264)\n- [Detailed tutorial for Xray Cloud showcasing the integration with Jira Cloud](https://docs.getxray.app/pages/viewpage.action?pageId=76982913)\n- [Custom Cucumber reporter for Behave 1.2.6, based on previous work from fredizzimo](https://gist.github.com/bitcoder/9ca4f143a9ca1afa9fc55666c974f7c8)\n\n\n## LICENSE\n\n[BSD 3-Clause](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxray-app%2Ftutorial-python-behave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxray-app%2Ftutorial-python-behave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxray-app%2Ftutorial-python-behave/lists"}