-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Assert computed colors using hex notation #227
Comments
Hi, I would like to work on it. |
Thanks! Close, but not quite. browse-UI-test presumably calls We'd like tests to be able to assert using either the rgba form or the hex form. If a test says, for instance, |
It'd be super nice to have comparison between any kind of color representation (rgb, rgba and hex to start). @MizuhoOkimoto Don't hesitate to give it a try but it's not an easy thing to do, colors can be in different places depending on the CSS property ( |
Note for myself: this NPM package seems to allow to convert between colors formats: first we need to convert user input to RGBA and then, convert back in case of failure into the original format (which is a bit more tricky apparently). An alternative could this package. In any case, it'll require writing a small parser for CSS property to extract the colors (should be pretty straightforward). To make this whole easier, the best would be to return the CSS values outside of the browser so we don't have to inject this JS into each webpage. |
Right now, as far as I can tell, colors have to be asserted like this:
But if the corresponding CSS specified those colors with hex codes, it's hard to see whether this is correct or not. It should be possible to assert:
The text was updated successfully, but these errors were encountered: