File tree 1 file changed +5
-2
lines changed
dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,21 @@ sentryTest('should capture a LCP vital with element details.', async ({ browserN
10
10
sentryTest . skip ( ) ;
11
11
}
12
12
const imageSrc = 'https://example.com/path/to/image.png' ;
13
+ const imageResponsePromise = page . waitForResponse ( imageSrc ) ;
13
14
page . route ( '**' , route => route . continue ( ) ) ;
14
15
page . route ( '**/path/to/image.png' , async ( route : Route ) => {
15
16
return route . fulfill ( { path : `${ __dirname } /assets/sentry-logo-600x179.png` } ) ;
16
17
} ) ;
17
18
18
19
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
19
- const [ eventData ] = await Promise . all ( [
20
+ const [ eventData , imageResponse ] = await Promise . all ( [
20
21
getFirstSentryEnvelopeRequest < Event > ( page ) ,
21
22
page . goto ( url ) ,
22
- page . waitForResponse ( imageSrc ) ,
23
+ imageResponsePromise ,
23
24
] ) ;
24
25
26
+ await imageResponse ?. finished ( ) ;
27
+
25
28
// Clicking the button before image loads will result in the button being the LCP
26
29
await page . locator ( 'button' ) . click ( ) ;
27
30
You can’t perform that action at this time.
0 commit comments