@@ -33,7 +33,6 @@ import { CallMetadata, InstrumentationListener, internalCallMetadata, SdkObject
3333import { Point } from '../../common/types' ;
3434import { CallLog , CallLogStatus , EventData , Mode , Source , UIState } from './recorder/recorderTypes' ;
3535import { isUnderTest } from '../../utils/utils' ;
36- import { InMemorySnapshotter } from '../snapshot/inMemorySnapshotter' ;
3736import { metadataToCallLog } from './recorder/recorderUtils' ;
3837import { Debugger } from './debugger' ;
3938
@@ -56,9 +55,6 @@ export class RecorderSupplement implements InstrumentationListener {
5655 private _currentCallsMetadata = new Map < CallMetadata , SdkObject > ( ) ;
5756 private _recorderSources : Source [ ] ;
5857 private _userSources = new Map < string , Source > ( ) ;
59- private _snapshotter : InMemorySnapshotter ;
60- private _hoveredSnapshot : { callLogId : string , phase : 'before' | 'after' | 'action' } | undefined ;
61- private _snapshots = new Set < string > ( ) ;
6258 private _allMetadatas = new Map < string , CallMetadata > ( ) ;
6359 private _debugger : Debugger ;
6460
@@ -129,14 +125,12 @@ export class RecorderSupplement implements InstrumentationListener {
129125 } ) ;
130126 }
131127 this . _generator = generator ;
132- this . _snapshotter = new InMemorySnapshotter ( context ) ;
133128 }
134129
135130 async install ( ) {
136131 const recorderApp = await RecorderApp . open ( this . _context ) ;
137132 this . _recorderApp = recorderApp ;
138133 recorderApp . once ( 'close' , ( ) => {
139- this . _snapshotter . dispose ( ) . catch ( ( ) => { } ) ;
140134 this . _recorderApp = null ;
141135 } ) ;
142136 recorderApp . on ( 'event' , ( data : EventData ) => {
@@ -150,13 +144,6 @@ export class RecorderSupplement implements InstrumentationListener {
150144 this . _refreshOverlay ( ) ;
151145 return ;
152146 }
153- if ( data . event === 'callLogHovered' ) {
154- this . _hoveredSnapshot = undefined ;
155- if ( this . _debugger . isPaused ( ) && data . params . callLogId )
156- this . _hoveredSnapshot = data . params ;
157- this . _refreshOverlay ( ) ;
158- return ;
159- }
160147 if ( data . event === 'step' ) {
161148 this . _debugger . resume ( true ) ;
162149 return ;
@@ -202,26 +189,18 @@ export class RecorderSupplement implements InstrumentationListener {
202189 ( source : BindingSource , action : actions . Action ) => this . _recordAction ( source . frame , action ) , 'utility' ) ;
203190
204191 await this . _context . exposeBinding ( '_playwrightRecorderState' , false , source => {
205- let snapshotUrl : string | undefined ;
206192 let actionSelector = this . _highlightedSelector ;
207193 let actionPoint : Point | undefined ;
208- if ( this . _hoveredSnapshot ) {
209- const metadata = this . _allMetadatas . get ( this . _hoveredSnapshot . callLogId ) ! ;
210- snapshotUrl = `${ metadata . pageId } ?name=${ this . _hoveredSnapshot . phase } @${ this . _hoveredSnapshot . callLogId } ` ;
211- actionPoint = this . _hoveredSnapshot . phase === 'action' ? metadata ?. point : undefined ;
212- } else {
213- for ( const [ metadata , sdkObject ] of this . _currentCallsMetadata ) {
214- if ( source . page === sdkObject . attribution . page ) {
215- actionPoint = metadata . point || actionPoint ;
216- actionSelector = actionSelector || metadata . params . selector ;
217- }
194+ for ( const [ metadata , sdkObject ] of this . _currentCallsMetadata ) {
195+ if ( source . page === sdkObject . attribution . page ) {
196+ actionPoint = metadata . point || actionPoint ;
197+ actionSelector = actionSelector || metadata . params . selector ;
218198 }
219199 }
220200 const uiState : UIState = {
221201 mode : this . _mode ,
222202 actionPoint,
223203 actionSelector,
224- snapshotUrl,
225204 } ;
226205 return uiState ;
227206 } , 'utility' ) ;
@@ -236,8 +215,7 @@ export class RecorderSupplement implements InstrumentationListener {
236215 this . _debugger . resume ( false ) ;
237216 } , 'main' ) ;
238217
239- const snapshotBaseUrl = await this . _snapshotter . initialize ( ) + '/snapshot/' ;
240- await this . _context . extendInjectedScript ( 'utility' , recorderSource . source , { isUnderTest : isUnderTest ( ) , snapshotBaseUrl } ) ;
218+ await this . _context . extendInjectedScript ( 'utility' , recorderSource . source , { isUnderTest : isUnderTest ( ) } ) ;
241219 await this . _context . extendInjectedScript ( 'main' , consoleApiSource . source ) ;
242220
243221 if ( this . _debugger . isPaused ( ) )
@@ -391,18 +369,9 @@ export class RecorderSupplement implements InstrumentationListener {
391369 this . _generator . signal ( pageAlias , page . mainFrame ( ) , { name : 'dialog' , dialogAlias : String ( ++ this . _lastDialogOrdinal ) } ) ;
392370 }
393371
394- _captureSnapshot ( sdkObject : SdkObject , metadata : CallMetadata , phase : 'before' | 'after' | 'action' ) {
395- if ( sdkObject . attribution . page ) {
396- const snapshotName = `${ phase } @${ metadata . id } ` ;
397- this . _snapshots . add ( snapshotName ) ;
398- this . _snapshotter . captureSnapshot ( sdkObject . attribution . page , snapshotName ) ;
399- }
400- }
401-
402372 async onBeforeCall ( sdkObject : SdkObject , metadata : CallMetadata ) {
403373 if ( this . _mode === 'recording' )
404374 return ;
405- this . _captureSnapshot ( sdkObject , metadata , 'before' ) ;
406375 this . _currentCallsMetadata . set ( metadata , sdkObject ) ;
407376 this . _allMetadatas . set ( metadata . id , metadata ) ;
408377 this . _updateUserSources ( ) ;
@@ -416,7 +385,6 @@ export class RecorderSupplement implements InstrumentationListener {
416385 async onAfterCall ( sdkObject : SdkObject , metadata : CallMetadata ) {
417386 if ( this . _mode === 'recording' )
418387 return ;
419- this . _captureSnapshot ( sdkObject , metadata , 'after' ) ;
420388 if ( ! metadata . error )
421389 this . _currentCallsMetadata . delete ( metadata ) ;
422390 this . _updateUserSources ( ) ;
@@ -458,9 +426,6 @@ export class RecorderSupplement implements InstrumentationListener {
458426 }
459427
460428 async onBeforeInputAction ( sdkObject : SdkObject , metadata : CallMetadata ) {
461- if ( this . _mode === 'recording' )
462- return ;
463- this . _captureSnapshot ( sdkObject , metadata , 'action' ) ;
464429 }
465430
466431 async onCallLog ( logName : string , message : string , sdkObject : SdkObject , metadata : CallMetadata ) : Promise < void > {
@@ -479,7 +444,7 @@ export class RecorderSupplement implements InstrumentationListener {
479444 status = 'in-progress' ;
480445 if ( this . _debugger . isPaused ( metadata ) )
481446 status = 'paused' ;
482- logs . push ( metadataToCallLog ( metadata , status , this . _snapshots ) ) ;
447+ logs . push ( metadataToCallLog ( metadata , status ) ) ;
483448 }
484449 this . _recorderApp ?. updateCallLogs ( logs ) ;
485450 }
0 commit comments