diff options
Diffstat (limited to 'vendor/blueimp/jquery-file-upload/wdio/hooks/index.js')
-rw-r--r-- | vendor/blueimp/jquery-file-upload/wdio/hooks/index.js | 24 |
1 files changed, 15 insertions, 9 deletions
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 |