How to use the @wdio/allure-reporter.addArgument function in @wdio/allure-reporter

To help you get started, we’ve selected a few @wdio/allure-reporter 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 presidenten / wdio-video-reporter / src / index.js View on Github external
onTestEnd (test) {
    this.testnameStructure.pop();

    if(config.usingAllure) {
      if (browser.capabilities.deviceType) {
        allureReporter.addArgument('deviceType', browser.capabilities.deviceType);
      }
      if (browser.capabilities.browserVersion) {
        allureReporter.addArgument('browserVersion', browser.capabilities.browserVersion);
      }
    }

    if (test.state === 'failed' || (test.state === 'passed' && config.saveAllVideos)) {
      const filePath = path.resolve(this.recordingPath, this.frameNr.toString().padStart(4, '0') + '.png');
      try {
        browser.saveScreenshot(filePath);
        helpers.debugLog('- Screenshot!!\n');
      } catch (e) {
        fs.writeFile(filePath, notAvailableImage, 'base64');
        helpers.debugLog('- Screenshot not available...\n');
      }
github presidenten / wdio-video-reporter / src / index.js View on Github external
onTestEnd (test) {
    this.testnameStructure.pop();

    if(config.usingAllure) {
      if (browser.capabilities.deviceType) {
        allureReporter.addArgument('deviceType', browser.capabilities.deviceType);
      }
      if (browser.capabilities.browserVersion) {
        allureReporter.addArgument('browserVersion', browser.capabilities.browserVersion);
      }
    }

    if (test.state === 'failed' || (test.state === 'passed' && config.saveAllVideos)) {
      const filePath = path.resolve(this.recordingPath, this.frameNr.toString().padStart(4, '0') + '.png');
      try {
        browser.saveScreenshot(filePath);
        helpers.debugLog('- Screenshot!!\n');
      } catch (e) {
        fs.writeFile(filePath, notAvailableImage, 'base64');
        helpers.debugLog('- Screenshot not available...\n');
      }

      const videoPath = path.resolve(config.outputDir, this.testname + '.mp4');
      this.videos.push(videoPath);
github presidenten / wdio-video-reporter / src / frameworks / cucumber.js View on Github external
onSuiteEnd (suite) {
    if (config.usingAllure) {
      if (browser.capabilities.deviceType) {
        allureReporter.addArgument('deviceType', browser.capabilities.deviceType);
      }
      if (browser.capabilities.browserVersion) {
        allureReporter.addArgument('browserVersion', browser.capabilities.browserVersion);
      }
    }

    if (suite.type === 'scenario') {
      const hasFailedTests = suite.tests.filter(test => test.state === 'failed').length > 0;
      const allTestsPassed = suite.tests.filter(test => test.state === 'failed').length === 0;

      if (hasFailedTests || (allTestsPassed && config.saveAllVideos)) {
        const filePath = path.resolve(this.recordingPath, this.frameNr.toString().padStart(4, '0') + '.png');
        try {
          browser.saveScreenshot(filePath);
          helpers.debugLog('- Screenshot!!\n');
        } catch (e) {
github presidenten / wdio-video-reporter / src / frameworks / cucumber.js View on Github external
onSuiteEnd (suite) {
    if (config.usingAllure) {
      if (browser.capabilities.deviceType) {
        allureReporter.addArgument('deviceType', browser.capabilities.deviceType);
      }
      if (browser.capabilities.browserVersion) {
        allureReporter.addArgument('browserVersion', browser.capabilities.browserVersion);
      }
    }

    if (suite.type === 'scenario') {
      const hasFailedTests = suite.tests.filter(test => test.state === 'failed').length > 0;
      const allTestsPassed = suite.tests.filter(test => test.state === 'failed').length === 0;

      if (hasFailedTests || (allTestsPassed && config.saveAllVideos)) {
        const filePath = path.resolve(this.recordingPath, this.frameNr.toString().padStart(4, '0') + '.png');
        try {
          browser.saveScreenshot(filePath);
          helpers.debugLog('- Screenshot!!\n');
        } catch (e) {
          fs.writeFile(filePath, notAvailableImage, 'base64');
          helpers.debugLog('- Screenshot not available...\n');
        }

@wdio/allure-reporter

A WebdriverIO reporter plugin to create Allure Test Reports

MIT
Latest version published 3 days ago

Package Health Score

98 / 100
Full package analysis