Playwright Annotations
Using Playwright Annotations to enhance reporting to Currents dashboard
Last updated
Was this helpful?
Using Playwright Annotations to enhance reporting to Currents dashboard
Last updated
Was this helpful?
is a flexible way to add additional information about tests, like:
ownership information
metadata
links to external resources (Jira ticket, GitHub issue)
notes
Together with Playwright Tags it allows augmenting your testing suite with metadata for easier managing, better reporting and improved integrations.
You can add an annotation to a test by:
adding annotations
object to test
definition or
calling testInfo.annotations.push
For example:
Currents shows the annotations for the test:
Currents applies the following rules when parsing annotations:
types: skip, fixme, fail, slow
are reserved by Playwright
32
max distinct annotations per test, extra annotations will be removed (sorted by the order of appearance)
type
field is limited to 256
characters, the values are trimmed and truncated to the max length
description
field is limited to 2048
characters, the values are trimmed and truncated to the max length
If type
is empty after trimming, the annotation is ignored
Annotations can originate from test case definition or at runtime from test execution attempt.
Currents deduplicates annotations with exactly the same type, description and source.
Currents removes attempt-level annotation if there's an equivalent test-case annotation
While Currents displays all the annotations related to a test, some annotation have a special meaning, for example - test owner.
To designate an owner of a test, add annotation with type: owner
, for example:
The value will appear in various areas of the dashboard so that your team can quickly identify the who owns the test.
Annotation of type notify:slack
activates Slack mentions for failed tests - when Currents detects a failed test with notify:slack
annotation, it will trigger Slack notification according to the following convention:
You can combine the values to activate multiple notifications, for example:
For example, the following annotations will define test owner and activate slack notifications:
type: "notify:slack", description: "user:userId"
- will notify user with the corresponding userId, userId
can be either a
type: "notify:slack", description: "team:teamId"
- will notify team with the corresponding teamId
, (see how to retrieve id)