(text: string)
| 1384 | } |
| 1385 | |
| 1386 | async function simulatePaste(text: string): Promise<string> { |
| 1387 | const id = Math.floor(Math.random() * 1000000); |
| 1388 | await ctx.page.evaluate(` |
| 1389 | (function() { |
| 1390 | window.term.onData(e => window.result_${id} = e); |
| 1391 | const clipboardData = new DataTransfer(); |
| 1392 | clipboardData.setData('text/plain', '${text}'); |
| 1393 | window.term.textarea.dispatchEvent(new ClipboardEvent('paste', { clipboardData })); |
| 1394 | })(); |
| 1395 | `); |
| 1396 | return await ctx.page.evaluate(`window.result_${id} `); |
| 1397 | } |
| 1398 | |
| 1399 | async function getCursor(): Promise<{ col: number, row: number }> { |
| 1400 | return ctx.page.evaluate(` |
no test coverage detected