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

🚀 Feature: Highlight browser failures in red #792

Open
tj opened this issue Apr 3, 2013 · 22 comments · May be fixed by #5222
Open

🚀 Feature: Highlight browser failures in red #792

tj opened this issue Apr 3, 2013 · 22 comments · May be fixed by #5222
Labels
area: browser browser-specific area: reporters involving a specific reporter good first issue new contributors should look here! status: accepting prs Mocha can use your help with this one!

Comments

@tj
Copy link
Contributor

tj commented Apr 3, 2013

to make it more obvious without wasting eye-movement effort to look at the count haha. I prefer github.com/visionmedia/mocha-matrix for this reason but it's not a good fit as a default

@danielstjules
Copy link
Contributor

I agree that'd be helpful :) So far, failures aren't generally obvious unless they're early in the suite:

screen shot 2015-03-08 at 9 53 52 pm

I'll a submit a PR that adds a horizontal bar in the header. It could be light grey while running, green if it passed, and red if it failed.

@ScottFreeCode ScottFreeCode added the area: reporters involving a specific reporter label Sep 22, 2017
@boneskull boneskull added the status: accepting prs Mocha can use your help with this one! label Oct 17, 2017
@boneskull boneskull added good first issue new contributors should look here! area: browser browser-specific and removed area: browser browser-specific labels Jan 4, 2019
@mayankshah1607
Copy link

Hi. I am new here and would like to contribute.
From what I understand, when a test suite fails, messages must be displayed in red and if success, messages must be displayed in green. From what I know, I think mocha already does this. I would like to know what must be done exactly, and would like a deeper insight to this issue.

Thank you! :)

@dhuang612
Copy link

Hi,

is this available to work on?

@outsideris
Copy link
Contributor

Sure

@dhuang612
Copy link

created pr #4082

@dhuang612
Copy link

updated pr with new code and included screenshots.

Please let me know if anything else needs to be changed

@dhuang612
Copy link

I see a ref to the new pr but just wanted to make sure you guys were aware.

created a new pr for this issue:
#4148

@pedro-qwkin
Copy link

Why isn't this merged?

@dhuang612
Copy link

@outsideris Hi can I get an update on my PR?
#4148

@outsideris
Copy link
Contributor

@dhuang612 We missed it. I will check your PR.

@fzn0x
Copy link

fzn0x commented Sep 9, 2022

Hi @outsideris is it available to work on? I don't see any progress from the latest PR above

@JoshuaKGoldberg JoshuaKGoldberg changed the title highlight something in red on failures 🚀 Feature: Highlight browser failures in red Dec 27, 2023
@mark-wiemer
Copy link
Contributor

#4148 looks like it can be resurrected, I'll see what I can do tomorrow :)

@mark-wiemer
Copy link
Contributor

FYI #5218 is ready for review :)

@JoshuaKGoldberg
Copy link
Member

Thanks @mark-wiemer! Coming over from #5218 (comment): my personal take is that the best implementation for this issue would be one that doesn't change page layout. From that comment: the taller the summary section, the less fits on the page in smaller viewports. A lot of people are accustomed to the placement as-is.

The border treatment you have in #5218 could get the job done, but colored borders tend to necessitate margin & padding to look good. Which means it might be hard to get that to look good without changing layout.

Proposal: how about modifying the color on failure for text & progress circle stroke? Say, darkred in light mode & #ffcccb in dark mode?

Fail
Dark Dark mode screenshot of the Mocha summary, with light red text for failures and progress
Light Light mode screenshot of the Mocha summary, with dark red text for failures and progress

From an accessibility perspective, the summary already indicates the pass/fail status with failures: ..., so the UI wouldn't be relying solely on color to convey information.

@mark-wiemer
Copy link
Contributor

Text color changes sound fine by me! I'll see what I can do :)

@mark-wiemer
Copy link
Contributor

How do you feel about adding the X to indicate a failure as well? I thought that was a nice super clear item that stands out even in black and white, and it doesn't make the view any taller!

@JoshuaKGoldberg
Copy link
Member

I like that idea 🙂. Thinking: there's already a green ✔ or red X put on individual tests once their status is known. So this would be putting the same treatment on the summary?

  1. As soon as a failure happens, the red X
  2. If all tests are done and there was no failure, the green ✔

Is that what you're thinking? 👍 from me on that if so.

@mark-wiemer
Copy link
Contributor

I think that would be best, yes. I'd add a green check even if some tests were skipped. Basically once all tests complete, green check unless any test failed. If any failures, red X :)

@mark-wiemer mark-wiemer linked a pull request Oct 10, 2024 that will close this issue
3 tasks
@mark-wiemer
Copy link
Contributor

Hey @JoshuaKGoldberg I'm not sure about coloring the progress circle and its inner text as red or green. To me that could be read as "all tests failed" or "100%" of tests failed, where someone may expect a "99%/1%" text to indicate 1% failed. Additionally, highlighting the whole circle red might be read as "all tests failed" when that's not really what it means.

For now, I think the green text of passes and failures, plus the new result indicator, is sufficient:

Image

Image

@mark-wiemer
Copy link
Contributor

#5222 is ready for review :)

@JoshuaKGoldberg
Copy link
Member

I'm not sure about coloring the progress circle and its inner text as red or green ...

Oh, good point. Agreement from me on not changing it for now then 🙂.

For now, I think the green text of passes and failures, plus the new result indicator, is sufficient:

Looks great!

What do you think about also coloring the numbers, like failures: 1 instead of just failures? I found it odd at first to read just the label in the new color.

@mark-wiemer
Copy link
Contributor

coloring the numbers as well works for me, let me update it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific area: reporters involving a specific reporter good first issue new contributors should look here! status: accepting prs Mocha can use your help with this one!
Projects
None yet