{"id":18459129,"url":"https://github.com/smartbear/zephyr-scale-junit-integration","last_synced_at":"2025-04-08T05:34:55.562Z","repository":{"id":43782210,"uuid":"408960443","full_name":"SmartBear/zephyr-scale-junit-integration","owner":"SmartBear","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-05T08:41:43.000Z","size":47,"stargazers_count":3,"open_issues_count":10,"forks_count":4,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-23T07:12:07.425Z","etag":null,"topics":["open-source","zephyr-scale"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmartBear.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-21T20:10:01.000Z","updated_at":"2024-11-05T08:09:01.000Z","dependencies_parsed_at":"2024-04-30T10:45:00.612Z","dependency_job_id":"35499b2d-2c41-4d44-bb75-a52a1a125972","html_url":"https://github.com/SmartBear/zephyr-scale-junit-integration","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fzephyr-scale-junit-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fzephyr-scale-junit-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fzephyr-scale-junit-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartBear%2Fzephyr-scale-junit-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartBear","download_url":"https://codeload.github.com/SmartBear/zephyr-scale-junit-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785919,"owners_count":20995641,"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":["open-source","zephyr-scale"],"created_at":"2024-11-06T08:21:57.690Z","updated_at":"2025-04-08T05:34:50.543Z","avatar_url":"https://github.com/SmartBear.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[ ![Download](https://api.bintray.com/packages/avst/TM4J/tm4j-junit-integration/images/download.svg) ](https://bintray.com/avst/TM4J/tm4j-junit-integration/_latestVersion)\n\n# Zephyr Scale Junit Integration\n\nThis project is a Zephyr Scale JUnit Integration which aims to generate a file describing the test execution result for each Test Case.\n\nIn order to achieve that, you need to annotate the JUnit methods with `@TestCase(key = \"JQA-T2\")` or `@TestCase(name = \"\")`.\n\nJUnit methods which are not annotated with `@TestCase` will also be added to the JSON file, but without the Test Case Key property.\n\nJUnit methods which are not annotated with `@TestCase(name = \"\")` will also be added to the JSON file, but without the Test Case Name property.\n\n## Usage\n\nYou can have a look at this [Zephyr Scale JUnit Integration Example](https://github.com/SmartBear/zephyr-scale-junit-integration-example) repository.\n\nYou need to add the dependency to your pom file.\n\n```\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.smartbear\u003c/groupId\u003e\n        \u003cartifactId\u003ezephyrscale-junit-integration\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.0\u003c/version\u003e\n        \u003cscope\u003etest\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nAlso, you'll need to register the Zephyr Scale JUnit Listener.\n\n```\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n            \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e2.22.0\u003c/version\u003e\n            \u003cconfiguration\u003e\n                \u003cproperties\u003e\n                    \u003cproperty\u003e\n                        \u003cname\u003elistener\u003c/name\u003e\n                        \u003cvalue\u003ecom.smartbear.zephyrscale.junit.ExecutionListener\u003c/value\u003e\n                    \u003c/property\u003e\n                \u003c/properties\u003e\n            \u003c/configuration\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\nThe next step is to annotate your JUnit tests with `@TestCase` or don't annotate at all, if the Test Case doesn't exist yet.\n\n```\npublic class CalculatorSumTest {\n\n    @Test\n    @TestCase(key = \"JQA-T1\")\n    public void sumTwoNumbersAndPass() {\n        Calculator calculator = new Calculator();\n        assertEquals(1, calculator.sum(1, 2));\n    }\n\n    @Test\n    @TestCase(key = \"JQA-T2\")\n    public void sumTwoNumbersAndFail() {\n        Calculator calculator = new Calculator();\n        assertNotEquals(2, calculator.sum(1, 2));\n    }\n\n    @Test\n    public void notMappedToTestCaseAndPass() {\n        Calculator calculator = new Calculator();\n        assertEquals(1, calculator.sum(1, 2));\n    }\n\n    @Test\n    @TestCase(name = \"Mapped to Test Case Name and Pass\")\n    public void mappedToTestCaseNameAndPass() {\n        Calculator calculator = new Calculator();\n        assertEquals(1, calculator.sum(1, 2));\n    }\n\n}\n\n```\n\nNow, you can run your tests with `mvn test` and the Zephyr Scale test execution result file will be generated in the same execution folder.\n\n### zephyrscale_result.json\n\n```\n{\n   \"version\": 1,\n   \"executions\":[\n      {\n         \"source\":\"CalculatorSumTest.sumTwoNumbersAndPass\",\n         \"result\":\"Passed\",\n         \"testCase\": {\n            \"key\": \"JQA-T1\"\n         }\n      },\n      {\n        \"source\":\"CalculatorSumTest.sumTwoNumbersAndFail\",\n        \"result\":\"Failed\",\n         \"testCase\": {\n            \"key\": \"JQA-T2\"\n         }\n      },\n      {\n        \"source\":\"CalculatorSumTest.notMappedToTestCaseAndPass\",\n        \"result\":\"Passed\"\n      },\n      {\n        \"source\":\"CalculatorSumTest.mappedToTestCaseNameAndPass\",\n        \"result\":\"Passed\",\n         \"testCase\": {\n            \"name\": \"Mapped to Test Case Name and Pass\"\n         }\n      }\n   ]\n}\n```\n\n## Support\n\nFor any issues or enquiries please get in touch with the Zephyr Scale team at SmartBear using the [support portal](https://support.smartbear.com/zephyr-scale/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartbear%2Fzephyr-scale-junit-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartbear%2Fzephyr-scale-junit-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartbear%2Fzephyr-scale-junit-integration/lists"}