wp-media / wp-rocket-e2e

Playwright E2E testing repo
GNU General Public License v3.0
0 stars 0 forks source link

Eradicate LCP flaky tests by increasing beacon delay. #114

Closed jeawhanlee closed 3 months ago

jeawhanlee commented 3 months ago

Is your feature request related to a problem? Please describe. We have had so many inconsistent results in the past when running LCP tests due to the fact that the contents are not completely loaded before the beacon script is triggered. This can happen for various reasons but the most common cause for this is an unstable internet connection.

Describe the solution you'd like To tackle this effectively and make sure the test passes consistently with the expectations we have come to an agreement to add a helper plugin that would delay the trigger of the script using the rocket_lcp_delay filter to 5000. This way, we have enough time to be sure that contents are properly loaded before the beacon is triggered.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context This solution has been tested by increasing the filter using code snippet on a e2e env and it works as expected.