diff options
Diffstat (limited to 'vendor/blueimp/jquery-file-upload/wdio')
15 files changed, 95 insertions, 35 deletions
diff --git a/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js b/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js index 24237736e..049fe84a3 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js +++ b/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js @@ -1,7 +1,9 @@ 'use strict' module.exports = { + arrowParens: 'avoid', proseWrap: 'always', semi: false, - singleQuote: true + singleQuote: true, + trailingComma: 'none' } diff --git a/vendor/blueimp/jquery-file-upload/wdio/assets/black+white-3x2.jpg b/vendor/blueimp/jquery-file-upload/wdio/assets/black+white-3x2.jpg Binary files differnew file mode 100644 index 000000000..0d7592ae3 --- /dev/null +++ b/vendor/blueimp/jquery-file-upload/wdio/assets/black+white-3x2.jpg diff --git a/vendor/blueimp/jquery-file-upload/wdio/assets/black+white-60x40.gif b/vendor/blueimp/jquery-file-upload/wdio/assets/black+white-60x40.gif Binary files differnew file mode 100644 index 000000000..926fd9276 --- /dev/null +++ b/vendor/blueimp/jquery-file-upload/wdio/assets/black+white-60x40.gif diff --git a/vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gif b/vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gif Binary files differdeleted file mode 100644 index 5814bdaa5..000000000 --- a/vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gif +++ /dev/null diff --git a/vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpg b/vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpg Binary files differdeleted file mode 100644 index 10a3d5492..000000000 --- a/vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpg +++ /dev/null diff --git a/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh b/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh index 829ce9b3b..d6bee1da7 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh +++ b/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh @@ -1,15 +1,27 @@ #!/bin/sh +if [ "$1" = -t ]; then + BIN='/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver' + shift +else + BIN=safaridriver +fi + +SCREEN='Capture screen' + if [ -z "$1" ]; then - echo 'Please select the input device by entering its [index] number:' >&2 - ffmpeg -f avfoundation -list_devices true -i - 2>&1 | grep screen >&2 - read -r INDEX + OUTPUT=$(ffmpeg -f avfoundation -list_devices true -i - 2>&1 | grep "$SCREEN") + if [ "$(echo "$OUTPUT" | grep -c ^)" -gt 1 ]; then + echo 'Please select the input device by entering its [index] number:' >&2 + echo "$OUTPUT" >&2 + read -r INDEX + fi else INDEX=$1 fi echo 'Starting safaridriver on 127.0.0.1:4444 ...' >&2 -safaridriver -p 4444 & pid=$! +"$BIN" -p 4444 & pid=$! # shellcheck disable=SC2064 trap "kill $pid; exit" INT TERM @@ -25,7 +37,7 @@ mjpeg-server -a 127.0.0.1:9000 -- ffmpeg \ -capture_cursor 1 \ -r "${FPS:-15}" \ -pixel_format yuyv422 \ - -i "$INDEX" \ + -i "${INDEX:-$SCREEN}" \ -f mpjpeg \ -q "${QUALITY:-2}" \ - diff --git a/vendor/blueimp/jquery-file-upload/wdio/chrome.js b/vendor/blueimp/jquery-file-upload/wdio/conf/chrome.js index 6d1650e66..270465e9c 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/chrome.js +++ b/vendor/blueimp/jquery-file-upload/wdio/conf/chrome.js @@ -1,6 +1,8 @@ 'use strict' -exports.config = Object.assign({}, require('./hooks'), { +/* eslint-disable jsdoc/valid-types */ +/** @type WebdriverIO.Config */ +const config = { hostname: 'chromedriver', path: '/', capabilities: [ @@ -33,4 +35,6 @@ exports.config = Object.assign({}, require('./hooks'), { }, assetsDir: '/home/webdriver/assets/', baseUrl: 'http://example' -}) +} + +exports.config = Object.assign({}, require('../hooks'), config) diff --git a/vendor/blueimp/jquery-file-upload/wdio/conf/edge.js b/vendor/blueimp/jquery-file-upload/wdio/conf/edge.js new file mode 100644 index 000000000..887294460 --- /dev/null +++ b/vendor/blueimp/jquery-file-upload/wdio/conf/edge.js @@ -0,0 +1,23 @@ +'use strict' + +/* eslint-disable jsdoc/valid-types */ +/** @type WebdriverIO.Config */ +const config = { + hostname: process.env.WINDOWS_HOST || 'host.docker.internal', + capabilities: [ + { + // Set maxInstances to 1 if screen recordings are enabled: + // maxInstances: 1, + browserName: 'MicrosoftEdge' + } + ], + videos: { + enabled: false, + inputFormat: 'mjpeg', + startDelay: 500, + stopDelay: 500 + }, + assetsDir: process.env.WINDOWS_ASSETS_DIR || process.env.MACOS_ASSETS_DIR +} + +exports.config = Object.assign({}, require('./chrome').config, config) diff --git a/vendor/blueimp/jquery-file-upload/wdio/firefox.js b/vendor/blueimp/jquery-file-upload/wdio/conf/firefox.js index ab91dcb79..a4403de9e 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/firefox.js +++ b/vendor/blueimp/jquery-file-upload/wdio/conf/firefox.js @@ -1,6 +1,8 @@ 'use strict' -exports.config = Object.assign({}, require('./chrome').config, { +/* eslint-disable jsdoc/valid-types */ +/** @type WebdriverIO.Config */ +const config = { hostname: 'geckodriver', capabilities: [ { @@ -18,4 +20,6 @@ exports.config = Object.assign({}, require('./chrome').config, { startDelay: 500, stopDelay: 500 } -}) +} + +exports.config = Object.assign({}, require('./chrome').config, config) diff --git a/vendor/blueimp/jquery-file-upload/wdio/ie.js b/vendor/blueimp/jquery-file-upload/wdio/conf/internet-explorer.js index 8fff1161e..223a50190 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/ie.js +++ b/vendor/blueimp/jquery-file-upload/wdio/conf/internet-explorer.js @@ -1,6 +1,8 @@ 'use strict' -exports.config = Object.assign({}, require('./chrome').config, { +/* eslint-disable jsdoc/valid-types */ +/** @type WebdriverIO.Config */ +const config = { hostname: process.env.WINDOWS_HOST || 'host.docker.internal', port: 4445, capabilities: [ @@ -17,4 +19,6 @@ exports.config = Object.assign({}, require('./chrome').config, { stopDelay: 500 }, assetsDir: process.env.WINDOWS_ASSETS_DIR -}) +} + +exports.config = Object.assign({}, require('./chrome').config, config) diff --git a/vendor/blueimp/jquery-file-upload/wdio/safari.js b/vendor/blueimp/jquery-file-upload/wdio/conf/safari.js index 360909b33..d252d0d5d 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/safari.js +++ b/vendor/blueimp/jquery-file-upload/wdio/conf/safari.js @@ -1,6 +1,8 @@ 'use strict' -exports.config = Object.assign({}, require('./chrome').config, { +/* eslint-disable jsdoc/valid-types */ +/** @type WebdriverIO.Config */ +const config = { // Docker for Mac host address: hostname: 'host.docker.internal', capabilities: [ @@ -17,4 +19,6 @@ exports.config = Object.assign({}, require('./chrome').config, { stopDelay: 500 }, assetsDir: process.env.MACOS_ASSETS_DIR -}) +} + +exports.config = Object.assign({}, require('./chrome').config, config) diff --git a/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js b/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js index 9ce5c52fd..f369f5614 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js +++ b/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js @@ -1,21 +1,26 @@ 'use strict' -/* global browser */ +/* global browser, Promise */ const cmds = require('wdio-screen-commands') -module.exports = { - before: () => { - global.should = require('chai').should() +/* eslint-disable jsdoc/valid-types */ +/** @type WebdriverIO.HookFunctions */ +const config = { + before: async () => { browser.addCommand('saveScreenshotByName', cmds.saveScreenshotByName) browser.addCommand('saveAndDiffScreenshot', cmds.saveAndDiffScreenshot) - if (browser.config.maximizeWindow) browser.maximizeWindow() + if (browser.config.maximizeWindow) await browser.maximizeWindow() }, - beforeTest: test => { - cmds.startScreenRecording(test) + beforeTest: async test => { + await cmds.startScreenRecording(test) }, - afterTest: async test => { - await cmds.stopScreenRecording(test) - cmds.saveScreenshotByTest(test) + afterTest: async (test, context, result) => { + await Promise.all([ + cmds.stopScreenRecording(test, result), + cmds.saveScreenshotByTest(test, result) + ]) } } + +module.exports = config 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 dfef36394..eccb6feb4 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 @@ -36,7 +36,7 @@ class FileUpload { */ open(timeout) { browser.url('/') - this.fileinput.waitForExist(timeout) + this.fileinput.waitForExist({ timeout }) return this } /** @@ -48,10 +48,10 @@ class FileUpload { */ upload(files, timeout) { this.fileinput.addValue(files.join('\n')) - browser.waitUntil(() => !this.processing.length, timeout) + browser.waitUntil(() => !this.processing.length, { timeout }) this.start.click() - browser.waitUntil(() => !!this.downloads.length, timeout) - browser.waitUntil(() => !this.uploads.length, timeout) + browser.waitUntil(() => !!this.downloads.length, { timeout }) + browser.waitUntil(() => !this.uploads.length, { timeout }) return this } /** @@ -62,12 +62,11 @@ class FileUpload { */ delete(timeout) { this.toggle.click() - browser.waitUntil( - () => this.downloads.length === this.checked.length, + browser.waitUntil(() => this.downloads.length === this.checked.length, { timeout - ) + }) this.remove.click() - browser.waitUntil(() => !this.downloads.length, timeout) + browser.waitUntil(() => !this.downloads.length, { timeout }) return this } } diff --git a/vendor/blueimp/jquery-file-upload/wdio/test/specs/01-file-upload.js b/vendor/blueimp/jquery-file-upload/wdio/test/specs/01-file-upload.js index 156dcc718..95e77e7d8 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/test/specs/01-file-upload.js +++ b/vendor/blueimp/jquery-file-upload/wdio/test/specs/01-file-upload.js @@ -10,8 +10,8 @@ describe('File Upload', () => { it('uploads files', () => { FileUpload.open().upload([ - assetsDir + 'black-80x60.gif', - assetsDir + 'white-1x2.jpg' + assetsDir + 'black+white-60x40.gif', + assetsDir + 'black+white-3x2.jpg' ]) browser.saveAndDiffScreenshot('Files uploaded') }) diff --git a/vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js b/vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js index eb078d844..b19783d1a 100644 --- a/vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js +++ b/vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js @@ -1 +1,4 @@ -chrome.js
\ No newline at end of file +'use strict' + +// Default to the Chrome config: +exports.config = require('./conf/chrome').config |