(outPath: string)
| 156 | } |
| 157 | |
| 158 | async screenshot(outPath: string): Promise<void> { |
| 159 | const value = await this.sessionRequest('GET', '/screenshot'); |
| 160 | if (typeof value !== 'string') { |
| 161 | throw new AppError('COMMAND_FAILED', 'WebDriver screenshot response was not base64 text', { |
| 162 | valueType: typeof value, |
| 163 | }); |
| 164 | } |
| 165 | await fs.writeFile(outPath, Buffer.from(value, 'base64')); |
| 166 | } |
| 167 | |
| 168 | async windowRect(): Promise<WebDriverWindowRect> { |
| 169 | return readWindowRect(await this.sessionRequest('GET', '/window/rect')); |