@@ -32,10 +32,13 @@ sentryTest('should capture interaction transaction. @firefox', async ({ browserN
32
32
await page . goto ( url ) ;
33
33
await getFirstSentryEnvelopeRequest < SentryEvent > ( page ) ;
34
34
35
+ const envelopesPromise = getMultipleSentryEnvelopeRequests < TransactionJSON > ( page , 1 ) ;
36
+
35
37
await page . locator ( '[data-test-id=interaction-button]' ) . click ( ) ;
36
38
await page . locator ( '.clicked[data-test-id=interaction-button]' ) . isVisible ( ) ;
37
39
38
- const envelopes = await getMultipleSentryEnvelopeRequests < TransactionJSON > ( page , 1 ) ;
40
+ const envelopes = await envelopesPromise ;
41
+
39
42
expect ( envelopes ) . toHaveLength ( 1 ) ;
40
43
41
44
const eventData = envelopes [ 0 ] ;
@@ -73,9 +76,10 @@ sentryTest(
73
76
await getFirstSentryEnvelopeRequest < SentryEvent > ( page ) ;
74
77
75
78
for ( let i = 0 ; i < 4 ; i ++ ) {
79
+ const envelopePromise = getMultipleSentryEnvelopeRequests < SentryEvent > ( page , 1 ) ;
76
80
await wait ( 100 ) ;
77
81
await page . locator ( '[data-test-id=interaction-button]' ) . click ( ) ;
78
- const envelope = await getMultipleSentryEnvelopeRequests < SentryEvent > ( page , 1 ) ;
82
+ const envelope = await envelopePromise ;
79
83
expect ( envelope [ 0 ] . spans ) . toHaveLength ( 1 ) ;
80
84
}
81
85
} ,
@@ -99,9 +103,11 @@ sentryTest(
99
103
await page . goto ( url ) ;
100
104
await getFirstSentryEnvelopeRequest < SentryEvent > ( page ) ;
101
105
106
+ const envelopePromise = getMultipleSentryEnvelopeRequests < TransactionJSON > ( page , 1 ) ;
107
+
102
108
await page . locator ( '[data-test-id=annotated-button]' ) . click ( ) ;
103
109
104
- const envelopes = await getMultipleSentryEnvelopeRequests < TransactionJSON > ( page , 1 ) ;
110
+ const envelopes = await envelopePromise ;
105
111
expect ( envelopes ) . toHaveLength ( 1 ) ;
106
112
const eventData = envelopes [ 0 ] ;
107
113
@@ -131,9 +137,11 @@ sentryTest(
131
137
await page . goto ( url ) ;
132
138
await getFirstSentryEnvelopeRequest < SentryEvent > ( page ) ;
133
139
140
+ const envelopesPromise = getMultipleSentryEnvelopeRequests < TransactionJSON > ( page , 1 ) ;
141
+
134
142
await page . locator ( '[data-test-id=styled-button]' ) . click ( ) ;
135
143
136
- const envelopes = await getMultipleSentryEnvelopeRequests < TransactionJSON > ( page , 1 ) ;
144
+ const envelopes = await envelopesPromise ;
137
145
expect ( envelopes ) . toHaveLength ( 1 ) ;
138
146
const eventData = envelopes [ 0 ] ;
139
147
0 commit comments