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/.prettierrc.js4
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gifbin0 -> 108 bytes
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpgbin0 -> 713 bytes
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh9
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/chrome.js40
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/firefox.js25
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/hooks/index.js9
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/ie.js24
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/safari.js24
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/test/pages/file-upload.js15
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/test/specs/01-file-upload.js4
-rw-r--r--vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js5
12 files changed, 131 insertions, 28 deletions
diff --git a/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js b/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js
index 049fe84a3..24237736e 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/.prettierrc.js
@@ -1,9 +1,7 @@
'use strict'
module.exports = {
- arrowParens: 'avoid',
proseWrap: 'always',
semi: false,
- singleQuote: true,
- trailingComma: 'none'
+ singleQuote: true
}
diff --git a/vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gif b/vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gif
new file mode 100644
index 000000000..5814bdaa5
--- /dev/null
+++ b/vendor/blueimp/jquery-file-upload/wdio/assets/black-80x60.gif
Binary files differ
diff --git a/vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpg b/vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpg
new file mode 100644
index 000000000..10a3d5492
--- /dev/null
+++ b/vendor/blueimp/jquery-file-upload/wdio/assets/white-1x2.jpg
Binary files differ
diff --git a/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh b/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh
index d6bee1da7..ed9c63e70 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh
+++ b/vendor/blueimp/jquery-file-upload/wdio/bin/safaridriver.sh
@@ -1,12 +1,5 @@
#!/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
@@ -21,7 +14,7 @@ else
fi
echo 'Starting safaridriver on 127.0.0.1:4444 ...' >&2
-"$BIN" -p 4444 & pid=$!
+safaridriver -p 4444 & pid=$!
# shellcheck disable=SC2064
trap "kill $pid; exit" INT TERM
diff --git a/vendor/blueimp/jquery-file-upload/wdio/chrome.js b/vendor/blueimp/jquery-file-upload/wdio/chrome.js
new file mode 100644
index 000000000..fc7264417
--- /dev/null
+++ b/vendor/blueimp/jquery-file-upload/wdio/chrome.js
@@ -0,0 +1,40 @@
+'use strict'
+
+/* eslint-disable jsdoc/valid-types */
+/** @type WebdriverIO.Config */
+const config = {
+ hostname: 'chromedriver',
+ path: '/',
+ capabilities: [
+ {
+ // Set maxInstances to 1 if screen recordings are enabled:
+ // maxInstances: 1,
+ browserName: 'chrome',
+ 'goog:chromeOptions': {
+ // Disable headless mode if screen recordings are enabled:
+ args: ['--headless', '--window-size=1440,900']
+ }
+ }
+ ],
+ logLevel: 'warn',
+ reporters: ['spec'],
+ framework: 'mocha',
+ mochaOpts: {
+ timeout: 60000
+ },
+ specs: ['test/specs/**/*.js'],
+ maximizeWindow: true,
+ screenshots: {
+ saveOnFail: true
+ },
+ videos: {
+ enabled: false,
+ resolution: '1440x900',
+ startDelay: 500,
+ stopDelay: 500
+ },
+ 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
new file mode 100644
index 000000000..a4403de9e
--- /dev/null
+++ b/vendor/blueimp/jquery-file-upload/wdio/firefox.js
@@ -0,0 +1,25 @@
+'use strict'
+
+/* eslint-disable jsdoc/valid-types */
+/** @type WebdriverIO.Config */
+const config = {
+ hostname: 'geckodriver',
+ capabilities: [
+ {
+ // geckodriver supports no parallel sessions:
+ maxInstances: 1,
+ browserName: 'firefox',
+ 'moz:firefoxOptions': {
+ //args: ['-headless', '--window-size=1440,900']
+ }
+ }
+ ],
+ videos: {
+ enabled: true,
+ resolution: '1440x900',
+ 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 f369f5614..2f0dcd3f6 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js
@@ -5,9 +5,10 @@
const cmds = require('wdio-screen-commands')
/* eslint-disable jsdoc/valid-types */
-/** @type WebdriverIO.HookFunctions */
+/** @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) await browser.maximizeWindow()
@@ -15,10 +16,10 @@ const config = {
beforeTest: async test => {
await cmds.startScreenRecording(test)
},
- afterTest: async (test, context, result) => {
+ afterTest: async test => {
await Promise.all([
- cmds.stopScreenRecording(test, result),
- cmds.saveScreenshotByTest(test, result)
+ cmds.stopScreenRecording(test),
+ cmds.saveScreenshotByTest(test)
])
}
}
diff --git a/vendor/blueimp/jquery-file-upload/wdio/ie.js b/vendor/blueimp/jquery-file-upload/wdio/ie.js
new file mode 100644
index 000000000..223a50190
--- /dev/null
+++ b/vendor/blueimp/jquery-file-upload/wdio/ie.js
@@ -0,0 +1,24 @@
+'use strict'
+
+/* eslint-disable jsdoc/valid-types */
+/** @type WebdriverIO.Config */
+const config = {
+ hostname: process.env.WINDOWS_HOST || 'host.docker.internal',
+ port: 4445,
+ capabilities: [
+ {
+ // IEDriverServer supports no parallel sessions:
+ maxInstances: 1,
+ browserName: 'internet explorer'
+ }
+ ],
+ videos: {
+ enabled: true,
+ inputFormat: 'mjpeg',
+ startDelay: 500,
+ 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
new file mode 100644
index 000000000..d252d0d5d
--- /dev/null
+++ b/vendor/blueimp/jquery-file-upload/wdio/safari.js
@@ -0,0 +1,24 @@
+'use strict'
+
+/* eslint-disable jsdoc/valid-types */
+/** @type WebdriverIO.Config */
+const config = {
+ // Docker for Mac host address:
+ hostname: 'host.docker.internal',
+ capabilities: [
+ {
+ // safaridriver supports no parallel sessions:
+ maxInstances: 1,
+ browserName: 'safari'
+ }
+ ],
+ videos: {
+ enabled: true,
+ inputFormat: 'mjpeg',
+ startDelay: 500,
+ 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/test/pages/file-upload.js b/vendor/blueimp/jquery-file-upload/wdio/test/pages/file-upload.js
index eccb6feb4..dfef36394 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,11 +62,12 @@ 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 95e77e7d8..156dcc718 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+white-60x40.gif',
- assetsDir + 'black+white-3x2.jpg'
+ assetsDir + 'black-80x60.gif',
+ assetsDir + 'white-1x2.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 b19783d1a..eb078d844 100644
--- a/vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js
+++ b/vendor/blueimp/jquery-file-upload/wdio/wdio.conf.js
@@ -1,4 +1 @@
-'use strict'
-
-// Default to the Chrome config:
-exports.config = require('./conf/chrome').config
+chrome.js \ No newline at end of file