Run accessibility checks on a Serenity sample repo
Try out App Accessibility Automation with BrowserStackβs sample repository.
BrowserStack App Automate supports running Serenity tests on a wide range of real Android and iOS devices. You can integrate your existing Serenity test suites with App Automate to run accessibility checks on your mobile apps.
This guide helps you run your first Serenity test build on a real Android or iOS device on BrowserStack.
Prerequisites
- Ensure you have a BrowserStack Username and Access Key. Obtain your
userName
andaccessKey
from the Account & Profile section on the dashboard.
If you have not yet created an account, sign up for a free trial. - Ensure you have the following installed and configured in your systemβs
PATH
:- Java 8 or higher
- Latest version of Apache Maven
- Latest version of Appium
Run a sample build
Get the sample project
Get the BrowserStack sample Serenity project using one of the following options:
Option 1: Download repository
Download the sample Serenity repository to your system.
Option 2: Clone repository
Clone the sample Git repository using the following commands:
git clone https://github.com/browserstack/serenity-appium-app-browserstack.git
Option 3: Use Maven archetype
Set up a new sample project using the Maven archetype. The following command creates a project with your BrowserStack credentials preconfigured.
Replace YOUR_USERNAME
and YOUR_ACCESS_KEY
with your BrowserStack credentials, and run one of the following commands based on your operating system:
mvn archetype:generate -B -DarchetypeGroupId=com.browserstack \
-DarchetypeArtifactId=browserstack-sdk-archetype-setup -DarchetypeVersion=1.1 \
-DgroupId=com.browserstack -DartifactId=serenity-browserstack -Dversion=1.0 \
-DBROWSERSTACK_USERNAME=YOUR_USERNAME -DBROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY -DBROWSERSTACK_PROJECT_REPO=serenity-browserstack
mvn archetype:generate -B -DarchetypeGroupId="com.browserstack" -DarchetypeArtifactId="browserstack-sdk-archetype-setup" -DarchetypeVersion="1.1" -DgroupId="com.browserstack" -DartifactId="serenity-browserstack" -Dversion="1.0" -DBROWSERSTACK_USERNAME="YOUR_USERNAME" -DBROWSERSTACK_ACCESS_KEY="YOUR_ACCESS_KEY" -DBROWSERSTACK_PROJECT_REPO="serenity-browserstack"
mvn archetype:generate -B -DarchetypeGroupId="com.browserstack" -DarchetypeArtifactId="browserstack-sdk-archetype-setup" -DarchetypeVersion="1.1" -DgroupId="com.browserstack" -DartifactId="serenity-browserstack" -Dversion="1.0" -DBROWSERSTACK_USERNAME="YOUR_USERNAME" -DBROWSERSTACK_ACCESS_KEY="YOUR_ACCESS_KEY" -DBROWSERSTACK_PROJECT_REPO="serenity-browserstack"
Update the serenity configuration file
Skip this step if you downloaded the sample project using Maven Archetype in step 1.
Add your BrowserStack credentials to the serenity.conf
file to use the Serenity BrowserStack plugin to run the sample build.
If your credentials are not already set as environment variables, manually add them to the serenity.conf
file of your test platform (Android or iOS).
- Navigate to the directory that contains the configuration file:
cd serenity-appium-app-browserstack/android/src/test/resources
- Open the
serenity.conf
file and add your BrowserStack credentials:webdriver { driver = remote remote.url = "https://hub.browserstack.com/wd/hub" remote.driver = "appium" } browserstack.user="YOUR_USERNAME" browserstack.key="YOUR_ACCESS_KEY"
- Navigate to the directory that contains the configuration file:
cd serenity-appium-app-browserstack/ios/src/test/resources
- Open the
serenity.conf
file and add your BrowserStack credentials:webdriver { driver = remote remote.url = "https://hub.browserstack.com/wd/hub" remote.driver = "appium" } browserstack.user="YOUR_USERNAME" browserstack.key="YOUR_ACCESS_KEY"
Go to the platform directory
Based on your test platform, navigate back to the platformβs root directory.
- Navigate back to the
android
directory:cd ../../..
- Ensure you are in the
../serenity-appium-app-browserstack/android
directory:- For macOS/Linux/PowerShell:
pwd
- For Windows Command Prompt:
cd
- For macOS/Linux/PowerShell:
- Navigate back to the
ios
directory:cd ../../..
- Ensure you are in the
../serenity-appium-app-browserstack/ios
directory:- For macOS/Linux/PowerShell:
pwd
- For Windows Command Prompt:
cd
- For macOS/Linux/PowerShell:
Modify the configuration file
The browserstack.yml
file defines the required capabilities to run tests on BrowserStack. It is platform-specific and located in the corresponding platform folder (android/
or ios/
). Make sure you modify the file that corresponds to your testing platform.
- Open the
browserstack.yml
file. - Add your BrowserStack
userName
andaccessKey
. - Set the
framework
toserenity
. - Set the
accessibility
flag totrue
. The default value isfalse
. - Save the file.
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 App Automate since Automated tests will automatically identify different build runs.
View the accessibility test report
After the test completes, access the report in your project folder on the App Accessibility dashboard.
Next steps
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!