File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed
browser-integration-tests/suites/replay/canvas
withCanvasIntegrationFirst
withCanvasIntegrationSecond Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 11import { expect } from '@playwright/test' ;
22
33import { sentryTest } from '../../../../utils/fixtures' ;
4- import { getReplaySnapshot , shouldSkipReplayTest } from '../../../../utils/replayHelpers' ;
4+ import { getReplaySnapshot , shouldSkipReplayTest , waitForReplayRequest } from '../../../../utils/replayHelpers' ;
55
66sentryTest ( 'sets up canvas when adding ReplayCanvas integration first' , async ( { getLocalTestUrl, page } ) => {
7- if ( shouldSkipReplayTest ( ) ) {
7+ if ( shouldSkipReplayTest ( ) || ( process . env . PW_BUNDLE || '' ) . startsWith ( 'bundle' ) ) {
88 sentryTest . skip ( ) ;
99 }
1010
11+ const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
12+
1113 await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
1214 return route . fulfill ( {
1315 status : 200 ,
@@ -19,10 +21,11 @@ sentryTest('sets up canvas when adding ReplayCanvas integration first', async ({
1921 const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
2022
2123 await page . goto ( url ) ;
24+ await reqPromise0 ;
2225
2326 const replay = await getReplaySnapshot ( page ) ;
24- const canvasOptions = replay . _options . _experiments ?. canvas ;
25- expect ( canvasOptions . fps ) . toBe ( 4 ) ;
26- expect ( canvasOptions . quality ) . toBe ( 0.6 ) ;
27+ const canvasOptions = replay . _canvas ;
28+ expect ( canvasOptions ?. sampling . canvas ) . toBe ( 2 ) ;
29+ expect ( canvasOptions ?. dataURLOptions . quality ) . toBe ( 0.4 ) ;
2730 expect ( replay . _hasCanvas ) . toBe ( true ) ;
2831} ) ;
Original file line number Diff line number Diff line change 11import { expect } from '@playwright/test' ;
22
33import { sentryTest } from '../../../../utils/fixtures' ;
4- import { getReplaySnapshot , shouldSkipReplayTest } from '../../../../utils/replayHelpers' ;
4+ import { getReplaySnapshot , shouldSkipReplayTest , waitForReplayRequest } from '../../../../utils/replayHelpers' ;
55
66sentryTest ( 'sets up canvas when adding ReplayCanvas integration after Replay' , async ( { getLocalTestUrl, page } ) => {
7- if ( shouldSkipReplayTest ( ) ) {
7+ if ( shouldSkipReplayTest ( ) || ( process . env . PW_BUNDLE || '' ) . startsWith ( 'bundle' ) ) {
88 sentryTest . skip ( ) ;
99 }
1010
11+ const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
12+
1113 await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
1214 return route . fulfill ( {
1315 status : 200 ,
@@ -19,10 +21,11 @@ sentryTest('sets up canvas when adding ReplayCanvas integration after Replay', a
1921 const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
2022
2123 await page . goto ( url ) ;
24+ await reqPromise0 ;
2225
2326 const replay = await getReplaySnapshot ( page ) ;
24- const canvasOptions = replay . _options . _experiments ?. canvas ;
25- expect ( canvasOptions . fps ) . toBe ( 4 ) ;
26- expect ( canvasOptions . quality ) . toBe ( 0.6 ) ;
27+ const canvasOptions = replay . _canvas ;
28+ expect ( canvasOptions ?. sampling . canvas ) . toBe ( 2 ) ;
29+ expect ( canvasOptions ?. dataURLOptions . quality ) . toBe ( 0.4 ) ;
2730 expect ( replay . _hasCanvas ) . toBe ( true ) ;
2831} ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ sentryTest('does not setup up canvas without ReplayCanvas integration', async ({
2121 await page . goto ( url ) ;
2222
2323 const replay = await getReplaySnapshot ( page ) ;
24- const canvasOptions = replay . _options . _experiments ?. canvas ;
24+ const canvasOptions = replay . _canvas ;
2525 expect ( canvasOptions ) . toBe ( undefined ) ;
2626 expect ( replay . _hasCanvas ) . toBe ( false ) ;
2727} ) ;
Original file line number Diff line number Diff line change @@ -138,13 +138,13 @@ export interface Client<O extends ClientOptions = ClientOptions> {
138138 */
139139 getEventProcessors ?( ) : EventProcessor [ ] ;
140140
141- /**
141+ /**
142142 * Returns the client's instance of the given integration class, it any.
143143 * @deprecated Use `getIntegrationByName()` instead.
144144 */
145- getIntegration < T extends Integration > ( integration : IntegrationClass < T > ) : T | null ;
145+ getIntegration < T extends Integration > ( integration : IntegrationClass < T > ) : T | null ;
146146
147- /** Get the instance of the integration with the given name on the client, if it was added. */
147+ /** Get the instance of the integration with the given name on the client, if it was added. */
148148 getIntegrationByName ?< T extends Integration = Integration > ( name : string ) : T | undefined ;
149149
150150 /**
You can’t perform that action at this time.
0 commit comments