Start and stop App Accessibility scans
Start and stop automated app accessibility scans in your test cases for precise control over what gets scanned.
You can run targeted accessibility checks on specific screens, workflows, or components in your mobile app. This helps you focus testing on the areas that matter most to your users.
Start and stop feature is currently available only for wdio-mocha
and wdio-cucumber
frameworks.
Why control accessibility scans?
Developers and SDETs often need to focus accessibility testing on specific parts of a workflow. By controlling when scans start and stop, you can:
- Limit scans to relevant sections of your test cases.
- Avoid reporting issues outside your team’s scope.
- Optimize test execution and reporting.
Run targeted scans in your automated tests
App Accessibility Testing runs all scans by default. You can configure your existing functional test automation suite to enable or disable these automatic scans and control when scans start and stop inside your test cases using APIs. You can also use APIs to perform scans at specific points in your test cases.
This page covers the following topics:
- Scan specific sections or points in your test case
- Exclude specific test cases from automated tests
- API reference
Scan specific sections or points in your test case
You can configure your test suites to disable automatic scans and run them only on specific sections or points in your test cases.
In this scenario:
- Automatic scans are completely disabled.
- You can run scans on specific sections of your test case using the
startA11yScanning()
andstopA11yScanning()
APIs. - You can also use the
performScan()
API to run scans at specific points in the test case.
Build configuration
In your functional test automation suite, use the following configuration:
Exclude specific test cases from automated tests
You can configure your test suites to run targeted scans by excluding specific test cases from automatic scans. You can also use APIs to control scans at runtime and run scans on specific sections or points in your test cases.
In this scenario:
- Automatic scans are enabled.
- You can exclude specific test cases from the automatic scans using the
excludeTagsInTestingScope
configuration. - You can use the
startA11yScanning()
andstopA11yScanning()
APIs to run scans manually. These scans include the test cases excluded usingexcludeTagsInTestingScope
. - You can also use the
performScan()
API to run scans at specific points in the test case, regardless of the scanning state.
Build configuration
In your functional test automation suite, use the following configuration:
API reference
Use these APIs to control scans at runtime:
-
startA11yScanning()
- Enable automatic scans from a specific point in your test case.
- Subsequent eligible commands in your test case trigger scans until you call
stopA11yScanning()
. - You can call this API multiple times in a single test case as needed.
-
stopA11yScanning()
- Disable automatic scans from a specific point in your test case.
- Subsequent commands in your test case do not trigger scans until you call
startA11yScanning()
again. - You can call this API multiple times in a single test case as needed.
-
performScan()
- Immediately scan a specific point in the test case.
- Performs the scan regardless of whether automatic scans are enabled or disabled.
- This is useful when you want to run a scan on a specific screen or component in your app.
References
- Define test scope in App Accessibility Automated Tests
- Configuration options for App Accessibility Automated Tests
- Getting started with App Accessibility Automated Tests
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!