diff --git a/lib/Input.js b/lib/Input.js index a0789b1e160..5911afe3a02 100644 --- a/lib/Input.js +++ b/lib/Input.js @@ -224,11 +224,20 @@ class Mouse { */ async click(x, y, options = {}) { const {delay = null} = options; - this.move(x, y); - this.down(options); - if (delay !== null) + if (delay !== null) { + await Promise.all([ + this.move(x, y), + this.down(options), + ]); await new Promise(f => setTimeout(f, delay)); - await this.up(options); + await this.up(options); + } else { + await Promise.all([ + this.move(x, y), + this.down(options), + this.up(options), + ]); + } } /**