Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve isChecked attribute with getAttributes() method #3165

Open
sergtimosh opened this issue Jan 5, 2022 · 9 comments
Open

Retrieve isChecked attribute with getAttributes() method #3165

sergtimosh opened this issue Jan 5, 2022 · 9 comments

Comments

@sergtimosh
Copy link

sergtimosh commented Jan 5, 2022

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.

image

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 5, 2022

@sergtimosh please revisit our documentation about getAttributes. I think props such as enabled and value might be what you're looking for.

@sergtimosh
Copy link
Author

@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 }

@stale
Copy link

stale bot commented Feb 5, 2022

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.

@stale stale bot added the 🏚 stale label Feb 5, 2022
@stale
Copy link

stale bot commented Feb 12, 2022

The issue has been closed for inactivity.

@stale stale bot closed this as completed Feb 12, 2022
@d4vidi d4vidi reopened this Feb 13, 2022
@stale stale bot removed the 🏚 stale label Feb 13, 2022
@d4vidi d4vidi added this to the Q4/2021 Bugathon milestone Feb 13, 2022
@d4vidi d4vidi removed this from the Q4/2021 Bugathon milestone May 17, 2022
@owens-ben
Copy link

Bump, this would be really helpful

@noomorph
Copy link
Collaborator

@asafkorem could you look what extras could be exposed on iOS side, please?

@asafkorem
Copy link
Contributor

@asafkorem could you look what extras could be exposed on iOS side, please?

Already did @noomorph, in the corresponding issue for iOS attributes 🙂
#3116 (comment)

@asafkorem asafkorem removed their assignment Jan 11, 2023
@d4vidi
Copy link
Collaborator

d4vidi commented Jan 12, 2023

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.

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 12, 2023

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:

image

So to sum things up, in order to fix this, we need to:

  1. Extend the value property to match any Checkable. 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 of value (e.g. a checkable text view), it should make usage of value for it.
  2. 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.

@d4vidi d4vidi changed the title Retrieve all attributes with getAttributes() method Retrieve isChecked attribute with getAttributes() method Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants