@@ -33,7 +33,6 @@ import { CallMetadata, InstrumentationListener, internalCallMetadata, SdkObject
33
33
import { Point } from '../../common/types' ;
34
34
import { CallLog , CallLogStatus , EventData , Mode , Source , UIState } from './recorder/recorderTypes' ;
35
35
import { isUnderTest } from '../../utils/utils' ;
36
- import { InMemorySnapshotter } from '../snapshot/inMemorySnapshotter' ;
37
36
import { metadataToCallLog } from './recorder/recorderUtils' ;
38
37
import { Debugger } from './debugger' ;
39
38
@@ -56,9 +55,6 @@ export class RecorderSupplement implements InstrumentationListener {
56
55
private _currentCallsMetadata = new Map < CallMetadata , SdkObject > ( ) ;
57
56
private _recorderSources : Source [ ] ;
58
57
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 > ( ) ;
62
58
private _allMetadatas = new Map < string , CallMetadata > ( ) ;
63
59
private _debugger : Debugger ;
64
60
@@ -129,14 +125,12 @@ export class RecorderSupplement implements InstrumentationListener {
129
125
} ) ;
130
126
}
131
127
this . _generator = generator ;
132
- this . _snapshotter = new InMemorySnapshotter ( context ) ;
133
128
}
134
129
135
130
async install ( ) {
136
131
const recorderApp = await RecorderApp . open ( this . _context ) ;
137
132
this . _recorderApp = recorderApp ;
138
133
recorderApp . once ( 'close' , ( ) => {
139
- this . _snapshotter . dispose ( ) . catch ( ( ) => { } ) ;
140
134
this . _recorderApp = null ;
141
135
} ) ;
142
136
recorderApp . on ( 'event' , ( data : EventData ) => {
@@ -150,13 +144,6 @@ export class RecorderSupplement implements InstrumentationListener {
150
144
this . _refreshOverlay ( ) ;
151
145
return ;
152
146
}
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
- }
160
147
if ( data . event === 'step' ) {
161
148
this . _debugger . resume ( true ) ;
162
149
return ;
@@ -202,26 +189,18 @@ export class RecorderSupplement implements InstrumentationListener {
202
189
( source : BindingSource , action : actions . Action ) => this . _recordAction ( source . frame , action ) , 'utility' ) ;
203
190
204
191
await this . _context . exposeBinding ( '_playwrightRecorderState' , false , source => {
205
- let snapshotUrl : string | undefined ;
206
192
let actionSelector = this . _highlightedSelector ;
207
193
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 ;
218
198
}
219
199
}
220
200
const uiState : UIState = {
221
201
mode : this . _mode ,
222
202
actionPoint,
223
203
actionSelector,
224
- snapshotUrl,
225
204
} ;
226
205
return uiState ;
227
206
} , 'utility' ) ;
@@ -236,8 +215,7 @@ export class RecorderSupplement implements InstrumentationListener {
236
215
this . _debugger . resume ( false ) ;
237
216
} , 'main' ) ;
238
217
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 ( ) } ) ;
241
219
await this . _context . extendInjectedScript ( 'main' , consoleApiSource . source ) ;
242
220
243
221
if ( this . _debugger . isPaused ( ) )
@@ -391,18 +369,9 @@ export class RecorderSupplement implements InstrumentationListener {
391
369
this . _generator . signal ( pageAlias , page . mainFrame ( ) , { name : 'dialog' , dialogAlias : String ( ++ this . _lastDialogOrdinal ) } ) ;
392
370
}
393
371
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
-
402
372
async onBeforeCall ( sdkObject : SdkObject , metadata : CallMetadata ) {
403
373
if ( this . _mode === 'recording' )
404
374
return ;
405
- this . _captureSnapshot ( sdkObject , metadata , 'before' ) ;
406
375
this . _currentCallsMetadata . set ( metadata , sdkObject ) ;
407
376
this . _allMetadatas . set ( metadata . id , metadata ) ;
408
377
this . _updateUserSources ( ) ;
@@ -416,7 +385,6 @@ export class RecorderSupplement implements InstrumentationListener {
416
385
async onAfterCall ( sdkObject : SdkObject , metadata : CallMetadata ) {
417
386
if ( this . _mode === 'recording' )
418
387
return ;
419
- this . _captureSnapshot ( sdkObject , metadata , 'after' ) ;
420
388
if ( ! metadata . error )
421
389
this . _currentCallsMetadata . delete ( metadata ) ;
422
390
this . _updateUserSources ( ) ;
@@ -458,9 +426,6 @@ export class RecorderSupplement implements InstrumentationListener {
458
426
}
459
427
460
428
async onBeforeInputAction ( sdkObject : SdkObject , metadata : CallMetadata ) {
461
- if ( this . _mode === 'recording' )
462
- return ;
463
- this . _captureSnapshot ( sdkObject , metadata , 'action' ) ;
464
429
}
465
430
466
431
async onCallLog ( logName : string , message : string , sdkObject : SdkObject , metadata : CallMetadata ) : Promise < void > {
@@ -479,7 +444,7 @@ export class RecorderSupplement implements InstrumentationListener {
479
444
status = 'in-progress' ;
480
445
if ( this . _debugger . isPaused ( metadata ) )
481
446
status = 'paused' ;
482
- logs . push ( metadataToCallLog ( metadata , status , this . _snapshots ) ) ;
447
+ logs . push ( metadataToCallLog ( metadata , status ) ) ;
483
448
}
484
449
this . _recorderApp ?. updateCallLogs ( logs ) ;
485
450
}
0 commit comments