'use strict'

/* global browser */

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

module.exports = {
  before: () => {
    global.should = require('chai').should()
    browser.addCommand('saveScreenshotByName', cmds.saveScreenshotByName)
    browser.addCommand('saveAndDiffScreenshot', cmds.saveAndDiffScreenshot)
    if (browser.config.maximizeWindow) browser.maximizeWindow()
  },
  beforeTest: test => {
    cmds.startScreenRecording(test)
  },
  afterTest: async test => {
    await cmds.stopScreenRecording(test)
    cmds.saveScreenshotByTest(test)
  }
}

@@ -24,16 +24,25 @@
  browser
+, Promise
  */%0A%0Acon
@@ -88,22 +88,91 @@
 ')%0A%0A
-module.exports
+/* eslint-disable jsdoc/valid-types */%0A/** @type WebdriverIO.Config */%0Aconst config
  = %7B
@@ -181,16 +181,22 @@
  before:
+ async
  () =%3E %7B
@@ -207,17 +207,17 @@
  global.
-s
+S
 hould = 
@@ -429,16 +429,22 @@
 eWindow)
+ await
  browser
@@ -479,16 +479,22 @@
 oreTest:
+ async
  test =%3E
@@ -496,24 +496,30 @@
 st =%3E %7B%0A    
+await 
 cmds.startSc
@@ -578,24 +578,44 @@
 %7B%0A    await 
+Promise.all(%5B%0A      
 cmds.stopScr
@@ -632,17 +632,20 @@
 ng(test)
-%0A
+,%0A  
     cmds
@@ -678,8 +678,40 @@
 )%0A  
-%7D%0A%7D
+  %5D)%0A  %7D%0A%7D%0A%0Amodule.exports = config
 %0A

Update hooks for latest wdio-screen-commands.