Allure WebdriverIO configuration

The Allure WebdriverIO adapter behavior can be affected by some configuration options set in your project's wdio.conf.js file.

To set the options, define an object after the "allure" string in the reporters configuration section. For example:

TypeScript
import * as os from "os"; export const config = { // ... reporters: [ "spec", [ "allure", { outputDir: "allure-results", issueLinkTemplate: "https://issues.example.com/{}", tmsLinkTemplate: "https://tms.example.com/{}", reportedEnvironmentVars: { os_platform: os.platform(), os_release: os.release(), os_version: os.version(), node_version: process.version, }, }, ], ], };

Common parameters

issueLinkTemplate, tmsLinkTemplate

Define templates that can be used to construct full URLs from short identifiers, see reference. The pattern must contain {} at the position where the identifier should be placed.

outputDir

Path to the directory where Allure WebdriverIO will save the test results, see How it works. If the directory does not exist, it will be created. Defaults to allure-results.

reportedEnvironmentVars

Key-value pairs that will be displayed on the report's main page, see Environment information.

Steps and attachments

addConsoleLogs

If true, Allure WebdriverIO will automatically create an attachment containing all the console output produced by the test, i.e., all the messages passed to console.log().

disableWebdriverScreenshotsReporting

If true, Allure WebdriverIO will not automatically create an attachment with each screenshot taken via the WebdriverIO's saveScreenshot() function.

Note that you can always add screenshots manually by passing their file paths to Allure's attach().

disableWebdriverStepsReporting

If true, Allure WebdriverIO will not automatically create steps for each WebDriver command.

Runner-specific parameters

disableMochaHooks

This option is only relevant if you use the Mocha test runner.

If true, Allure WebdriverIO will not add Mocha hooks to the test report.

useCucumberStepReporter

This option is only relevant if you use the Cucumber.js test runner.

  • If false (or omitted), each Gherkin step will be displayed as a separate test. Allure will group together steps from the same Gherkin feature and scenario by default. You can move individual steps to other locations in the hierarchies by calling the corresponding functions, see Behavior-based hierarchy and Suite-based hierarchy.

    Note that if you use Scenario Outline to perform the same steps with different values, this may result in multiple steps with identical names in the test report. It is recommended to sort tests by order of execution when viewing such a report.

    Also note that with this option, Allure WebdriverIO does not support setting issue links and TMS links via Gherkin tags.

  • If true, Allure will treat each Gherkin scenario as a test, with Gherkin steps displayed as test steps. If your step definition calls the allureReporter.step() function, it will create a sub-step within the current step.

    Note that if you use Scenario Outline to perform the same steps with different values, Allure WebdriverIO will not be able to report it properly with this option turned on. Instead, the test report will only display the steps executed with the last set of values.

Powered by
logo

Join our newsletter

Join our community

We aim to make Allure Report as reliable and user-friendly as possible, and together with the community, we're here to help when problems arise.

© 2024 Qameta Software Inc. All rights reserved.