Allure Cypress configuration
The Allure Cypress adapter behavior can be affected by some configuration options set in your Cypress configuration file, e.g., cypress.config.ts
.
The configuration options must be defined in the object passed to allureCypress()
as the second argument. For example:
JavaScriptconst { defineConfig } = require("cypress");
const { allureCypress } = require("allure-cypress/reporter");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
allureCypress(on, {
resultsDir: "./allure-results",
links: [
{ type: "issue", urlTemplate: "https://issues.example.com/%s" },
{ type: "tms", urlTemplate: "https://tms.example.com/%s" },
],
});
},
},
});
resultsDir
Path to the directory where Allure Cypress will save the test results, see How it works. If the directory does not exist, it will be created. Defaults to allure-results
.
links
Patterns that can be used to construct full URLs from short identifiers, see the reference.
Each item of the links
list must be an object with a type
and a urlTemplate
that will be used to construct URLs for the type. The template must include the %s
placeholder. It will be replaced with the original short identifier.
For example, with the configuration above, allure.issue("AUTH-123")
will produce a link leading to https://issues.example.com/AUTH-123
. Allure will display the link with the appropriate icon for the issue
type.