Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Integrate Maestro test suite with App Accessibility testing

Learn how to add accessibility checks to your existing functional tests and generate comprehensive reports of accessibility issues.

BrowserStack App Accessibility supports Maestro testing on a wide range of real Android and iOS devices. You can integrate your existing functional test suites with App Accessibility testing to run accessibility checks on your mobile apps. You can access the generated accessibility violation reports on the App Accessibility dashboard.

Automated App Accessibility testing with Maestro is supported on the following platform versions:

  • Android version 11 and later.
  • iOS version 15 and later.

Prerequisites

  • Ensure you have a BrowserStack Username and Access Key. Obtain your userName and accessKey from the Account & Profile section on the dashboard. If you have not yet created an account, sign up for a free trial.
  • Maestro version 1.39.13.
  • Your android app (.apk file) or iOS app (.ipa file) to be tested.
  • Your Maestro test suite (.zip file) containing your Flow files structured as per the Structure your Maestro accessibility tests guide.

Run Maestro accessibility tests on BrowserStack

Upload your app

Upload the sample app to the BrowserStack servers using a REST API request.

The following sample cURL command demonstrates how to upload an app:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/app" \
-F "file=@/path/to/app/file/debug.apk" \
-F "custom_id=SampleApp"

A sample response for the request is shown below:

{
    "app_name": "debug.apk",
    "app_url": "bs://c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "app_version": "1.2.0",
    "app_id": "c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "uploaded_at": "2020-05-05 14:52:54 UTC",
    "custom_id": "SampleApp",
    "shareable_id": "steve/SampleApp",
    "expiry" : "2020-06-05 14:52:54 UTC"
}

Note the app_url key to identify your uploaded app when you run Maestro tests.

Upload your test suite

Upload your Maestro test suite (.zip) file to BrowserStack servers using the following REST API request:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/test-suite" \
-F "file=@/path/to/app/file/Flows.zip" \
-F "custom_id=SampleTest"

A sample response for the request is shown below:

{
    "test_suite_name": "Flows.zip",
    "test_suite_url": "bs://89c874f21852ba57957a3fdc33f47514288c4ba1",
    "test_suite_id": "89c874f21852ba57957a3fdc33f47514288c4ba1",
    "uploaded_at": "2020-09-09 15:35:00 UTC",
    "custom_id": "SampleTest",
    "shareable_id": "Steve/SampleTest",
    "framework": "maestro",
    "expiry": "2020-10-09 15:35:00 UTC"
}

Note the test_suite_url key to identify your uploaded test suite when you run Maestro tests.

Run your Maestro tests

In a cURL command, include the following parameters and send the API request to run the test.

  • app: specify the app_url, which is the unique identifier of the application that you want to test. The app_url is generated when you upload the app to BrowserStack, see Upload your app.
  • testSuite: specify the test_suite_url, which is the unique identifier of the test suite you want to run. The test_suite_url is generated when you upload your test suite to BrowserStack, see Upload your test suite.
  • devices: specify a list of Android or iOS devices on which you want to test your app.
  • testObservability: enable test observability.
  • accessibility: enable accessibility checks.
  • accessibilityOptions: configure the accessibilityOptions parameter to set various accessibility testing options. For a list of available accessibility options that you can use to configure your tests, see Configuration options.

To auto-generate screen reader testing reports for your app’s workflow, set the screenReaderAutomationReport flag to true under accessibilityOptions.

  • In the API request, app, testSuite, and devices are mandatory parameters to start the test execution.
  • The testObservability and accessibility parameters are mandatory to run automated App Accessibility tests.
  • For a complete list of parameters that you can use in your Maestro test execution, see Maestro Build API reference.
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/android/build" \
-H "Content-Type: application/json" \
-d "{
    \"app\": \"$app_url\",
    \"testSuite\": \"$test_suite_url\",
    \"project\": \"$PROJECT_NAME\",
    \"devices\": [\"Samsung Galaxy S24-14.0\", \"Google Pixel 8-14.0\", \"Samsung Galaxy S21-11.0\"],
    \"testObservability\": true,
    \"accessibility\": true,
    \"accessibilityOptions\": {
        \"wcagVersion\": \"wcag21aa\",
        \"includeIssueType\": {
            \"bestPractice\": true,
            \"needsReview\": false
        },
        \"includeTagsInTestingScope\": [\"TAG_1\"],
        \"excludeTagsInTestingScope\": [\"TAG_2\"]
    }
  }"

Response

A sample response for the request is shown below:

{
    "message": "Success",
    "build_id": "5c5ab4338cec13aeb78f7a6977344556ac00bccd6"
}

The build_id uniquely identifies your build in App Automate. Each test build is an execution of your Maestro test suite on all selected devices.

View test results

After you run the test using the REST API, visit the App Automate dashboard to view your test results, debugging logs, and overall test details.


Visit App Accessibility dashboard

You can also use API requests to view the test results.

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