playwright
playwright copied to clipboard
[Feature]: Set poll interval of assertion
🚀 Feature Request
Ability to set the frequency of polling to something fine-grained e.g. 50ms. For example testing if an element is visible or not.
Example
No response
Motivation
We are using Playwright to measure the performance of our app. But it appears that Playwright polls elements in some cases very slowly upwards of 1s to notice a change. This leads to random changes in the perceived performance of our app. But we want to be able to measure the performance very granularly in order to detect small regressions.
Hi! What exact function in our API are you using for that? Where would you want to set the frequency? Feel free to share an example code snippet with the API you care about and the addition you propose.
Also, we wouldn't recommend to run assertions as part of performance testing.
What exact function in our API are you using for that?
Just standard expects. It's a test case to run through a flow, but then we are measuring the time it takes between some (or all) of the steps.
Where would you want to set the frequency?
I was thinking on the expect level, but I'd probably want it everywhere in order for everything to be reliably fast.
we wouldn't recommend to run assertions as part of performance testing
Is there an alternative to assertions you are thinking about?
As a workaround, you can use expect.toPass where you can set retry intervals manually.
Why was this issue closed?
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.