[TIMOB-26973] iOS: Add accessibilityIdentifier
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-05-22T23:11:08.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.1.0 |
| Components | iOS |
| Labels | accessibility, ios, testing |
| Reporter | Sergey Volkov |
| Assignee | Vijay Singh |
| Created | 2019-04-02T12:39:46.000+0000 |
| Updated | 2019-07-24T02:27:42.000+0000 |
Description
In UI testing one way of selecting element is by "Accessibility ID", e.g. in Appium:
http://appium.io/docs/en/commands/element/find-elements/index.html#selector-strategies
{quote}
*Strategy*
Accessibility ID
*Description*
Read a unique identifier for a UI element. For XCUITest it is the element's _+accessibility-id+_ attribute. For Android it is the element's _+content-desc+_ attribute.
{quote}
In Titanium SDK "content description" for Android views [composed from three other properties](https://github.com/appcelerator/titanium_mobile/blob/8_0_X/android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java#L2177):
* accessibilityLabel
* accessibilityValue
* accessibilityHint
On iOS property ["accessibilityIdentifier"](https://developer.apple.com/documentation/uikit/uiaccessibilityidentification/1623132-accessibilityidentifier?language=objc) is not used by Ti SDK.
I suggest to compose "accessibilityIdentifier" value on iOS same way it is done on Android for "content description".
Attachments
| File | Date | Size |
|---|---|---|
| 0001-feat-ios-compose-accessibility-identifier.patch | 2019-04-02T12:37:57.000+0000 | 4759 |
Add related to testing issues.
https://github.com/appcelerator/titanium_mobile/pull/10864
FR Passed. waiting on Jenkins to merge
PR merged.
Verified the fix on sdk 8.1.0.v20190522031408.Works as expected.
Test Environment: Name = Mac OS X Version = 10.13.6 Architecture = 64bit Node.js Node.js Version = 8.9.1 npm Version = 5.5.1 Titanium CLI CLI Version = 5.1.1 Titanium SDK SDK Version = 8.1.0.v20190522031408 Cli =7.0.11 Device =iPhone 6s iOS 12Any chance of getting this back-ported to 7.5.X? We haven't moved all our apps to 8.X yet and we are implementing Appium which works flawlessly with accessibility ids instead of XPath which is very prone to errors...