(selected)
| 350 | } |
| 351 | |
| 352 | async function recordDetached(selected) { |
| 353 | const projectPath = path.join(runDir, "cli-detached.cap"); |
| 354 | const started = await runCommand("cli-detached-start", capBin, [ |
| 355 | "--log-level", |
| 356 | "debug", |
| 357 | "--json", |
| 358 | "record", |
| 359 | "start", |
| 360 | "--screen", |
| 361 | selected.screenId, |
| 362 | "--path", |
| 363 | projectPath, |
| 364 | "--fps", |
| 365 | "30", |
| 366 | "--detach", |
| 367 | ]); |
| 368 | const event = |
| 369 | findLastEvent(started.stdout, "Started") || |
| 370 | findLastEvent(started.stdout, "started"); |
| 371 | const recordingId = event?.recordingId || event?.recording_id; |
| 372 | if (!recordingId) { |
| 373 | throw new Error( |
| 374 | `Could not read detached recording id from ${started.stdoutPath}`, |
| 375 | ); |
| 376 | } |
| 377 | await sleep(recordingSeconds * 1000); |
| 378 | await runCommand("cli-detached-stop", capBin, [ |
| 379 | "--log-level", |
| 380 | "debug", |
| 381 | "--json", |
| 382 | "record", |
| 383 | "stop", |
| 384 | "--id", |
| 385 | recordingId, |
| 386 | "--timeout", |
| 387 | "60", |
| 388 | ]); |
| 389 | summary.flows.push({ |
| 390 | name: "cli-detached-start-stop", |
| 391 | projectPath, |
| 392 | recordingId, |
| 393 | }); |
| 394 | return projectPath; |
| 395 | } |
| 396 | |
| 397 | async function recordCameraMic(selected) { |
| 398 | const projectPath = path.join(runDir, "cli-screen-camera-mic.cap"); |
no test coverage detected