Detox icon indicating copy to clipboard operation
Detox copied to clipboard

Add item color assertion

Open d4vidi opened this issue 3 years ago • 5 comments

Describe your idea

We could theoretically add that the getAttributes(), although, I'd like to take a guess that the RN-side prop doesn't necessarily easily map to the native equivalent (as we've seen in the past).

Nevertheless, this is definitely something we could accept as a feature.

d4vidi avatar Apr 05 '22 09:04 d4vidi

@d4vidi Thank you for your quick answer. How about borderColor attribute? Generally in the css styles we can have a lot of attributes for verification.

Skaramus1990 avatar Aug 17 '22 08:08 Skaramus1990

If we do this, we are likely to handle everything color-related. That said, CSS and native-mobile are inherently different. We will extract what we can, and cannot guarantee that borderColor and such are accessible.

d4vidi avatar Aug 17 '22 11:08 d4vidi

@d4vidi Thank you for your answer. In the future (plans) we will extract all attributes of an element which will appear for it. Am I right?

Skaramus1990 avatar Aug 18 '22 06:08 Skaramus1990

I don't have an ETA or anything. This issue has even been marked for contribution...

d4vidi avatar Aug 18 '22 12:08 d4vidi

I see you do validation based on attributes, and that's ok. But if you see the need to do validation as in knowing if the color is a valid HTML color at all, you can use the validate-color npm package, currently the most feature-rich HTML color validator in town. 🎨 😊

dreamyguy avatar Apr 23 '23 11:04 dreamyguy