feat: return interpretationInfo from executeResult
This commit is contained in:
@@ -274,7 +274,7 @@ async function executeRun(id: string) {
|
|||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
error: 'Run not found'
|
error: 'Run not found'
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const plainRun = run.toJSON();
|
const plainRun = run.toJSON();
|
||||||
@@ -284,7 +284,7 @@ async function executeRun(id: string) {
|
|||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
error: 'Recording not found'
|
error: 'Recording not found'
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
plainRun.status = 'running';
|
plainRun.status = 'running';
|
||||||
@@ -300,7 +300,8 @@ async function executeRun(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const interpretationInfo = await browser.interpreter.InterpretRecording(
|
const interpretationInfo = await browser.interpreter.InterpretRecording(
|
||||||
recording.recording, currentPage, plainRun.interpreterSettings);
|
recording.recording, currentPage, plainRun.interpreterSettings
|
||||||
|
);
|
||||||
|
|
||||||
await destroyRemoteBrowser(plainRun.browserId);
|
await destroyRemoteBrowser(plainRun.browserId);
|
||||||
|
|
||||||
@@ -313,11 +314,18 @@ async function executeRun(id: string) {
|
|||||||
serializableOutput: interpretationInfo.serializableOutput,
|
serializableOutput: interpretationInfo.serializableOutput,
|
||||||
binaryOutput: interpretationInfo.binaryOutput,
|
binaryOutput: interpretationInfo.binaryOutput,
|
||||||
});
|
});
|
||||||
return true;
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
interpretationInfo,
|
||||||
|
};
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
logger.log('info', `Error while running a recording with id: ${id} - ${error.message}`);
|
logger.log('info', `Error while running a recording with id: ${id} - ${error.message}`);
|
||||||
console.log(error.message);
|
return {
|
||||||
return false;
|
success: false,
|
||||||
|
error: error.message,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user