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 results are inaccessible to red-green color-blind, blind and CI #2919

Closed
JohnAlbin opened this issue Dec 23, 2021 · 2 comments · Fixed by #3082
Closed

Test results are inaccessible to red-green color-blind, blind and CI #2919

JohnAlbin opened this issue Dec 23, 2021 · 2 comments · Fixed by #3082

Comments

@JohnAlbin
Copy link

JohnAlbin commented Dec 23, 2021

TLDR

I'm using AVA 4.0.0-rc.1 and have a few tests marked as ".failing" since they are known test failures. When looking at the test output, I expect that I can tell which tests are known failures, but known-failing tests look exactly like passing tests in some situations.

Details

AVA's default output doesn't clearly show which of the tests are known failures because it only distinguishes between test successes and test failures using color. When you only use color to distinguish between different things in an interface, you are making those things inaccessible to some people.

Here's some AVA test results on my terminal. You can see that both known failures and successes have the ✔ checkmark prepended and they only differ based on their color:

ava-output-with-color

This is how those same AVA test results appear on GitHub's CI, which is similar to how red-green color-blind would see it. There's no way to tell which tests are known failures:

ava-output-on-ci

We need to re-think how these test results are displayed so they are accessible to everyone, including:

  • developers who are red-green colorblind
  • developers using screen readers
  • developers who don't have a color-enabled terminal
  • developers reading a plain text log file (like in a CI)

Possible solutions

As a reference, here's a screenshot of skipped, failing, passing and known failing tests:
ava-all-test-types

Maybe known failures should be in "skipped" yellow with a ✖ cross instead of the checkmark. Known failures are more like skipped tests than anything else.

Also, right now failing tests only have a red ✖ with normal-colored descriptive text. Can we make the descriptive text of failing tests all in red? And maybe bold too? The bold isn't necessary since failures are printed again at the end of the test result list, but it helps the failures visually stick out from the rest of the list.

As for people who are using screen readers, I think we might need to add text to describe what -, , mean. Especially if we use for known and unknown fails. Maybe this?:

  ✔ PASS: Example › should be an example test
  - SKIP: Example › should be an example test
  ✖ FAIL: Example › should be an example test
  ✖ KNOWN FAIL: Example › should be an example test (or maybe SKIP FAIL or SKIPPED FAIL)

Here's a mockup with color and bold added:
ava-test-result-mockup

@novemberborn
Copy link
Member

Thanks for the feedback @JohnAlbin!

Counter-intuitively known failures count as a success — it's only when they stop failing that there's a problem. It being hard to filter the output because the symbol is reused isn't necessarily a display issue.

I think we may be able to make some tweaks with the current implementation, though to really make strides I think we need to tackle #2500.

@JohnAlbin
Copy link
Author

JohnAlbin commented Dec 31, 2021

Counter-intuitively known failures count as a success

Yep. It's one of the features I love about ava. Being able to document known bugs with tests makes it easer to fix them.

I actually noticed this issue because I have some known test failures in my project's integration tests with a dependency. I wanted to show the dependency project which tests were failing by showing them the GitHub Actions log results, BUT there's no color in the log files so it's impossible for anyone to read the the publicly-accessible log files and tell which tests are failing.

It being hard to filter the output because the symbol is reused isn't necessarily a display issue.

If we "add text to describe what -, , mean", I'm fine with known failing tests still using icon because you can still tell that this red text is a known failure:

✔ KNOWN FAIL: Example › should be an example test (or maybe SKIP FAIL or SKIPPED FAIL)

Personally, I would still prefer the , but I'm fine with the . It's a passing test because it is failing and marked as .failing, so there's definitely ambiguity about what the "right" icon should be. :)

gibson042 added a commit to gibson042/ava that referenced this issue Aug 6, 2022
Color covers figure and label, and indicates passed-as-expected
vs. not (expected/unexpected fail or unexpected pass).

Fixes avajs#2919
novemberborn added a commit to gibson042/ava that referenced this issue Aug 26, 2022
novemberborn added a commit that referenced this issue Sep 4, 2022
* Explain diff gutter symbols. Fixes #1558
* Add test result labels. Color covers figure and label, and indicates passed-as-expected vs. not (expected/unexpected fail or unexpected pass). Fixes #2919
* Bold the source line of errors in code excerpts
* TAP reporter: Strip ANSI control sequences from error labels
* Print assertion error in italics, to better differentiate from the test title.

Co-authored-by: Mark Wubben <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants