WebdriverIO Tutorial | Comprehensive Reporting Tools | Allure, HTML, JSON | Part X | LambdaTest

:rocket: Hey folks! The NEW WebdriverIO Tutorial is LIVE! :tada:

Ready to level up your testing game? Dive into this comprehensive guide and master reporting tools like Allure, HTML, and JSON! :bar_chart::sparkles:

:link: Watch it now and take your automation skills to the next level!

Allure Reporting Allure is a powerful, customizable reporting framework that provides detailed insights into test execution with features like step-by-step results, screenshots, and logs.

Setup: Install the Allure Reporter:

npm install @wdio/allure-reporter allure-commandline --save-dev

Configure the Allure Reporter in wdio.conf.js:

reporters: [
  ['allure', {
    outputDir: 'allure-results',
    disableWebdriverStepsReporting: true,
    disableWebdriverScreenshotsReporting: false,
  }]
],

Generate and view the report:

allure generate allure-results --clean
allure open

Key Features:

  • Interactive, web-based reports.
  • Visual representation of test execution steps and results.
  • Supports attaching screenshots and logs.

The HTML Reporter provides a simple and static report that displays test results in a browser-friendly format.

Setup:

Install the HTML Reporter:

npm install @rpii/wdio-html-reporter --save-dev

Configure the HTML Reporter in wdio.conf.js:

reporters: [
  ['html', {
    outputDir: './reports/html-reports',
    filename: 'report.html',
    reportTitle: 'Test Report',
  }]
]

,

Key Features:

  • Simple and easy-to-read static HTML reports.
  • Displays test results, passed/failed tests, and execution time.
  • Lightweight and does not require a server to view reports.

The JSON Reporter outputs test results in JSON format, which is useful for integration with other tools or custom reporting.

Setup:

Configure the JSON Reporter in wdio.conf.js:

reporters: [
  ['json', {
    outputDir: './reports/json-reports',
    filename: 'report.json',
  }]
],

Key Features:

  • Machine-readable format for further data processing.
  • Useful for integrating with CI/CD pipelines or custom dashboards.
  • Can be transformed into other formats like CSV, XML, or HTML.