Accessibility Automation on Cucumber-TestNG
Quick start guide to integrate Accessibility Automation with Cucumber-TestNG
Pre-requisites
- You have an account with BrowserStack (even a free trial works) and can get your Username and Access Key from Account & Profile.
- You have a Cucumber test suite which runs on BrowserStack Automate.
- You are using cucumber-java version 5 or above, Java version 8 or above (if using Gradle, Java version 9 or above is required), Selenium version 2.5 or above (W3C/JSON Wire).
- If you are using CLI for running tests, ensure that Maven or Gradle are installed on your machine, its environment variables are set, and its bin is added to system path, $PATH.
Integrate with Accessibility Automation
Follow the steps below to get started with adding Accessibility Automation to your test suite:
Install the latest BrowserStack SDK using Maven Archetype
Copy & run the below command on your terminal/command prompt to add browserstack-java-sdk
dependency and browserstack.yml
file in your project.
mvn archetype:generate -B -DarchetypeGroupId=com.browserstack \
-DarchetypeArtifactId=browserstack-sdk-archetype-integrate -DarchetypeVersion=1.0 \
-DgroupId=com.browserstack -DartifactId=browserstack-sdk-archetype-integrate -Dversion=1.0 \
-DBROWSERSTACK_USERNAME=YOUR_USERNAME -DBROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY \
-DBROWSERSTACK_FRAMEWORK=cucumber-testng
Set up the browserstack.yml file
Once you have installed the SDK, a browserstack.yml
config file will be created at the root level of your project. Set up this config file as follows:
The projectName
and buildName
config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate since Accessibility Automation will automatically identify different build runs.
userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY
projectName: "Your static project name goes here"
buildName: "Your static build/job name goes here"
framework: cucumber-testng
...
accessibility: true
Accessibility testing will only run on Desktops (Mac & Windows) with Chrome 95 & above on Automate.
Run your suite with BrowserStack Accessibility Automation
Continue running your tests as you have been running previously. The command to run your tests using the BrowserStack SDK remains unchanged. For your reference, here’s a sample command:
mvn test -P sample-test
Once the build has completed and the Accessibility report is ready, it will automatically get sent to the Accessibility Automation dashboard.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!