Run accessibility checks on a Serenity sample repo
Prerequisites
- Ensure you have a BrowserStack Username and Access Key. Obtain your
username
andaccess key
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
Run a sample Serenity test build using your preferred method on BrowserStack:
Get the sample project
Get the BrowserStack sample Serenity project using one of the following options:
-
Option 1:
Directly download the sample Serenity repository to your system. -
Option 2:
Clone the sample Git repository using the following commands:git clone https://github.com/browserstack/serenity-appium-app-browserstack.git cd serenity-appium-app-browserstack
-
Option 3:
Set up a new sample project using the Maven archetype. The following commands create a sample project with your BrowserStack credentials pre-configured.
ReplaceYOUR_USERNAME
andYOUR_ACCESS_KEY
with your actual BrowserStack credentials and run one of the following commands based on your operating system and preference:
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
cd 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"; cd 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" && cd serenity-browserstack
Update the serenity configuration file
The BrowserStack sample project uses the Serenity BrowserStack plugin. To use this plugin, you must add your BrowserStack credentials to the serenity.conf
file.
If the credentials are not already set via environment variables, you can manually add them to the serenity.conf
file. This file is located in the src/test/resources
directory of your test platform (Android or iOS).
Skip this step if you downloaded the sample project using Maven Archetype in step 1.
- Navigate to the
resources
directory of your preferred platform:cd android/src/test/resources
- Add your BrowserStack credentials to the
serenity.conf
file: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
resources
directory of your preferred platform:cd ios/src/test/resources
- Add your BrowserStack credentials to the
serenity.conf
file:webdriver { driver = remote remote.url = "https://hub.browserstack.com/wd/hub" remote.driver = "appium" } browserstack.user="YOUR_USERNAME" browserstack.key="YOUR_ACCESS_KEY"
Modify the BrowserStack configuration file
The browserstack.yml
file defines the capabilities needed to run your tests on BrowserStack. It is located in your project’s root directory and is included in the downloaded sample.
- Open the
browserstack.yml
file. - Add your BrowserStack
username
andaccess key
. - Set the
framework
toserenity
, if it isn’t already. - Set the
accessibility
flag totrue
.
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.
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!