<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jitka Cernohorska on Medium]]></title>
        <description><![CDATA[Stories by Jitka Cernohorska on Medium]]></description>
        <link>https://medium.com/@cernojit?source=rss-883fd0956db1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SgMJumv_fLiORHSI.jpg</url>
            <title>Stories by Jitka Cernohorska on Medium</title>
            <link>https://medium.com/@cernojit?source=rss-883fd0956db1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:57:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cernojit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cypress vs. Playwright — Local speed quantification]]></title>
            <link>https://medium.com/cypress-vs-playwright-which-one-to-choose/cypress-vs-playwright-local-speed-quantification-fb7d5392ba58?source=rss-883fd0956db1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb7d5392ba58</guid>
            <dc:creator><![CDATA[Jitka Cernohorska]]></dc:creator>
            <pubDate>Sat, 24 May 2025 09:21:16 GMT</pubDate>
            <atom:updated>2025-05-24T09:21:16.539Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cypress vs. Playwright local speed quantification</h3><p><strong>At Heureka Group, our front-end projects are rigorously tested with both unit and end-to-end (E2E) tests. We rely on Cypress, a robust tool with strong community support and a proven track record, to meet our E2E testing needs. However, as our test suites grew, execution times became a significant bottleneck. To accelerate development, we explored Playwright, a promising alternative offering ability to interact with browsers rendering engines directly and built-in test parallelization.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*LM5ZIWSCGDHq4Fb5n7ONGA.png" /></figure><p>Cypress is a most popular technology for E2E testing. It is focused on Javascript applications and provides simple set-up. Cypress is using jQuery library to directly access document object model. Moreover, it incorporates very useful graphical interface tool for easy visualizing the scenarios and debugging as well.</p><p>Despite Cypress has longer history, Playwright’s popularity become almost two times higher from the point of view of weekly downloads. It also differs in architecture, speaking about browser interaction by using WebSockets, native test parallelization and cross-browser support.</p><p>The table below shows basic comparison of Playwright and Cypress.</p><pre><br>+--------------------------------+---------------------------+------------------------------------------+<br>|                                |    Playwright (1.50.1)    |             Cypress (14.0.3)             |<br>+--------------------------------+---------------------------+------------------------------------------+<br>| Release year                   | 2020                      | 2017                                     |<br>| Package size (MB)              | 3.18                      | 4.38                                     |<br>| # of weekly downloads          | 12 mil                    | 6 mil                                    |<br>| Browsers support               | Chromium, Firefox, WebKit | Chromium, Firefox, WebKit (experimental) |<br>| Tests parallelization          | Native support            | In the cloud CI (paid dashboard service) |<br>| CI/CD integration              | Yes                       | Yes                                      |<br>| Community support              | Growing                   | Strong and well-estabilished             |<br>| Screenshots / video recordings | Yes                       | Yes                                      |<br>+--------------------------------+---------------------------+------------------------------------------+<br></pre><p>There are lots of articles comparing those two technologies, moreover you can use some AI tool to get the nice summary :-). In this paper, we focused on quantification of those frameworks to decide what is more suitable for our front-end projects.</p><h3><strong>Measurements</strong></h3><p>All measurements began with three identical test suites, each executed once within our project. We implemented these tests using both Cypress and Playwright, ensuring identical scenarios. Chrome was used in headless mode for all browser interactions. Playwright’s configuration, as defined in its configuration file, is as follows:</p><pre>{<br>  name: &#39;Google Chrome&#39;,<br>  use: { ...devices[&#39;Desktop Chrome&#39;], channel: &#39;chrome&#39; },<br>}</pre><p><strong>Time comparison</strong></p><p>he initial measurement focused on a time comparison between Cypress 13, Cypress 14, and Playwright. Tests were executed five times for every framework using the following commands: yarn cypress run --browser chrome and yarn playwright test.</p><pre>+-----------------+----------------+-----------------+<br>| Cypress 13.17.0 | Cypress 14.0.3 | Playwright 1.50 |<br>+-----------------+----------------+-----------------+<br>|            7.89 |           7.35 |            3.71 |<br>|            7.78 |           6.27 |            3.49 |<br>|            6.53 |           6.43 |            2.39 |<br>|            6.49 |           6.30 |            3.26 |<br>|            6.99 |           6.26 |            3.29 |<br>+-----------------+----------------+-----------------+</pre><p>Test results indicate that Playwright executes single test scenarios approximately <strong>twice as fast as Cypress</strong>. Furthermore, Cypress 14 demonstrates an average performance improvement of 0.6 seconds compared to Cypress 13.</p><p>All following comparisons are conducted using Cypress 14.</p><p><strong>Test runner start time</strong></p><p>This measurement aimed to estimate test suite startup time. We progressively increased the number of identical tests within a single suite from one to twenty. The suite’s startup time was then determined by the y-intercept of the linear regression function.</p><p>The following commands were used for test execution: yarn cypress run --browser chrome --spec &lt;path_to_cy_suit&gt; for Cypress, and yarn playwright test &lt;path_to_pw_suit&gt; for Playwright.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWOjlzkIskCisTxTpdTeUw.png" /></figure><p>The data reveals that Cypress has a <strong>start time of 4.88 seconds</strong>, <strong>nearly twice as long as Playwright’s 2.91</strong>. While Playwright and Cypress have similar test file run times when there are more than three tests in a file, Playwright’s execution time appears to increase after the fourth measurement point. This jump likely corresponds to the use of 4 workers for parallel test execution.</p><p><strong>Playwright — Time dependency of the number of workers</strong></p><p>The next measurement was focused on Playwright only and its time dependency on number of tests in one test suit and different number of the workers. We increased the number of tests from 1 to 10. The page was loaded before each test. There is the used command for n workers: yarn playwright test playwright/suggester.spec.js --workers=&lt;n&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUJeqZCwN6_h0mEouV1iLA.png" /></figure><p>With fewer than four tests per file, the number of workers used makes little practical difference, especially considering measurement error. However, using only one worker significantly increases test execution time compared to using multiple workers. As observed in previous tests, a similar pattern emerges with higher worker counts. Therefore, an <strong>optimal range appears to be between four to six workers. </strong>From my perspective, I would recommend to adjust the number of workers right for your cases.</p><p><strong>Test speed according to the number of test files</strong></p><p>In the next part of the paper we will move on the comparison dependent of number of test suits. We increased number of test files with step of 5, each containing same one test with the same scenario. To eliminate measurement error we carried out measurement five times for every number of test files. The following commands were used for Cypress yarn cypress run --browser chrome and Playwright yarn playwright test with default number of workers 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZYACklEb0SiQbXu_GKwiQ.png" /></figure><p>The test results demonstrate a <strong>significant time advantage for Playwright over Cypress</strong>. When the number of test files doubles, Cypress test duration nearly doubles as well, consistent with the data from this paper: <a href="https://dev.to/swikritit/comparing-test-execution-speed-of-modern-test-automation-frameworks-cypress-vs-playwright-3hg8">Comparing Test Execution Speed of Modern Test Automation Frameworks: Cypress vs. Playwright</a>. Playwright’s duration, however, increases at a much slower rate. This clearly illustrates Playwright’s superior performance when running multiple tests within a project. The test speed might be further adjusted by increasing number of workers in case of Playwright.</p><p><strong>Resources estimation</strong></p><p>The goal of that measurement was to find some way and compare the load and resources. Cypress provides option to log memory and cpu usage using DEBUG variable, but it was not suitable for our measurement because we won’t be able to compare it with Playwright which does not offer same debug tool. The data were measured using node metrics directly in the test file.</p><pre>const memoryUsage = process.memoryUsage();<br>const cpuUsage = process.cpuUsage();</pre><p>In Playwright it was possible to log those metrics directly from code, but for Cypress we needed to configure node events in cypress.config.js.</p><pre>setupNodeEvents(on) {<br>     on(&#39;task&#39;, {<br>         logMemoryUsage() {<br>             const memoryUsage = process.memoryUsage();<br>             console.log(`Memory Usage:`, memoryUsage);<br>             return null;<br>        },<br>          logCPUUsage() {<br>             const cpuUsage = process.cpuUsage();<br>             console.log(&#39;CPU Usage:&#39;, cpuUsage);<br>             return null;<br>        },<br>    });<br>}</pre><p>We run only one test with those metrics where those metrics were measured at the end of the test.</p><pre><br>+---------+----------------+------------+---------+<br>|         |                | Playwright | Cypress |<br>+---------+----------------+------------+---------+<br>| Memory  | rss [Mb]       |        106 |   156.9 |<br>|         | heapTotal [Mb] |       55.4 |    98.1 |<br>|         | heapUsed [Mb]  |       27.8 |    56.0 |<br>|         | external [Mb]  |        2.5 |     2.7 |<br>+---------+----------------+------------+---------+<br>| CPU     | user [s]       |       0.40 |   0.734 |<br>|         | system [s]     |       0.05 |    0.15 |<br>+---------+----------------+------------+---------+</pre><p>As the measurement was provided directly in the test, we are not able to quantified real memory and CPU usage for whole test run. But the data clearly shows that Playwright has significantly lower usage of resources in comparison with Cypress.</p><p>In conclusion, our rigorous quantification of Cypress and Playwright for our front-end testing needs at Heureka reveals compelling insights. While Cypress has been a reliable and well-supported tool, our measurements consistently demonstrate Playwright’s superior performance, particularly in terms of execution speed and resource utilization. Playwright exhibited significantly faster execution times for individual test scenarios and showed a much more scalable performance when the number of test files increased. Furthermore, Playwright demonstrated notably lower memory and CPU usage during test execution. These findings strongly suggest that transitioning to Playwright holds the potential to alleviate the bottleneck caused by our growing E2E test suites, leading to accelerated development cycles. While the optimal number of workers in Playwright should be fine-tuned based on specific project needs, the framework’s native parallelization capabilities offer a clear advantage. Based on this comprehensive analysis, adopting Playwright appears to be a strategic move to enhance the efficiency and scalability of our front-end testing processes at Heureka.</p><p>© 2025 [Jitka Černohorská]. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb7d5392ba58" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cypress-vs-playwright-which-one-to-choose/cypress-vs-playwright-local-speed-quantification-fb7d5392ba58">Cypress vs. Playwright — Local speed quantification</a> was originally published in <a href="https://medium.com/cypress-vs-playwright-which-one-to-choose">Cypress vs. Playwright — which one to choose</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>