aboutsummaryrefslogblamecommitdiffstats
path: root/vendor/blueimp/jquery-file-upload/wdio/hooks/index.js
blob: 2f0dcd3f635fe85714061e279632d917008bdb43 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

            
                             


                                            
                                      
                               

                       
                                            

                                                                           
                                                                     
    

                                         
    
                            
                       

                                     
      

   

                       
'use strict'

/* global browser, Promise */

const cmds = require('wdio-screen-commands')

/* 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) await browser.maximizeWindow()
  },
  beforeTest: async test => {
    await cmds.startScreenRecording(test)
  },
  afterTest: async test => {
    await Promise.all([
      cmds.stopScreenRecording(test),
      cmds.saveScreenshotByTest(test)
    ])
  }
}

module.exports = config