File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ Improve flaky analytics test
Original file line number Diff line number Diff line change @@ -152,10 +152,15 @@ test.describe('analytics', () => {
152152 link . textContent = 'link-to-local-explorer'
153153 document . body . appendChild ( link )
154154 } )
155- await page . getByRole ( 'link' , { name : 'link-to-local-explorer' } ) . click ( )
156- await expect ( page . getByText ( 'Latest Blocks' ) ) . toBeVisible ( { timeout : 50000 } )
157- await expect ( page . evaluate ( ( ) => document . referrer ) ) . resolves . toContain ( 'https://wallet.oasis.io' )
158- await page . waitForTimeout ( 100 )
155+
156+ await Promise . all ( [
157+ ( async ( ) => {
158+ await page . getByRole ( 'link' , { name : 'link-to-local-explorer' } ) . click ( )
159+ await expect ( page . getByText ( 'Latest Blocks' ) ) . toBeVisible ( { timeout : 50000 } )
160+ await expect ( page . evaluate ( ( ) => document . referrer ) ) . resolves . toContain ( 'https://wallet.oasis.io' )
161+ } ) ( ) ,
162+ page . waitForRequest ( 'https://matomo.oasis.io/matomo.php?**' ) ,
163+ ] )
159164 expect ( getMatomoRequests ( ) . length ) . toBeGreaterThanOrEqual ( 3 ) // Tracked, possibly twice due to React StrictMode
160165 expect ( decodeURIComponent ( getMatomoRequests ( ) . at ( - 1 ) ! ) ) . toContain ( 'urlref=https://wallet.oasis.io/&' )
161166
You can’t perform that action at this time.
0 commit comments