From e6dac085cb1d601da1fc63bfd59d811612fa6ef4 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 8 Oct 2021 12:24:19 +0000 Subject: update composer libs --- .../wdio/test/pages/file-upload.js | 45 ++++++++++++---------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'vendor/blueimp/jquery-file-upload/wdio/test/pages') diff --git a/vendor/blueimp/jquery-file-upload/wdio/test/pages/file-upload.js b/vendor/blueimp/jquery-file-upload/wdio/test/pages/file-upload.js index eccb6feb4..32ba5c39a 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/test/pages/file-upload.js +++ b/vendor/blueimp/jquery-file-upload/wdio/test/pages/file-upload.js @@ -32,42 +32,47 @@ class FileUpload { * Opens the file upload form. * * @param {number} [timeout] Wait timeout - * @returns {FileUpload} FileUpload object */ - open(timeout) { - browser.url('/') - this.fileinput.waitForExist({ timeout }) - return this + async open(timeout) { + await browser.url('/') + await this.fileinput.waitForExist({ timeout }) } /** * Uploads files. * * @param {Array} files Files to upload * @param {number} [timeout] Wait timeout - * @returns {FileUpload} FileUpload object */ - upload(files, timeout) { - this.fileinput.addValue(files.join('\n')) - browser.waitUntil(() => !this.processing.length, { timeout }) - this.start.click() - browser.waitUntil(() => !!this.downloads.length, { timeout }) - browser.waitUntil(() => !this.uploads.length, { timeout }) - return this + async upload(files, timeout) { + await this.fileinput.addValue(files.join('\n')) + await browser.waitUntil(async () => !(await this.processing.length), { + timeout + }) + await this.start.click() + await browser.waitUntil(async () => !!(await this.downloads.length), { + timeout + }) + await browser.waitUntil(async () => !(await this.uploads.length), { + timeout + }) } /** * Deletes uploaded files. * * @param {number} [timeout] Wait timeout - * @returns {FileUpload} FileUpload object */ - delete(timeout) { - this.toggle.click() - browser.waitUntil(() => this.downloads.length === this.checked.length, { + async delete(timeout) { + await this.toggle.click() + await browser.waitUntil( + async () => (await this.downloads.length) === (await this.checked.length), + { + timeout + } + ) + await this.remove.click() + await browser.waitUntil(async () => !(await this.downloads.length), { timeout }) - this.remove.click() - browser.waitUntil(() => !this.downloads.length, { timeout }) - return this } } -- cgit v1.2.3