How to use the chimp.saveScreenshotsToDisk function in chimp

To help you get started, we’ve selected a few chimp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TheBrainFamily / chimpy / dist / lib / cucumberjs / hooks.js View on Github external
var stepResult = event.getPayloadItem('stepResult');
    lastStep = stepResult.getStep();
    if (shouldTakeScreenshot(stepResult)) {
      log.debug('[chimp][hooks] capturing screenshot');
      if (booleanHelper.isTruthy(process.env['chimp.saveScreenshotsToReport'])) {
        var screenshotId = lastStep.getUri() + ':' + lastStep.getLine();
        // noinspection JSUnresolvedFunction
        screenshots[screenshotId] = {
          keyword: lastStep.getKeyword(),
          name: lastStep.getName(),
          uri: lastStep.getUri(),
          line: lastStep.getLine(),
          png: global.browser.screenshot().value
        };
      }
      if (booleanHelper.isTruthy(process.env['chimp.saveScreenshotsToDisk'])) {
        var affix = stepResult.getStatus() !== 'passed' ? ' (failed)' : '';
        // noinspection JSUnresolvedFunction
        global.browser.captureSync(lastStep.getKeyword() + ' ' + lastStep.getName() + affix);
      }
    }
  });
github TheBrainFamily / chimpy / src / lib / cucumberjs / hooks.js View on Github external
lastStep = stepResult.getStep();
    if (screenshotHelper.shouldTakeScreenshot(stepResult.getStatus())) {
      log.debug('[chimp][hooks] capturing screenshot');
      if (booleanHelper.isTruthy(process.env['chimp.saveScreenshotsToReport'])) {
        const screenshotId = lastStep.getUri() + ':' + lastStep.getLine();
        // noinspection JSUnresolvedFunction
        screenshots[screenshotId] = {
          keyword: lastStep.getKeyword(),
          name: lastStep.getName(),
          uri: lastStep.getUri(),
          line: lastStep.getLine(),
          png: global.browser.screenshot().value,
        };
      }

      if (booleanHelper.isTruthy(process.env['chimp.saveScreenshotsToDisk'])) {
        const affix = stepResult.getStatus() !== 'passed' ? ' (failed)' : '';
        // noinspection JSUnresolvedFunction
        const fileName = lastStep.getKeyword() + ' ' + lastStep.getName() + affix;
        screenshotHelper.saveScreenshotsToDisk(fileName);
      }
    }
  });
github TheBrainFamily / chimpy / src / lib / jasmine / jasmine-wrapper.js View on Github external
specDone: function(result) {
      if (screenshotHelper.shouldTakeScreenshot(result.status)) {
        if (booleanHelper.isTruthy(process.env['chimp.saveScreenshotsToDisk'])) {
          const affix = result.status !== 'passed' ? ' (failed)' : '';
          const fileName = result.fullName + affix;
          screenshotHelper.saveScreenshotsToDisk(fileName, projectDir);
        }
      }
    }
  });