{"id":21944750,"url":"https://github.com/browserstack/cucumber-java-browserstack","last_synced_at":"2025-10-18T09:36:43.246Z","repository":{"id":15575458,"uuid":"78411976","full_name":"browserstack/cucumber-java-browserstack","owner":"browserstack","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-29T05:37:50.000Z","size":129,"stargazers_count":7,"open_issues_count":5,"forks_count":24,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-22T21:06:10.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/browserstack.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-09T09:05:36.000Z","updated_at":"2025-03-31T10:40:58.000Z","dependencies_parsed_at":"2024-06-19T20:34:06.330Z","dependency_job_id":null,"html_url":"https://github.com/browserstack/cucumber-java-browserstack","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/browserstack%2Fcucumber-java-browserstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fcucumber-java-browserstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fcucumber-java-browserstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fcucumber-java-browserstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserstack","download_url":"https://codeload.github.com/browserstack/cucumber-java-browserstack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250324692,"owners_count":21411946,"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":[],"created_at":"2024-11-29T04:17:02.259Z","updated_at":"2025-10-18T09:36:38.206Z","avatar_url":"https://github.com/browserstack.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cucumber Java Browserstack \n\n| [Cucumber-TestNG](https://github.com/browserstack/cucumber-java-browserstack/tree/master) | [Cucumber-JUnit4](https://github.com/browserstack/cucumber-java-browserstack/tree/cucumber-junit4) | [Cucumber-JUnit5](https://github.com/browserstack/cucumber-java-browserstack/tree/cucumber-junit5) |\n| ------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------- |\n\n![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)\n\n[Cucumber JVM](https://cucumber.io/docs/reference/jvm) Integration with BrowserStack.\n\n## Using Maven\n\n### Run sample build\n\n- Clone the repository\n- Replace YOUR_USERNAME and YOUR_ACCESS_KEY with your BrowserStack access credentials in browserstack.yml.\n- Install dependencies `mvn compile`\n- To run the test suite having cross-platform with parallelization, run `mvn test -P sample-test`\n- To run local tests, run `mvn test -P sample-local-test`\n- To view Allure Reports, run `allure serve target/allure-results`\n\nUnderstand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)\n\n### Integrate your test suite\n\n* Install dependencies `mvn compile`\n* Create sample browserstack.yml file with the browserstack related capabilities with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings) and place it in your root folder.\n* Add maven dependency of browserstack-java-sdk in your pom.xml file\n```sh\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.browserstack\u003c/groupId\u003e\n    \u003cartifactId\u003ebrowserstack-java-sdk\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST\u003c/version\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n* Modify your build plugin to run tests by adding argLine `-javaagent:${com.browserstack:browserstack-java-sdk:jar}` and `maven-dependency-plugin` for resolving dependencies in the profiles `sample-test` and `sample-local-test`.\n```\n            \u003cplugin\u003e\n               \u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n                 \u003cexecutions\u003e\n                   \u003cexecution\u003e\n                     \u003cid\u003egetClasspathFilenames\u003c/id\u003e\n                       \u003cgoals\u003e\n                         \u003cgoal\u003eproperties\u003c/goal\u003e\n                       \u003c/goals\u003e\n                   \u003c/execution\u003e\n                 \u003c/executions\u003e\n            \u003c/plugin\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e3.0.0-M5\u003c/version\u003e\n                \u003cconfiguration\u003e\n                    \u003csuiteXmlFiles\u003e\n                        \u003csuiteXmlFile\u003esrc/test/resources/testng.xml\u003c/suiteXmlFile\u003e\n                    \u003c/suiteXmlFiles\u003e\n                    \u003cargLine\u003e\n                        -javaagent:${com.browserstack:browserstack-java-sdk:jar}\n                    \u003c/argLine\u003e\n                \u003c/configuration\u003e\n            \u003c/plugin\u003e\n```\n\n### Migrate from Vanilla Cucumber to use Testng Runner \n* If you are using Vanilla Cucumber CLI, you can migrate to use TestNG Runner with BrowserStack using the below command :\n```\nmvn archetype:generate -DarchetypeGroupId=com.browserstack -DarchetypeArtifactId=cucumber-testng-archetype -DarchetypeVersion=1.0 -DgroupId=com.browserstack -DartifactId=cucumber-testng-archetype -Dversion=1.0 -DinteractiveMode=false\n```\n* Run your tests using `mvn test`\n* To use specific `@CucumberOptions` in generated class `BrowserStackCucumberTestNgRunner`, refer - https://javadoc.io/static/io.cucumber/cucumber-testng/5.0.0-RC2/io/cucumber/testng/CucumberOptions.html\n\n## Using Gradle\n\n### Run sample build\n\n- Clone the repository\n- Install dependencies `gradle build`\n- To run the test suite having cross-platform with parallelization, run `gradle sampleTest`\n- To run local tests, run `gradle sampleLocalTest`\n\nUnderstand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)\n\n### Integrate your test suite\n\n* Install dependencies `gradle build`\n* Following are the changes required in `gradle.build` -\n    * Add `compileOnly 'com.browserstack:browserstack-java-sdk:latest.release'` in dependencies\n    * Fetch Artifact Information and add `jvmArgs` property in tasks *SampleTest* and *SampleLocalTest* :\n  ```\n  def browserstackSDKArtifact = configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.find { it.name == 'browserstack-java-sdk' }\n  \n  task sampleTest(type: Test) {\n    useTestNG() {\n      dependsOn cleanTest\n      useDefaultListeners = true\n      suites \"config/sample-test.testng.xml\"\n      jvmArgs \"-javaagent:${browserstackSDKArtifact.file}\"\n    }\n  }\n  ```\n\n## Notes\n* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fcucumber-java-browserstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserstack%2Fcucumber-java-browserstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fcucumber-java-browserstack/lists"}