You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+45-35Lines changed: 45 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,16 +15,6 @@
15
15
<h3align="center">A comprehensive performance metrics collector for Playwright tests. Collect and analyze web vital metrics, network timing, and resource usage in your Playwright tests.</h3>
The playwright-performance-metrics plugin introduces a powerful way to measure and assert on web performance metrics directly in your Playwright tests. Unlike traditional end-to-end testing that focuses on functionality, this plugin enables teams to catch performance regressions early and maintain high performance standards through automated testing.
@@ -59,13 +49,16 @@ Both plugins focus on performance testing, but they serve different purposes:
59
49
**Key Features**
60
50
61
51
- Real-time performance metrics collection during test execution
52
+
- Collect Web Vitals (LCP, CLS)
53
+
- Network timing metrics (TTFB, resource timing)
54
+
- Network condition emulation (3G, 4G, WiFi)
62
55
- Built-in retry mechanisms for reliable measurements
63
-
- Support for Core Web Vitals and other key performance indicators
64
56
- Seamless integration with existing Playwright tests
65
57
- Type definitions for TypeScript support
66
58
- Configurable thresholds and timing options
59
+
- Resource usage tracking
67
60
68
-
The collectMetrics returns the object containing the collected performance metrics:
61
+
The **collectMetrics** method returns the object containing the collected performance metrics:
69
62
70
63
```
71
64
PerformanceMetrics {
@@ -88,6 +81,11 @@ The collectMetrics returns the object containing the collected performance metri
88
81
}
89
82
```
90
83
84
+
The **initialize** method accepts the predefined network condition preset (provided via **DefaultNetworkPresets**) or custom options and applies it to the current test run.
0 commit comments