Retrieve isChecked attribute with getAttributes() method
Is your feature request related to a problem? Please describe. This particular case is Android specific. In my tests I rely on such attributes like 'is-checked' for toggle value, another attributes are used for button state - enabled/disabled which currently ommited in the returning object of getAttributes() method. The only way to retrieve this values is parsing error object like it's being described here
Describe the solution you'd like Yield more attribute-value pairs from the element to extend potential checks.
@sergtimosh please revisit our documentation about getAttributes. I think props such as enabled and value might be what you're looking for.
@d4vidi, unfortunately value is relevant only for the iOS version of the app. In order to achieve the same on Android the only option is is-checked for my case.
Properties from android element:
{ identifier: 'header-results-toggle', visibility: 'visible', visible: true, alpha: 1, elevation: 0, height: 74, width: 128, focused: false, enabled: true, text: '', length: 0, textSize: 39 }
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this reporsitory, read this discussion.
The issue has been closed for inactivity.
Bump, this would be really helpful
@asafkorem could you look what extras could be exposed on iOS side, please?
@asafkorem could you look what extras could be exposed on iOS side, please?
Already did @noomorph, in the corresponding issue for iOS attributes 🙂 https://github.com/wix/Detox/issues/3116#issuecomment-982008651
Legit. Let's try to leave the discussion on extra attributes to #3116. I'll take a glance at the fix-potential for Android for this specifically, in a bit.
So while we do consider the isChecked property of an Android view in getAttributes(), we seem to limit ourselves to CheckBox views. The proper fix here is likely to extend things to any Checkable, which CheckBox implements anyways.
BTW, seems like there are a ton of other classes that do this, so it would be a good idea to also skim through in order to make sure all associated views are also relevant:
So to sum things up, in order to fix this, we need to:
- Extend the
valueproperty to match anyCheckable. We need to do this in an override-able way, meaning, that if a class holds some other meaningful attribute that is more tightly associated with the concept ofvalue(e.g. a checkable text view), it should make usage ofvaluefor it. - Apply more view types (e.g. toggles, such as specified by the OP) in the E2E tests we have for this, at least on Android.