Playwright Annotations
Using Playwright Annotations to enhance reporting to Currents dashboard
Playwright Annotations 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 more data for easier managing, better reporting and improved integration.
You can add an annotation to a test by setting annotations object to test definition or invoking testInfo.annotations.push , for example
test("annotated test", {
annotation: {
type: "issue",
description: "https://github.com/microsoft/playwright/issues/23180",
},
}, async ({ page }, testInfo) => {
testInfo.annotations.push({
type: "note",
description: "This is a note",
});
testInfo.annotations.push({
type: "jira",
description: "https://jira.company.io/ticket/JIRA-123",
});
testInfo.annotations.push({
type: "owner",
description: "johnsmith",
});
});Currents displays the annotations for recorded tests:

Currents will apply the following modifiations to annotations
types:
skip, fixme, failare reserved by Playwright32max distinct annotations per test, extra annotations will be truncated (sortedby the order of appearance)typefield is limited to256characters, the values will be trimmed and truncated to the max lengthdescriptionfield is limited to2048characters, the values will be trimmed and truncated to the max lengthIf
typefield is empty after trimming, the annotation will be ignoredfields with the same
typewill be merged - their description will be merged into one field, separated by comma
Test Owners
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:
testInfo.annotations.push({
type: "owner",
description: "johnsmith",
});The value will appear in various areas of the dashboard so that your team can quickly identify the who owns the test.

Slack notification for Test Owners
Currents will mention the test owners when their tests fail via Slack (if Slack integration is enabled). Currents will send the list of failed tests together with the associated owners - if the owner field value container their Slack username, they will activate the "mention" notification.
Add Slack username, like
johnsmithto notify individual usersAdd
<!channel>to notify the whole channel associated with the Slack integration (equivalent to typing@channelin Slack UI)
You can specify multiple owners using comma-separated value, for example user1, user2

Last updated
Was this helpful?