diff --git a/test/integration/relay-analytics/test/index.test.js b/test/integration/relay-analytics/test/index.test.js index 2accc97815e83..5ee12ffa9e39a 100644 --- a/test/integration/relay-analytics/test/index.test.js +++ b/test/integration/relay-analytics/test/index.test.js @@ -117,9 +117,15 @@ function runTest() { ) // INP metric is only reported on pagehide or visibilitychange event, so refresh the page await browser.refresh() - const INP = parseInt(await browser.eval('localStorage.getItem("INP")'), 10) - // We introduced a delay of 100ms, so INP duration should be >= 100 - expect(INP).toBeGreaterThanOrEqual(100) + await check(async () => { + const INP = parseInt( + await browser.eval('localStorage.getItem("INP")'), + 10 + ) + // We introduced a delay of 100ms, so INP duration should be >= 100 + expect(INP).toBeGreaterThanOrEqual(100) + return 'success' + }, 'success') await browser.close() }) }