Closed sahajkotha closed 2 weeks ago
is there any update on this proposed feature?
Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.
If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.
Let us know what functionality you'd like to see in Playwright and what your use case is.
Playwright is widely known for its functional testing uses, an extension of Playwright to extract performance metrics for SPAs can help in a wider adoption. Currently, Playwright enables us to extract some of the performance metrics using the browser APIs but these work only for hard navigations, and these metrics do not get updated in cases of soft navigations in SPAs as the initial HTML document is typically loaded once, and subsequent navigation or state changes are handled by JavaScript frameworks or libraries.
Do you think others might benefit from this as well?
Soft navigation steps are an important part of web applications, as they allow users to navigate between pages without triggering a full page reload. However, measuring the performance of these steps can be challenging, as they do not always result in a clear change in the URL or page content. The ability to extract performance metrics would be especially useful for developers who are working on optimizing web applications.
Proposed solutions: In my project, I have created some common utils that are Higher order functions that accept Playwright scripts to perform some user actions and this function returns the time taken to perform these actions with the use of manual start and stop timers.
Sample code snippets:
In the above snippet, measurePerformance is the HOF and its internal implementation looks like this:
To capture the latency of APIs, I'm making use of a listener requestfinished:
Can you suggest if there are better ways to evaluate the performance of soft navigation steps or if the above methods can be added to Playwright and expose them for users to measure the latency. Thanks in advance.