<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Petros Plakogiannis</title>
    <description>The latest articles on DEV Community by Petros Plakogiannis (@pete2121).</description>
    <link>https://dev.to/pete2121</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4213394%2F3e14e4e4-d680-4756-bd30-6e454a76af6c.jpg</url>
      <title>DEV Community: Petros Plakogiannis</title>
      <link>https://dev.to/pete2121</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pete2121"/>
    <language>en</language>
    <item>
      <title>Why I Built Cypress Performance UI: A Simple Way to Measure Web Performance with Cypress</title>
      <dc:creator>Petros Plakogiannis</dc:creator>
      <pubDate>Wed, 28 Oct 2026 15:45:46 +0000</pubDate>
      <link>https://dev.to/cypress/why-i-built-cypress-performance-ui-a-simple-way-to-measure-web-performance-with-cypress-47h8</link>
      <guid>https://dev.to/cypress/why-i-built-cypress-performance-ui-a-simple-way-to-measure-web-performance-with-cypress-47h8</guid>
      <description>&lt;p&gt;I've been working with performance testing for many years, and one thing I've learned is that performance doesn't always have to be complicated.&lt;/p&gt;

&lt;p&gt;Sometimes, you just want to know how fast a page loads, how the browser behaves, and whether something has become slower after a change.&lt;/p&gt;

&lt;p&gt;That's what made me start working on cypress-performance-ui, an open-source Cypress plugin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Started&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Over the years, I've used different tools and approaches for performance testing.&lt;/p&gt;

&lt;p&gt;Most of the time, the focus is on APIs, backend response times, or how a system behaves under load.&lt;/p&gt;

&lt;p&gt;But I also wanted something simple for the client side.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I wanted to answer questions like:&lt;/li&gt;
&lt;li&gt;How long does a page take to load?&lt;/li&gt;
&lt;li&gt;How quickly does the browser start receiving the response?&lt;/li&gt;
&lt;li&gt;When is the page content displayed?&lt;/li&gt;
&lt;li&gt;Is the page getting slower over time?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And most importantly, I wanted to check these things directly from my existing Cypress tests.&lt;/p&gt;

&lt;p&gt;I didn't want to set up a separate performance testing tool every time I needed a quick check.&lt;/p&gt;

&lt;p&gt;So I decided to build something myself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Meet Cypress Performance UI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;cypress-performance-ui&lt;/strong&gt; is a small, open-source plugin that lets you collect browser performance metrics directly inside Cypress.&lt;/p&gt;

&lt;p&gt;It uses the browser's native Performance API, so you don't need Lighthouse or another performance testing tool.&lt;/p&gt;

&lt;p&gt;You can measure things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total page load time&lt;/li&gt;
&lt;li&gt;Time to First Byte (TTFB)&lt;/li&gt;
&lt;li&gt;First Contentful Paint (FCP)&lt;/li&gt;
&lt;li&gt;DOM Content Loaded&lt;/li&gt;
&lt;li&gt;Load Event timing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also save these measurements and view them in an HTML dashboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install the plugin:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save-dev cypress-performance-ui&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Register the plugin in your cypress.config.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cypress&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;registerPerformancePlugin&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cypress-performance-ui/plugin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;e2e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setupNodeEvents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;registerPerformancePlugin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then import the commands in cypress/support/e2e.js (or e2e.ts):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import "cypress-performance-ui";&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you can collect performance data from your tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://www.google.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generatePerformanceReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cypress/performance/reports/performance-report.html&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Home page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it!&lt;/p&gt;

&lt;p&gt;The plugin collects the page performance metrics, saves them in a JSON file, and generates an HTML report.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tracking Performance Over Time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the things I wanted was to keep historical performance results.&lt;/p&gt;

&lt;p&gt;Measuring a page once is useful, but comparing it with previous runs is even more useful.&lt;/p&gt;

&lt;p&gt;For example, maybe your home page normally loads in around 400 ms.&lt;/p&gt;

&lt;p&gt;After a new release, it starts taking 700 ms.&lt;/p&gt;

&lt;p&gt;That's something you want to notice.&lt;/p&gt;

&lt;p&gt;With Cypress Performance UI, the measurements are saved in JSON, so you can track page load times across different test runs.&lt;/p&gt;

&lt;p&gt;The HTML dashboard also shows charts to help you understand how performance changes over time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzg4664shnl2gp73sljxr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzg4664shnl2gp73sljxr.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Historical Performance Baselines&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the latest version, I added a feature called &lt;strong&gt;Historical Performance Baselines.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The idea is simple: compare the current page load time with previous measurements.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://www.google.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertPageLoadBaseline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Home page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;historyDays&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;minSamples&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tolerance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Cypress to:&lt;/p&gt;

&lt;p&gt;Look at the last 30 days of saved measurements for the Home page.&lt;/p&gt;

&lt;p&gt;Calculate the 75th percentile of the page load times.&lt;/p&gt;

&lt;p&gt;Allow an extra 10% as tolerance.&lt;/p&gt;

&lt;p&gt;Fail the test if the current page load time is above that limit.&lt;/p&gt;

&lt;p&gt;You need to collect enough historical measurements first. The baseline is calculated from saved results; it isn't created automatically by the assertion.&lt;/p&gt;

&lt;p&gt;I like this approach because I don't have to manually set a fixed limit for every page.&lt;/p&gt;

&lt;p&gt;The baseline can change as new measurements are added to the history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PASS and FAIL Results in the Dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I also wanted to make the results easier to understand.&lt;/p&gt;

&lt;p&gt;So I added a table to the HTML dashboard showing the page name, historical baseline, actual page load time, date, and whether the test passed or failed.&lt;/p&gt;

&lt;p&gt;There's also a pie chart showing the PASS vs FAIL ratio.&lt;/p&gt;

&lt;p&gt;This makes it easier to see how the application is performing across different test runs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj5u0uacgvvhgurx4s90y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj5u0uacgvvhgurx4s90y.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TypeScript Support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The plugin also supports TypeScript.&lt;/p&gt;

&lt;p&gt;You can use the same Cypress commands in JavaScript or TypeScript projects, with autocomplete and type checking.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertPageLoadBaseline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Home page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;percentile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tolerance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No need to rewrite the plugin or use a different API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I still have ideas for improving the plugin.&lt;/p&gt;

&lt;p&gt;I'd like to keep improving the HTML dashboard, make the performance results easier to read, and explore more ways to use it in CI pipelines.&lt;/p&gt;

&lt;p&gt;The goal is not to replace tools like Lighthouse, JMeter, or other performance testing solutions.&lt;/p&gt;

&lt;p&gt;I just wanted something lightweight and easy to use when I need a quick look at client-side performance during my Cypress tests.&lt;/p&gt;

&lt;p&gt;And that's still the main idea behind this project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try It Out&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cypress Performance UI is open source, and I'd be happy to hear feedback, ideas, or suggestions from other QA engineers and developers.&lt;/p&gt;

&lt;p&gt;You can find it here:&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/pete2121/cypress-performance-ui" rel="noopener noreferrer"&gt;https://github.com/pete2121/cypress-performance-ui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;npm: &lt;a href="https://www.npmjs.com/package/cypress-performance-ui" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/cypress-performance-ui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's also listed in the official Cypress Plugin Directory as a community plugin.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h1&gt;
  
  
  cypress #performance #testing #opensource
&lt;/h1&gt;

</description>
      <category>testing</category>
      <category>cypress</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
