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

Filter test cases by annotation text in HTML report #30751

Merged
merged 4 commits into from May 24, 2024

Conversation

amankagithub
Copy link
Contributor

@amankagithub amankagithub commented May 11, 2024

Feature request : #30141
At Atlassian , we add team name , component name to annotations . If we want to search test case by teams on the HTML report we don't have any way .

In this PR , I had added the functionality to search by annotation .

Out of all tests there are two test cases with annotations .
Screenshot 2024-05-11 at 5 06 47 PM
Screenshot 2024-05-22 at 2 30 01 PM
Screenshot 2024-05-22 at 2 30 11 PM

If we just add to author in annotation search , both the test case appears .
Screenshot 2024-05-22 at 2 27 46 PM

If we add author=aman only one test case appears . Same with author=alex
Screenshot 2024-05-22 at 2 29 47 PM
Screenshot 2024-05-22 at 2 29 55 PM

This comment has been minimized.

This comment has been minimized.

@@ -45,6 +46,10 @@ export class Filter {
labels.add(token);
continue;
}
if (token.startsWith('a:')) {
Copy link
Member

Choose a reason for hiding this comment

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

a: would be ambiguous here (thing attachments, etc). How about "annot:"

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.

a: comment, otherwise looks good!

@amankagithub amankagithub force-pushed the aman/filter-by-annotation branch 2 times, most recently from 0ffa4ba to 4f0e48d Compare May 22, 2024 08:51

This comment has been minimized.

This comment has been minimized.

@@ -45,6 +46,10 @@ export class Filter {
labels.add(token);
continue;
}
if (token.startsWith('annot:')) {
annotations.add(token.slice(6));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
annotations.add(token.slice(6));
annotations.add(token.substring('annot:'.length));


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

Choose a reason for hiding this comment

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

Suggested change
searchValues.annotations.some(_annotation => _annotation.includes(annotation)));
searchValues.annotations.some(a => a.includes(annotation)));

@amankagithub
Copy link
Contributor Author

@microsoft-github-policy-service agree

@pavelfeldman
Copy link
Member

Thanks! I'll merge it once the nits from the previous review are addressed.

Copy link
Contributor

Test results for "tests 1"

1 flaky ⚠️ [chromium] › components/splitView.spec.tsx:34:5 › should render sidebar first

27056 passed, 609 skipped
✔️✔️✔️

Merge workflow run.

@pavelfeldman pavelfeldman merged commit 0e0b426 into microsoft:main May 24, 2024
30 checks passed
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

2 participants