Skip to main content
Annotations attach metadata directly to your Playwright tests. Tag each test case with priority, feature area, owner, ticket links, Slack targets, and custom metrics. TestDino displays them in the UI next to each test case. To label an entire test run, use --tags on tdpw test. Playwright does not define --tags. Learn how to set run labels in Run-level tags.

Quick Reference

Supported Annotations

Annotations use the standard Playwright annotation array. All types use the testdino: prefix.
Notetestdino:notify-slack triggers Slack notifications when configured. testdino:metric tracks numeric values over time with charts. All other annotation types display in the TestDino UI for reference.

Add Annotations to Tests

Add the annotation array to any Playwright test. Each entry has a type (the annotation name) and a description (the value):
tests/navbar.spec.ts
You can notify multiple channels and users from a single annotation by separating them with commas:
For better readability, use separate entries:

Slack Notification Targets

TipSeparate entries per target are recommended for readability and easier maintenance.

Custom Metrics

The metric annotation type tracks custom numeric values across test runs. Unlike other annotations that store text, metrics store structured data (name, value, unit, optional threshold). TestDino shows each metric in the Annotations panel on the test case and plots a time-series chart per metric name. Use metrics to track anything you measure during a test: page load time, API latency, memory usage, bundle size, Lighthouse scores, or business numbers like conversion rate.

Metric Format

The testdino:metric annotation uses a JSON string as the description:

Supported Units

Static vs. Runtime Metrics

You can set metric values in 2 ways depending on your use case. Static values go in the annotation array at test declaration. Use this for values you know ahead of time or compute before the test:
tests/static-metric.spec.ts
Runtime values are measured during the test and pushed with test.info().annotations.push(). Use this for performance timings, API latency, or anything captured at execution time:
tests/performance.spec.ts
TipUse test.info().annotations.push() for any metric that depends on runtime measurement. The annotation array on the test declaration runs before the test body, so it cannot access runtime values.

Example: Track Multiple Metrics at Runtime

A single test can report multiple metrics. Push each one after you capture the value:
tests/checkout.spec.ts

Common Metric Examples

These show the annotation format for different categories. Replace the value with your actual measurement.

How Metrics Display in TestDino

Metric values appear on the test case detail page in 2 places:
  • Annotations panel on the test case overview. Each metric shows its name and a value unit / threshold badge, for example page-load-time with 1234 ms / 2000. A threshold of 0 (or omitted) shows the value alone.
  • Custom Runtime Metrics chart in the Specs Explorer. TestDino plots a time-series chart for each metric name, with the X-axis showing test run timestamps and the Y-axis showing the metric value. Filter by metric name to focus on a specific measurement, and the chart updates as new test runs report values for that metric.
TipKeep metric names consistent across runs. Use the exact same name string every time (for example, always page-load-time, not sometimes pageLoadTime). This ensures all data points appear on the same trend line.

View Annotations in TestDino

Once your tests run, annotations appear in 2 places in TestDino.

Test Case Detail

Open any test case from a test run. Below the KPI tiles, the Annotations panel lists every annotation on that test: priority, feature, link, owner, Slack targets, context, and flaky reason. Metric values also appear with their name, value, and unit.

Detailed Analysis Table

In the Test Runs > Summary > Detailed Analysis table, each test row has an Annotations badge. Click it to expand and see annotation chips (priority, feature, owner, Slack targets) inline with the test result. This makes it easy to scan annotations across all tests in a run without opening each one.

Annotation-Based Slack Notifications

An Annotation-based Slack notification lists the test cases carrying a given annotation key, so the owner named in your test code gets the alert. This is one of the notification types in the Slack App, alongside run summaries, failure lists, flaky tests, and tag matching. The notification flow:
  1. Your test carries a testdino:notify-slack annotation.
  2. A run finishes and the annotated test case matches the notification’s settings.
  3. TestDino posts the message to every Slack channel and user on that notification.
WarningAnnotation-based Slack notifications require the Slack App to be connected to your project. The Slack Webhook integration does not support annotation-based alerts.

Configure an Annotation-Based Notification

The notification connects the annotation key you write in your test code to Slack channels and users in your workspace.
1

Connect the Slack App

Go to Project Settings > Integrations > Communication > Slack App and connect your Slack workspace. See Slack App setup if you have not connected yet.
2

Add a notification

Click the settings icon on the Slack App card to open the Slack Notification Configuration dialog, click New, and pick the Annotation-based type.
3

Set the annotation key

Under Which tests it lists, set Annotation key to testdino:notify-slack. It matches a test case whose annotation type or description equals that key.
4

Pick the destinations

Under Where it goes, pick the Slack channels and users that receive this message. One notification can target channels and people at the same time.
5

Save, then send a test

Save the notification, then use Send test to post a real message to every destination on it.

Things to Know

  • Notifications live on the project. Each one holds its own annotation key and its own destinations.
  • One notification per key. To reach different people from different annotation keys, add a separate notification for each key.
  • One test can notify multiple targets. Add separate testdino:notify-slack entries for each channel or user you want to alert.

Example: Full Annotation Setup

This test uses all supported annotation types, including a runtime metric:
tests/order.spec.ts
When this test runs:
  • TestDino shows all annotations in the test case Annotations panel.
  • The order-flow-time metric appears on the test detail page and is plotted on a trend chart across runs.
  • If the test fails, Slack alerts go to #ch-td-extra and @ashish (if mapped in the Slack App configuration).
  • The Detailed Analysis table shows annotation chips for quick scanning across all tests in the run.

Slack App

Connect Slack and configure notification channels

Test Cases

View test case details and annotations

Test Runs Summary

Detailed analysis with annotation chips

Node.js CLI

Reporter configuration and CLI options
Last modified on September 1, 2026