@@ -48,6 +48,7 @@ export class Response {
4848 private _includeSnapshot : 'none' | 'full' | 'incremental' = 'none' ;
4949 private _includeSnapshotFileName : string | undefined ;
5050 private _includeSnapshotSelector : string | undefined ;
51+ private _includeSnapshotDepth : number | undefined ;
5152 private _isClose : boolean = false ;
5253
5354 readonly toolName : string ;
@@ -127,9 +128,10 @@ export class Response {
127128 this . _includeSnapshot = this . _context . config . snapshot ?. mode || 'incremental' ;
128129 }
129130
130- setIncludeFullSnapshot ( includeSnapshotFileName ?: string , selector ?: string ) {
131+ setIncludeFullSnapshot ( includeSnapshotFileName ?: string , selector ?: string , depth ?: number ) {
131132 this . _includeSnapshot = 'full' ;
132133 this . _includeSnapshotFileName = includeSnapshotFileName ;
134+ this . _includeSnapshotDepth = depth ;
133135 this . _includeSnapshotSelector = selector ;
134136 }
135137
@@ -195,7 +197,7 @@ export class Response {
195197 addSection ( 'Ran Playwright code' , this . _code , 'js' ) ;
196198
197199 // Render tab titles upon changes or when more than one tab.
198- const tabSnapshot = this . _context . currentTab ( ) ? await this . _context . currentTabOrDie ( ) . captureSnapshot ( this . _includeSnapshotSelector , this . _clientWorkspace ) : undefined ;
200+ const tabSnapshot = this . _context . currentTab ( ) ? await this . _context . currentTabOrDie ( ) . captureSnapshot ( this . _includeSnapshotSelector , this . _includeSnapshotDepth , this . _clientWorkspace ) : undefined ;
199201 const tabHeaders = await Promise . all ( this . _context . tabs ( ) . map ( tab => tab . headerSnapshot ( ) ) ) ;
200202 if ( this . _includeSnapshot !== 'none' || tabHeaders . some ( header => header . changed ) ) {
201203 if ( tabHeaders . length !== 1 )
0 commit comments