aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/blueimp/jquery-file-upload/wdio
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/blueimp/jquery-file-upload/wdio')
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh13
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/chrome.js8
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/firefox.js8
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/hooks/index.js24
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/ie.js8
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/safari.js8
6 files changed, 48 insertions, 21 deletions
diff --git a/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh b/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh
index 829ce9b3b..ed9c63e70 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh
+++ b/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh
@@ -1,9 +1,14 @@
#!/bin/sh
+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
@@ -25,7 +30,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/chrome.js
index 6d1650e66..fc7264417 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/chrome.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/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/firefox.js b/vendor/blueimp/jquery-file-upload/wdio/firefox.js
index ab91dcb79..a4403de9e 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/firefox.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/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/hooks/index.js b/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js
index 9ce5c52fd..2f0dcd3f6 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js
@@ -1,21 +1,27 @@
'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.Config */
+const config = {
+ before: async () => {
+ global.Should = require('chai').should()
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)
+ await Promise.all([
+ cmds.stopScreenRecording(test),
+ cmds.saveScreenshotByTest(test)
+ ])
}
}
+
+module.exports = config
diff --git a/vendor/blueimp/jquery-file-upload/wdio/ie.js b/vendor/blueimp/jquery-file-upload/wdio/ie.js
index 8fff1161e..223a50190 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/ie.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/ie.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/safari.js
index 360909b33..d252d0d5d 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/safari.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/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)