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

Test: Improve the 'DOM element should have a CSS filter close enough to hex color' filter #793

Open
abias opened this issue Jan 2, 2025 · 0 comments
Labels
test Something which targets automated tests (Behat, PHPUnit)

Comments

@abias
Copy link
Member

abias commented Jan 2, 2025

Every now and then a Behat run fails with an error like this:

001 Example: | communication      | choice  | #0000FF  | invert(0.48) sepia(0.74) saturate(48.87) hue-rotate(11deg) brightness(1.02) contrast(1.01)  | # /home/runner/work/moodle-theme_boost_union/moodle-theme_boost_union/moodle/theme/boost_union/tests/behat/theme_boost_union_looksettings_activitybranding.feature:34
      And DOM element ".chooser-container .activityiconcontainer.modicon_choice img" should have a CSS filter close enough to hex color "#0000FF"      # /home/runner/work/moodle-theme_boost_union/moodle-theme_boost_union/moodle/theme/boost_union/tests/behat/theme_boost_union_looksettings_activitybranding.feature:26
        The '.chooser-container .activityiconcontainer.modicon_choice img' DOM element with the CSS filter 'invert(0.11) sepia(0.94) saturate(53.67) hue-rotate(243deg) brightness(0.89) contrast(1.54)', is not close enough to the color '#0000FF'.

This step is used to check if the CSS filters which are applied to tint the activity icon colors are fine or not.
Re-running the scenario mostly always fixes the problem - or it occurs again with another filter given.

However, if you look at the generated CSS filter, the color is indeed close enough:
grafik

So I expect that the Behat failure is a mathematical problem, not an optical problem with the colors.

@abias abias added the test Something which targets automated tests (Behat, PHPUnit) label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Something which targets automated tests (Behat, PHPUnit)
Projects
Status: No status
Development

No branches or pull requests

1 participant