Skip to main content
No Result Found

Run accessibility checks on a Serenity sample repo

Prerequisites

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.
    Replace YOUR_USERNAME and YOUR_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.

  1. Navigate to the resources directory of your preferred platform:
     cd android/src/test/resources
    
  2. 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"
    
  1. Navigate to the resources directory of your preferred platform:
     cd ios/src/test/resources
    
  2. 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"
    

Go to the root directory

Based on your test platform, navigate back to the platform directory.

Copy icon Copy
Copy icon Copy

Ensure you are in the correct directory:

  • Android: serenity-appium-app-browserstack/android
  • iOS: serenity-appium-app-browserstack/ios

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.

  1. Open the browserstack.yml file.
  2. Add your BrowserStack username and access key.
  3. Set the framework to serenity, if it isn’t already.
  4. Set the accessibility flag to true.

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.

browserstack.yml
Copy icon Copy

Run the sample test

From your platform folder (Android or iOS), run the following command:

Run an Android test
Copy icon Copy
Run an iOS test
Copy icon Copy

View the accessibility test report

After the test completes, access the report in your project folder on the App Accessibility dashboard.


Visit 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





Thank you for your valuable feedback

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle