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

Html report improvements #30094

Closed

Conversation

amankagithub
Copy link

@amankagithub amankagithub commented Mar 25, 2024

  1. Copy annotation text by one click .
  2. Search test case based on annotations .

This comment has been minimized.

@pavelfeldman
Copy link
Member

Please start with filing a feature request, even if you plan to contribute this PR.

Copy link
Member

@pavelfeldman pavelfeldman left a comment

Choose a reason for hiding this comment

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

Overall, looks good. There are some comments I'd like you to address and we are missing the tests for the new functionality.

@@ -114,6 +120,7 @@ export class Filter {
line: String(test.location.line),
column: String(test.location.column),
labels: test.tags.map(tag => tag.toLowerCase()),
annotations: test.annotations.map(a => a.type.toLowerCase() + ':' + a.description?.toLocaleLowerCase())
Copy link
Member

Choose a reason for hiding this comment

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

To make sure you only use : once in the filter.

Suggested change
annotations: test.annotations.map(a => a.type.toLowerCase() + ':' + a.description?.toLocaleLowerCase())
annotations: test.annotations.map(a => a.type.toLowerCase() + '=' + a.description?.toLocaleLowerCase())

@@ -144,7 +151,14 @@ export class Filter {
if (!matches)
return false;
}

if (this.annotations.length) {
Copy link
Member

Choose a reason for hiding this comment

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

This will return all the tests w/o annotations as matching the search criteria.

Copy link
Author

Choose a reason for hiding this comment

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

I tried and it did not . Only test case with annotations will be returned . In below example ,only two test cases which had some annotation is displayed . Am I missing something here?
Screenshot 2024-03-28 at 7 28 31 PM

Copy link
Member

Choose a reason for hiding this comment

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

Ah, you are right, I missed that this is a filter here. Still need a test for every new feature though.

Copy link
Author

Choose a reason for hiding this comment

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

I have added the test cases for copy feature . Please review .

return (
<div className='test-case-annotation'>
<span style={{ fontWeight: 'bold' }}>{type}</span>
<div className='test-case-annotation' onMouseEnter={onHover} onMouseLeave={onLeave}>
Copy link
Member

Choose a reason for hiding this comment

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

It looks like you are re-rendering the component that you add listeners to on hover, which might results in unexpected results.

I'd suggest adding a new component next to CopyToClipboard called aaa that would allow copying its content. That way we can use it in more places. I would also recommend that the visibility is implemented using CSS.

Copy link
Author

Choose a reason for hiding this comment

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

Not fully sure what you mean here . Made the required changes based on my what I could understand from your comment .

This comment has been minimized.

This comment has been minimized.

@amankagithub amankagithub force-pushed the aman/html-report-improvements branch 2 times, most recently from 01c472f to 6463753 Compare March 28, 2024 18:00

This comment has been minimized.

This comment has been minimized.

@amankagithub amankagithub force-pushed the aman/html-report-improvements branch from 6463753 to 86c5555 Compare April 1, 2024 05:58

This comment has been minimized.

This comment has been minimized.

@amankagithub amankagithub force-pushed the aman/html-report-improvements branch from 9b3ed73 to 03acbae Compare April 4, 2024 18:12

This comment has been minimized.


if (this.annotations.length) {
const matches = this.annotations.every(annotation =>
searchValues.annotations.some(_annotation => (
Copy link
Member

Choose a reason for hiding this comment

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

style nit: either drop () around _annotation.includes(annotation) or use {}

_annotation.includes(annotation)
)));
if (!matches)
return false;
Copy link
Member

Choose a reason for hiding this comment

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

Please add a test to tests/playwright-test/reporter-html.spec.ts that checks that the annotation filter actually works.

Copy link
Author

Choose a reason for hiding this comment

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

Have added the test as you suggested . Please review .

@amankagithub amankagithub force-pushed the aman/html-report-improvements branch 2 times, most recently from 99d56a6 to 3592581 Compare April 22, 2024 18:51

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

27486 passed, 672 skipped
✔️✔️✔️

Merge workflow run.

@dgozman
Copy link
Contributor

dgozman commented May 8, 2024

@amankagithub Unfortunately, we found it hard to review and merge this PR. Therefore, it is going slowly, sorry for that!

To make this process better, let's follow our general guidelines:

  • Start with filing a feature request following the issue template.
  • Split this PR into multiple focused PRs, e.g. "copy to clipboard" vs "accessibility improvements" vs "filter by annotations".
  • For any UI change, attach a screenshot that illustrates the change.

I'll close this PR, since it won't be merged due to the above.

@dgozman dgozman closed this May 8, 2024
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.

None yet

4 participants