{"id":19792087,"url":"https://github.com/xray-app/tutorial-java-cucumber","last_synced_at":"2025-05-01T02:30:22.379Z","repository":{"id":45245983,"uuid":"377866334","full_name":"Xray-App/tutorial-java-cucumber","owner":"Xray-App","description":"Tutorial for Cucumber using Java integrated with Xray and Jira","archived":false,"fork":false,"pushed_at":"2024-12-16T16:06:08.000Z","size":26,"stargazers_count":6,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-06T07:37:35.317Z","etag":null,"topics":["bdd","cucumber","java","jira","test-automation","testing","xray"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Xray-App.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":"2021-06-17T14:50:56.000Z","updated_at":"2024-12-16T16:06:13.000Z","dependencies_parsed_at":"2024-12-16T12:24:39.890Z","dependency_job_id":"c1db5392-bd71-48c0-b498-f97c4bdf27fb","html_url":"https://github.com/Xray-App/tutorial-java-cucumber","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-java-cucumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-java-cucumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-java-cucumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xray-App%2Ftutorial-java-cucumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xray-App","download_url":"https://codeload.github.com/Xray-App/tutorial-java-cucumber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812224,"owners_count":21647866,"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","cucumber","java","jira","test-automation","testing","xray"],"created_at":"2024-11-12T07:05:52.371Z","updated_at":"2025-05-01T02:30:22.370Z","avatar_url":"https://github.com/Xray-App.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tutorial with Cucumber scenarios/tests, in Java, integrated with Xray\n\n[![build workflow](https://github.com/Xray-App/tutorial-java-cucumber/actions/workflows/main-cloud.yml/badge.svg)](https://github.com/Xray-App/tutorial-java-cucumber/actions/workflows/main-cloud.yml)\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 Cucumber in Java](https://docs.getxray.app/display/XRAYCLOUD/Testing+using+Cucumber+in+Java) showcasing the integration between [Xray Test Management](https://www.getxray.app/) on Jira and Cucumber (Java).\n\nThe test automation code implements some basic tests (i.e. scenarios/scenario outlines) for a dummy calculator, using two stories (i.e. addition and multiplication) as the features we aim to deliver.\n\n## Prerequisites\n\nIn order to run this tutorial, you need to have Java (i.e. a JDK) and Maven.\nDependencies aree installed automatically whenever running Maven.\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, so 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 `mvn` tool.\n\n```bash\nmvn clean compile test -Dcucumber.plugin=\"json:report.json\" -Dcucumber.features=\"features/\"\n```\n\nWe need to specify that we want a Cucumber JSON report as output, and also the path where the .feature files are at.\n\nTests can also run inside a Docker container; local directory/file should be mounted so that Cucumber results are stored locally.\n\n```bash\ndocker build . -t cucumber_java_tests\ndocker run --rm -v $(pwd)/report.json:/source/report.json -t cucumber_java_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/display/XRAYCLOUD/Testing+using+Cucumber+in+Java).\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.\nYou can also have a look at the [workflows implemented in this repo](.github/workflows) using GitHub Actions.\n\n\n## Auxiliary scripts\n\nThis repo also contains some auxiliary shell scripts, provided as an example; feel free to download and customize them to your needs.\nYou may find scripts for interacting both with Xray server/DC or Xray cloud, which have slightly different APIs.\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- [Cucumber docs](https://cucumber.io/docs/installation/)\n- [Possible workflows for implementing Cucumber](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/display/XRAYCLOUD/Testing+using+Cucumber+in+Java)\n- [Detailed tutorial for Xray server/DC showcasing the integration with Jira server/DC](https://docs.getxray.app/display/XRAY/Testing+using+Cucumber+in+Java)\n\n\n## LICENSE\n\n[BSD 3-Clause](LICENSE)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxray-app%2Ftutorial-java-cucumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxray-app%2Ftutorial-java-cucumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxray-app%2Ftutorial-java-cucumber/lists"}