Gathering detailed insights and metrics for @frinzekt/cypress-allure-plugin
Gathering detailed insights and metrics for @frinzekt/cypress-allure-plugin
Gathering detailed insights and metrics for @frinzekt/cypress-allure-plugin
Gathering detailed insights and metrics for @frinzekt/cypress-allure-plugin
cypress plugin to use allure reporter api in tests
npm install @frinzekt/cypress-allure-plugin
Typescript
Module System
Node Version
NPM Version
JavaScript (99.32%)
Gherkin (0.68%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
1 Stars
75 Commits
2 Branches
1 Contributors
Updated on Mar 04, 2023
Latest Version
0.0.1-development
Package Id
@frinzekt/cypress-allure-plugin@0.0.1-development
Unpacked Size
71.47 kB
Size
18.31 kB
File Count
11
NPM Version
6.14.10
Node Version
12.20.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
Plugin for integrating allure reporter in Cypress with support of Allure API.
Allure reporter: java package or allure-commandline npm package.
There is no need to set this plugin as reporter in Cypress or use any other allure reporters. Just download:
1yarn add -D @shelex/cypress-allure-plugin
npm i -D @shelex/cypress-allure-plugin
Connect plugin in cypress/plugins/index.js
in order to add Allure writer task:
1const allureWriter = require('@shelex/cypress-allure-plugin/writer'); 2 3module.exports = (on, config) => { 4 allureWriter(on, config); 5 return config; 6};
1module.exports = (on, config) => { 2 on('file:preprocessor', webpackPreprocessor); 3 allureWriter(on, config); 4 return config; 5};
Register commands in cypress/support/index.js
file:
import
:1import '@shelex/cypress-allure-plugin';
require
:1require('@shelex/cypress-allure-plugin');
for IntelliSense (autocompletion) support in your IDE add on top of your cypress/plugins/index.js
file:
1/// <reference types="@shelex/cypress-allure-plugin" />
1"include": [ 2 "../node_modules/@shelex/cypress-allure-plugin/reporter", 3 "../node_modules/cypress" 4 ]
Plugin is customizable via Cypress environment variables:
env variable name | description | default |
---|---|---|
allure | enable Allure plugin | false |
allureResultsPath | customize path to allure results folder | allure-results |
tmsPrefix | prefix for links from allure API in tests to test management system | `` |
issuePrefix | prefix for links from allure API in tests to bug tracking system | `` |
allureLogCypress | log cypress chainer (commands) and display them as steps in report | true |
allureOmitPreviousAttemptScreenshots | omit screenshots attached in previous attempts when retries are used | false |
This options could be passed:
via cypress.json
1{ 2 "env": { 3 "allureResultsPath": "someFolder/results", 4 "tmsPrefix": "https://url-to-bug-tracking-system/task-", 5 "issuePrefix": "https://url-to-tms/tests/caseId-" 6 // usage: cy.allure().issue('blockerIssue', 'AST-111') 7 // result: https://url-to-bug-tracking-system/task-AST-111 8 } 9}
via command line
:
1yarn cypress run --env allure=true,allureResultsPath=someFolder/results
via Cypress environment variables
:
1Cypress.env('issuePrefix', 'url_to_bug_tracker');
be sure your docker or local browser versions are next: Chrome 71+, Edge 79+. Firefox 65+
plugin might not be applied to older Cypress versions, 4+ is recommended
to enable Allure results writing just pass environment variable allure=true
, example:
1npx cypress run --env allure=true
1Cypress.Allure.reporter.runtime.writer;
See cypress-allure-plugin-example project, which is already configured to use this plugin, hosting report as github page and run by github action. It has configuration for basic allure history saving (just having numbers and statuses in trends and history).
For complete history (allure can display 20 build results ) with links to older reports and links to CI builds check cypress-allure-historical-example with basic and straightforward idea how to achieve it.
There are also existing solutions that may help you prepare your report infrastructure:
Assuming allure is already installed:
allure serve
allure generate
allure open
There are three options of using allure api inside tests:
Cypress.Allure.reporter.getInterface()
- synchronous1const allure = Cypress.Allure.reporter.getInterface(); 2allure.feature('This is our feature'); 3allure.epic('This is epic'); 4allure.issue('google', 'https://google.com');
cy.allure()
- chainer1cy.allure() 2 .feature('This is feature') 3 .epic('This is epic') 4 .issue('google', 'https://google.com') 5 .parameter('name', 'value') 6 .tag('this is nice tag');
1@subSuite("someSubSuite") 2@feature("nice") 3@epic("thisisepic") 4@story("cool") 5@severity("critical") 6@owner("IAMOwner") 7@issue("jira","PJD:1234") 8@someOtherTagsWillBeAddedAlso 9Scenario: Here is scenario 10...
Allure API available:
In case you are using VS Code and Cypress Helper extension, it has configuration for allure cucumber tags autocompletion available:
1"cypressHelper.cucumberTagsAutocomplete": { 2 "enable": true, 3 "allurePlugin": true, 4 "tags": ["focus", "someOtherTag"] 5 }
Screenshots are attached automatically, for other type of content feel free to use testAttachment
(for current test), attachment
(for current executable), fileAttachment
(for existing file).
Videos are attached for failed tests only from path specified in cypress config videosFolder
and in case you have not passed video=false to Cypress configuration.
Please take into account, that in case spec files have same name, cypress is trying to create subfolders in videos folder, and it is not handled from plugin unfortunately, so video may not have correct path in such edge case.
Commands are producing allure steps automatically based on cypress events and are trying to represent how code and custom commands are executed with nested structure.
Moreover, steps functionality could be expanded with:
cy.allure().step('name')
- will create step "name" for current test. This step will be finished when next step is created or test is finished.cy.allure().step('name', false)
- will create step "name" for current parent step (like previous one, without passing false
as second argument) or current hook/test. Will be finished when next step is created or test finished.cy.allure().startStep('name')
- will create step "name" for current cypress command step / current step / current parent step / current hook or test. Is automatically finished on fail event or test end, but I would recommend to explicitly mention cy.allure().endStep()
which will finish last created step.yarn test:prepare:basic
- generate allure results for tests in cypress/integration/basic
folderyarn test:prepare:cucumber
- generate allure results for tests in cypress/integration/cucumber
foldertest
- run tests from cypress/integration/results
against these allure resultsA lot of respect to Sergey Korol who made Allure-mocha reporter. Major part of interaction from mocha to allure is based on that solution technically and ideologically.
Copyright 2020 Oleksandr Shevtsov ovr.shevtsov@gmail.com.
This project is licensed under the Apache 2.0 License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
76 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More