diff --git a/lib/Page.js b/lib/Page.js index 4aac20be6f8..6ec9ca6bb1a 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -570,6 +570,11 @@ class Page extends EventEmitter { return this.mainFrame().waitFor(selector); } + /** + * @param {string} selector + * @param {!Array} filePaths + * @return {!Promise} + */ async uploadFile(selector, ...filePaths) { await this._client.send('DOM.setFileInputFiles', { nodeId: await this._querySelector(selector), diff --git a/phantom_shim/WebPage.js b/phantom_shim/WebPage.js index 922638a5fac..cd9e3ed1b9c 100644 --- a/phantom_shim/WebPage.js +++ b/phantom_shim/WebPage.js @@ -334,7 +334,7 @@ class WebPage { /** * @param {string} selector - * @param {string|!Array} files + * @param {(string|!Array)} files */ uploadFile(selector, files) { if (typeof files === 'string')