@ -279,12 +279,17 @@ function makeRecorder (appAPI, appEvents) {
`
`
recordButton . onclick = ( ) => {
recordButton . onclick = ( ) => {
var txJSON = JSON . stringify ( recorder . getAll ( ) , null , 2 )
var txJSON = JSON . stringify ( recorder . getAll ( ) , null , 2 )
modalDialogCustom . prompt ( null , 'save ran transactions to file (e.g. `scenario.json`)' , 'scenario.json' , input => {
var path = appAPI . currentPath ( )
var newName = appAPI . filesProviders [ 'browser' ] . type + '/' + helper . createNonClashingName ( input , appAPI . filesProviders [ 'browser' ] , '.json' )
modalDialogCustom . prompt ( null , 'save ran transactions to file (e.g. `scenario.json`). The file is goiing to be saved under ' + path , 'scenario.json' , input => {
if ( ! appAPI . filesProviders [ 'browser' ] . set ( newName , txJSON ) ) {
var fileProvider = appAPI . fileProviderOf ( path )
modalDialogCustom . alert ( 'Failed to create file ' + newName )
if ( fileProvider ) {
} else {
input = helper . createNonClashingName ( input , fileProvider , '.json' )
appAPI . switchFile ( newName )
var newFile = path + input
if ( ! fileProvider . set ( newFile , txJSON ) ) {
modalDialogCustom . alert ( 'Failed to create file ' + newFile )
} else {
appAPI . switchFile ( newFile )
}
}
}
} )
} )
}
}