(code)
| 16 | } |
| 17 | |
| 18 | async executeAsyncScript(code) { |
| 19 | const value = await this._driver.executeAsyncScript( |
| 20 | (id, code, cb) => { |
| 21 | const iframe = document.querySelector(`#${id}`); |
| 22 | Promise.resolve(iframe.contentWindow.eval(code)) |
| 23 | .then((value) => cb(value)) |
| 24 | .catch((err) => cb(err.toString())); |
| 25 | }, |
| 26 | this._id, |
| 27 | code, |
| 28 | ); |
| 29 | |
| 30 | return value; |
| 31 | } |
| 32 | |
| 33 | async wait(code) { |
| 34 | await waitUntil(() => this.executeAsyncScript(code)); |
no test coverage detected