Skip to content

Commit ce796ea

Browse files
accessibility testing
1 parent 5ebc3e1 commit ce796ea

14 files changed

+172
-130
lines changed
100 KB
Loading
101 KB
Loading
100 KB
Loading
98.7 KB
Loading
Binary file not shown.
97.9 KB
Loading
Binary file not shown.
Binary file not shown.

docs/accessibility-android-automation-test.md

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -42,114 +42,3 @@ import TabItem from '@theme/TabItem';
4242
})
4343
}}
4444
></script>
45-
46-
This guide walks you through automating accessibility testing of a native Android app using **LambdaTest's Accessibility Automation Tool (Beta) via Appium**. You'll run an automated accessibility scan on a real Android device hosted on LambdaTest’s real device cloud infrastructure.
47-
48-
## Prerequisites
49-
50-
- Your [LambdaTest Username and Access key](/support/docs/using-environment-variables-for-authentication-credentials/)
51-
- Python 3.x or Java JDK 8+ installed
52-
- Appium Python Client or Java Client Library
53-
54-
## Step-by-Step Guide to Trigger Your Test
55-
56-
### Step 1: Setup Your Test Suite
57-
58-
You can use your own project to configure and test it. For demo purposes, we are using the sample repository.
59-
60-
:::tip sample repo
61-
Download or Clone the code sample from the LambdaTest GitHub repository to run your tests.
62-
63-
<a href="https://github.com/LambdaTest/lambdatest-accessibility-selenium" className="github__anchor"><img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> View on GitHub</a>
64-
:::
65-
66-
If you are using your own project, make sure you update the **Hub endpoint** in your tests file. By setting up the Hub endpoint, you establish the communication channel between your tests and the browser nodes, enabling effective test distribution and execution.
67-
68-
Configure the desired capabilities based on your test requirements. For example:
69-
70-
<Tabs className="docs__val">
71-
72-
<TabItem value="python" label="Python" default>
73-
74-
<div className="lambdatest__codeblock">
75-
76-
```python
77-
desired_cap = {
78-
"platform": "android",
79-
"isRealMobile": True,
80-
"app": "lt://APP", # Replace with your LambdaTest App URL
81-
"accessibility": True,
82-
"buildName": "Accessibility-lambda",
83-
"idleTimeout": 1800,
84-
"build": "NewAppiumBuild",
85-
"name": "MyTest",
86-
"devicelog": True
87-
}
88-
```
89-
90-
</div>
91-
92-
</TabItem>
93-
94-
<TabItem value="java" label="Java" default>
95-
96-
<div className="lambdatest__codeblock">
97-
```java
98-
DesiredCapabilities caps = new DesiredCapabilities();
99-
caps.setCapability("platform", "android");
100-
caps.setCapability("isRealMobile", true);
101-
caps.setCapability("app", "lt://APPID"); // Replace with your App ID
102-
caps.setCapability("accessibility", true);
103-
caps.setCapability("idleTimeout", 1800);
104-
caps.setCapability("build", "AccessibilityScanBuild");
105-
caps.setCapability("name", "MyTest");
106-
caps.setCapability("devicelog", true);
107-
```
108-
</div>
109-
110-
</TabItem>
111-
</Tabs>
112-
113-
114-
> You can generate capabilities for your test requirements with the help of our inbuilt 🔗 [Capabilities Generator Tool](https://www.lambdatest.com/capabilities-generator/).
115-
116-
### Step 2: Establish User Authentication
117-
118-
Now, you need to export your environment variables *LT_USERNAME* and *LT_ACCESS_KEY* that are available in the [LambdaTest Profile page](https://accounts.lambdatest.com/detail/profile).
119-
120-
Run the below mentioned commands in your terminal to setup the CLI and the environment variables.
121-
122-
<Tabs className="docs__val">
123-
124-
<TabItem value="bash" label="Linux / MacOS" default>
125-
126-
<div className="lambdatest__codeblock">
127-
<CodeBlock className="language-bash">
128-
{`export LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
129-
export LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
130-
</CodeBlock>
131-
</div>
132-
133-
</TabItem>
134-
135-
<TabItem value="powershell" label="Windows" default>
136-
137-
<div className="lambdatest__codeblock">
138-
<CodeBlock className="language-powershell">
139-
{`set LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
140-
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
141-
</CodeBlock>
142-
</div>
143-
144-
</TabItem>
145-
</Tabs>
146-
147-
### Step 3: Execute and Monitor your Test
148-
149-
Now execute your tests and visit the [Automation Dashboard](https://accounts.lambdatest.com/dashboard). Click on the Accessibility tab and check the report generated.
150-
151-
```bash
152-
mvn test
153-
```
154-
155-
<img loading="lazy" src={require('../assets/images/accessibility-testing/accessibility-automation.png').default} alt="automation-dashboard" className="doc_img"/>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
id: accessibility-android-rules
3+
title: Android Accessibility Rules - Quick Reference
4+
sidebar_label: Android
5+
description: Use LambdaTest Accessibility DevTools to detect and report accessibility issues with automation, following WCAG guidelines.
6+
keywords:
7+
- LambdaTest
8+
- Accessibility
9+
- Testing
10+
- Manual
11+
- Accessibility Testing Settings
12+
url: https://www.lambdatest.com/support/docs/accessibility-android-rules/
13+
site_name: LambdaTest
14+
slug: accessibility-android-rules/
15+
---
16+
17+
import CodeBlock from '@theme/CodeBlock';
18+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
19+
import Tabs from '@theme/Tabs';
20+
import TabItem from '@theme/TabItem';
21+
22+
<script type="application/ld+json"
23+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
24+
"@context": "https://schema.org",
25+
"@type": "BreadcrumbList",
26+
"itemListElement": [{
27+
"@type": "ListItem",
28+
"position": 1,
29+
"name": "Home",
30+
"item": "https://www.lambdatest.com"
31+
},{
32+
"@type": "ListItem",
33+
"position": 2,
34+
"name": "Support",
35+
"item": "https://www.lambdatest.com/support/docs/"
36+
},{
37+
"@type": "ListItem",
38+
"position": 3,
39+
"name": "Accessibility Android Rules",
40+
"item": "https://www.lambdatest.com/support/docs/accessibility-android-rules/"
41+
}]
42+
})
43+
}}
44+
></script>
45+
46+
| Rule Name | WCAG | Level | Impact | Description |
47+
|-----------|------|-------|--------|-------------|
48+
| Missing Image Alt | 1.1.1 | A | Critical | Images lack alternative text descriptions that screen readers can announce to users. Add `android:contentDescription` to meaningful images or set to empty string for decorative images to ensure proper accessibility support. |
49+
| Missing View Accessibility | 4.1.2 | A | Serious | Interactive elements like buttons, clickable views, or custom controls lack proper accessibility labels that describe their purpose. Ensure all interactive Views have clear `android:contentDescription` or associated labels for screen readers. |
50+
| Unlabeled Checkbox Element | 4.1.2 | A | Serious | Checkbox controls are missing accessible names that describe their purpose or current state. Provide descriptive labels using `android:text`, `android:contentDescription`, or associated TextView labels so users understand what they're selecting. |
51+
| Insufficient Color Ratio | 1.4.3 | AA | Serious | Text elements don't meet minimum contrast ratio requirements making them difficult to read for users with visual impairments. Maintain 4.5:1 ratio for normal text and 3:1 for large text by adjusting colors or background. |
52+
| Missing Field Label | 3.3.2 | A | Serious | Input fields like EditText lack descriptive labels that identify their purpose to users. Provide clear labels using `android:hint`, associated TextView with `android:labelFor`, or TextInputLayout to describe expected input. |
53+
| Non-accessible Interaction | 4.1.2 | A | Serious | Custom interactive elements, buttons, or gesture-based controls cannot be accessed or activated through assistive technology. Ensure all interactive elements have proper focus handling, role definition, and descriptive labels. |
54+
| Missing Screen Title | 2.4.2 | A | Serious | Activities or screens lack descriptive titles that help users understand their current location in the app. Set meaningful titles using `setTitle()` or `supportActionBar?.title` for proper navigation context. |
55+
| Unlabeled Toggle Control | 4.1.2 | A | Serious | Switch, toggle, or similar controls are missing accessible names that explain what they control and their current state. Provide descriptive labels that clearly indicate what the toggle affects (e.g., "Wi-Fi enabled"). |
56+
| Mismatched Label Text | 2.5.3 | A | Serious | The visible text label on a control differs from the programmatically accessible name, causing confusion for screen reader users. Ensure the accessible name includes or matches the visible text exactly. |
57+
| Missing Input Value | 4.1.2 | A | Moderate | Text fields are missing programmatic values that assistive technology can read, making it difficult for users to understand current input state. Ensure EditText values are properly exposed and announced by screen readers. |
58+
| Inaccessible Text Focus | 4.1.2 | A | Moderate | Text elements that receive focus lack proper accessibility properties, confusing screen reader users about their purpose. Either provide clear interactive roles and descriptions or remove focus capability for non-interactive text. |
59+
| Misplaced Field Label | 3.3.2 | A | Moderate | Form labels are not positioned correctly relative to their controls or lack proper programmatic association. Ensure labels appear visually before controls and use `android:labelFor` for proper screen reader announcement order. |
60+
| Nested Control Issues | 4.1.2 | A | Moderate | Interactive elements are incorrectly nested inside other interactive elements, creating focus traps and navigation confusion. Separate interactive elements into distinct, non-nested components to ensure proper accessibility navigation. |
61+
| Unnamed Nested Element | 4.1.2 | A | Moderate | Elements within containers lack their own accessible names when they should be independently accessible. Provide distinct labels for nested interactive elements or mark decorative elements as non-focusable. |
62+
| Fixed Orientation Lock | 1.3.4 | AA | Moderate | App restricts viewing to only portrait or landscape orientation without accessibility justification. Support both orientations or provide alternative access methods for users who cannot rotate their devices due to physical constraints. |
63+
| Undersized Touch Target | 2.5.5 | AAA | Moderate | Interactive elements are smaller than the recommended minimum touch target size, making them difficult to activate for users with motor impairments. Ensure all touch targets are at least 48dp x 48dp. |
64+
| Insufficient Target Spacing | 2.5.5 | AAA | Moderate | Interactive elements are placed too close together without adequate spacing, increasing risk of accidental activation. Provide sufficient spacing between adjacent touch targets to prevent targeting errors for users with limited dexterity. |

0 commit comments

Comments
 (0)