Skip to content

feat(ui-mode): enhance status-line to show passed, failed, and skipped test counts #35859

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pengooseDev
Copy link
Contributor

@pengooseDev pengooseDev commented May 6, 2025

Closes #34444 (assignee @agg23)

  • Show passed, failed, and skipped test counts on status line
  • Update regression tests

Implemented prior discussion and feedback

Looking forward to the team’s feedback. Thank you :)

Running Stopped
image image

@pengooseDev pengooseDev changed the title Feat skipped test report feat(ui-mode): enhance status-line to show passed, failed, and skipped test counts May 6, 2025

This comment has been minimized.

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch 3 times, most recently from 7235701 to 8cf6a70 Compare May 6, 2025 13:18

This comment has been minimized.

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 8cf6a70 to 3b6faae Compare May 6, 2025 13:29

This comment has been minimized.

This comment has been minimized.

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 3b6faae to 986991e Compare May 10, 2025 06:40

This comment has been minimized.

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 986991e to 62478dd Compare May 12, 2025 06:17
@Skn0tt Skn0tt requested a review from agg23 May 12, 2025 06:58

This comment has been minimized.

Copy link
Contributor

@agg23 agg23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. Some general comments:

  • If you press the run button on a group of tests, the loading spinner will immediately appear on the left, but the current completed test count will still show the old value for a moment.
  • The baseline on the stats is incorrect relative to the icons. This is probably an existing issue, but it becomes more obvious with this change.
Screenshot 2025-05-12 at 10 45 07 AM * The start alignment of the stats text is misaligned with the rest of the header Screenshot 2025-05-12 at 10 48 51 AM * I would add `text-overflow: ellipsis` to the entire stats line to indicate there is additional content offscreen Screenshot 2025-05-12 at 10 50 00 AM

I think this is good improvement and appreciate you looking into this.

@@ -461,11 +462,18 @@ export const UIModeView: React.FC<{}> = ({
runTests={() => runTests('bounce-if-busy', visibleTestIds)} />
<Toolbar noMinHeight={true}>
{!isRunningTest && !progress && <div className='section-title'>Tests</div>}
{!isRunningTest && progress && <div data-testid='status-line' className='status-line'>
<div>{progress.passed}/{progress.total} passed ({(progress.passed / progress.total) * 100 | 0}%)</div>
{!isRunningTest && progress && <div data-testid='status-line' className='status-line' title={`${progress.passed} passed, ${progress.failed} failed, ${progress.skipped} skipped`}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably set cursor: pointer on this whole block, as selecting individual numbers in between the icons is never going to be good experience.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

.status-line {
  cursor: pointer;
}

.status-line > span:not(:first-child) {
  user-select: none;
}

.status-line provides a title for the overall test status on hover.
To prevent text selection, user-select: none; has been added to the individual test status elements.
Please let me know if this should be removed.

Image

hover title
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I have no idea why I said cursor: pointer. I meant cursor: default.

{!isRunningTest && progress && <div data-testid='status-line' className='status-line'>
<div>{progress.passed}/{progress.total} passed ({(progress.passed / progress.total) * 100 | 0}%)</div>
{!isRunningTest && progress && <div data-testid='status-line' className='status-line' title={`${progress.passed} passed, ${progress.failed} failed, ${progress.skipped} skipped`}>
<span data-testid='test-count'>{progress.passed + progress.failed + progress.skipped}/{progress.total}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want this section to bounce in-between running and steady states. Classically we would display a green checkmark here, but I don't think that fits very well.

In absence of a better icon I propose codicon-circle-outline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<i className={clsx('codicon', isRunning ? testStatusIcon('running') : testStatusIcon('none'))} />

The changes have been applied. Thanks for the helpful review :)

@@ -461,11 +462,18 @@ export const UIModeView: React.FC<{}> = ({
runTests={() => runTests('bounce-if-busy', visibleTestIds)} />
<Toolbar noMinHeight={true}>
{!isRunningTest && !progress && <div className='section-title'>Tests</div>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only gets displayed before you run any tests or on reload. Get rid of it and show an empty set of stats, with 0/n on the left (where n is your total active test count).

Copy link
Contributor Author

@pengooseDev pengooseDev May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied, thank you :)

Image

Default display
image

@pengooseDev pengooseDev marked this pull request as draft May 12, 2025 22:13
@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 62478dd to 0b66a3e Compare May 12, 2025 23:33

This comment has been minimized.

This comment has been minimized.

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from aa8df54 to 3fe70d5 Compare May 13, 2025 16:13

This comment has been minimized.

This comment has been minimized.

@pengooseDev
Copy link
Contributor Author

1.

If you press the run button on a group of tests, the loading spinner will immediately appear on the left, but the current completed test count will still show the old value for a moment.

It seems that the current TestTree calculation logic is blocking the render phase and delaying the StatusLine update.
I’ve tried separating the TestTree calculation from rendering and experimented with a few approaches, but the UX still falls short. I’d suggest splitting this into a separate issue to decouple UI rendering from the logic rather than including it in this PR. I would appreciate your thoughts. :)

2.

The baseline on the stats is incorrect relative to the icons. This is probably an existing issue, but it becomes more obvious with this change.

If you still see any issues, I’d appreciate your feedback.

Preview
image

3.

The start alignment of the stats text is misaligned with the rest of the header

I checked the input and related CSS in FiltersView and confirmed that the alignment uses margin-left: 5px;. it has been adjusted accordingly.

Preview
image

4.

I would add text-overflow: ellipsis to the entire stats line to indicate there is additional content offscreen

Ellipsis is applied at the chunk level for each icon and text.

Preview
image

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 8aa5f2b to 088476a Compare May 14, 2025 08:08
@pengooseDev pengooseDev marked this pull request as ready for review May 14, 2025 08:09
@pengooseDev pengooseDev requested a review from agg23 May 14, 2025 08:09

This comment has been minimized.

Copy link
Contributor

@agg23 agg23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the thorough responses and images. Alignment looks good except for the ellipsis issue.

I agree that the blocked render fix should go in a future PR. Please open an issue to that effect once this merges.

*/

.status-line {
display: block;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be display: flex with align-items: center. You'll have to fix some other things, but as it is the ellipsis is misaligned from the text baseline as it's not currently vertically centered.

@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 088476a to 63304b2 Compare May 15, 2025 05:39

This comment has been minimized.

@pengooseDev pengooseDev marked this pull request as draft May 15, 2025 06:40
@pengooseDev pengooseDev force-pushed the feat-skipped-test-report branch from 63304b2 to 84fc89c Compare May 16, 2025 00:47
@pengooseDev
Copy link
Contributor Author

pengooseDev commented May 16, 2025

@agg23

I’d like to discuss the alignment of the ellipsis.


1.

display: flex;
image

I wasn’t able to apply display: flex; at the top level because, to my understanding, one of the requirements for text-overflow: ellipsis is that the element be a block container (e.g. display: block;).

2.

Icon & Text Only text
image image

The ellipsis(...) is rendered too low because the icon’s height (16px) exceeds the font size (12px). Since the icon is center-aligned within an inline-flex container, the ellipsis ends up 2px below the text baseline.

3.

vertical-align: text-bottom;
image

I tried several fixes, and the most effective was using vertical-align: text-bottom & line-height: 1; on each component. However, this caused the right-hand toolbar buttons (Run all, Stop, Watch all) to shift by 0.5px in height, breaking CSS consistency. (e.g. padding-top: 0.5px;).

If you have any suggestions for resolving this, I’d appreciate your feedback. :)

@pengooseDev pengooseDev marked this pull request as ready for review May 16, 2025 01:03
@pengooseDev pengooseDev requested a review from agg23 May 16, 2025 01:03
Copy link
Contributor

Test results for "tests 1"

6 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104:3 › should work with strict CSP policy @firefox-ubuntu-22.04-node18
⚠️ [webkit-library] › library/ignorehttpserrors.spec.ts:30:3 › should isolate contexts @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/video.spec.ts:475:5 › screencast › should scale frames down to the requested size @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:148:5 › should watch all @windows-latest-node18-1

39212 passed, 803 skipped
✔️✔️✔️

Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add skipped tests to run report in UI
2 participants