( interactor: Interactor, positionals: string[], outPath: string | undefined, context: DispatchContext | undefined, )
| 327 | } |
| 328 | |
| 329 | async function handleScreenshotCommand( |
| 330 | interactor: Interactor, |
| 331 | positionals: string[], |
| 332 | outPath: string | undefined, |
| 333 | context: DispatchContext | undefined, |
| 334 | ): Promise<Record<string, unknown>> { |
| 335 | const positionalPath = positionals[0]; |
| 336 | const screenshotPath = positionalPath ?? outPath ?? `./screenshot-${Date.now()}.png`; |
| 337 | await fs.mkdir(pathModule.dirname(screenshotPath), { recursive: true }); |
| 338 | const screenshotOptions = screenshotOptionsFromFlags(context); |
| 339 | await interactor.screenshot(screenshotPath, { |
| 340 | appBundleId: context?.appBundleId, |
| 341 | fullscreen: screenshotOptions.fullscreen, |
| 342 | normalizeStatusBar: screenshotOptions.normalizeStatusBar, |
| 343 | stabilize: screenshotOptions.stabilize, |
| 344 | surface: context?.surface, |
| 345 | skipIosSimulatorBootCheck: context?.skipIosSimulatorBootCheck, |
| 346 | }); |
| 347 | return { path: screenshotPath, ...successText(`Saved screenshot: ${screenshotPath}`) }; |
| 348 | } |
| 349 | |
| 350 | async function handleViewportCommand( |
| 351 | interactor: Interactor, |
no test coverage detected
searching dependent graphs…