(button, timeout = 8000)
| 1822 | } |
| 1823 | |
| 1824 | async function waitForButtonEnabled(button, timeout = 8000) { |
| 1825 | const start = Date.now(); |
| 1826 | while (Date.now() - start < timeout) { |
| 1827 | throwIfStopped(); |
| 1828 | if (isButtonEnabled(button)) return; |
| 1829 | await sleep(150); |
| 1830 | } |
| 1831 | throw new Error('“继续”按钮长时间不可点击。URL: ' + location.href); |
| 1832 | } |
| 1833 | |
| 1834 | function isButtonEnabled(button) { |
| 1835 | return Boolean(button) |
no test coverage detected