(format: 'bytes' | 'blob' | 'stream' = 'bytes')
| 261 | */ |
| 262 | async screenshot(format: 'stream'): Promise<ReadableStream<Uint8Array>> |
| 263 | async screenshot(format: 'bytes' | 'blob' | 'stream' = 'bytes') { |
| 264 | const path = `/tmp/screenshot-${generateRandomString()}.png` |
| 265 | await this.commands.run(`scrot --pointer ${path}`) |
| 266 | |
| 267 | // @ts-expect-error |
| 268 | const file = await this.files.read(path, { format }) |
| 269 | this.files.remove(path) |
| 270 | return file |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Left click on the mouse position. |
no test coverage detected