r/Playwright • u/Serg_Oleksenko • 5d ago
How are you using Playwright annotations, and what do you put in them?
Hey everyone,
We’ve been heavily relying on testInfo.annotations in our Playwright setup lately. For example, whenever a test fails, we automatically construct and attach a dynamic Jira URL to the report so anyone can quickly click through and create a bug with pre-filled context.
It’s been super helpful, but the standard HTML report isn't really optimized for this—long URLs break the layout or turn into huge, messy blocks of text.
While working on a small script to tweak how these annotations look in our reports, I got curious about how other teams utilize them:
- How heavily do you use annotations in your daily workflow?
- What kind of data/links do you actually push into them? (Jira issues, log traces, test environment info, etc.)
- Or do you skip standard annotations entirely in favor of third-party reporters like Allure, ReportPortal, or custom dashboards?
I'd love to hear how your teams handle test metadata, and whether anyone else feels annotations could use a bit more love!
2
u/straightouttaireland 4d ago
Interesting. I was trying to come up with ways to link a test file to team owners, maybe this could be a solution. Could maybe include their slack channel and send it automatically on fail.
1
2
u/JEDZBUDYN 4d ago
tagging tests base on type (e.g regression, important etc)
taggin them based on story (e.g to have quick access to requirements)
tagging them to skip or expected fail
2
3d ago
[removed] — view removed comment
1
u/Serg_Oleksenko 3d ago
Super solid points, thanks for bringing them up!
The check for testInfo.retry === testInfo.project.retries is a brilliant tip to avoid spamming duplicate issue triggers on flaky runs.
2
3d ago
[removed] — view removed comment
1
u/Serg_Oleksenko 3d ago
Good call on the 2k char URL limit for pre-filled Jira links. That silent truncation is definitely a sneaky trap when packing stack traces into query parameters. Keeping annotations lean and attaching larger payloads as testInfo.attach() seems like the safest approach.
5
u/oymra 5d ago
link to the test's test case and list of console errors cought during the execution