code: function saveScreenshotIfExists(testResults) {
          var deferred = Q.defer();
  
          if (testResults.screenshotBuffer) {
  
              var screenshotFilePath = path.join(resultsDir, testResults.runId, resultScreenshotName);
              fs.writeFile(screenshotFilePath, testResults.screenshotBuffer);
  
              delete testResults.screenshotBuffer;
  
          } else {
              deferred.resolve();
          }
  
          return deferred;
      }
docs: If there is a screenshot, save it as screenshot.jpg in the same folder as the results