Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@codeceptjs/allure-legacy
Advanced tools
Allure plugin for CodeceptJS via allure-commons v1
Warning This plugin was deprecated in CodeceptJS as to allure-commons v1 was not maintained anymore. Documentation and source code was moved into this repository. At this moment we don't plan to migrate it to Allure v2 but community can create their own implementations
Enables Allure reporter.
To start please install allure-commandline
package (which requires Java 8)
npm install -g allure-commandline --save-dev
Add this plugin to config file:
plugins: {
allure: {
enabled: true,
require: '@codeceptjs/allure-legacy',
}
}
By default, allure reports are saved to output
directory.
Launch Allure server and see the report like on a screenshot above:
allure serve output
outputDir
- a directory where allure reports should be stored. Standard output directory is set by default.enableScreenshotDiffPlugin
- a boolean flag for add screenshot diff to report.
To attach, tou need to attach three files to the report - "diff.png", "actual.png", "expected.png".
See Allure Screenshot PluginThere are few public API methods which can be accessed from other plugins.
const allure = codeceptjs.container.plugins('allure');
allure
object has following methods:
addAttachment(name, buffer, type)
- add an attachment to current test / suiteaddLabel(name, value)
- adds a label to current testaddParameter(kind, name, value)
- adds a parameter to current testcreateStep(name, stepFunc)
- create a step, stepFunc could consist an attachment
Example of usage: allure.createStep('New created step', () => {
allure.addAttachment(
'Request params',
'{"clientId":123, "name":"Tom", "age":29}',
'application/json'
);
});
addScreenDiff(name, expectedImg, actualImg, diffImg)
- add a special screen diff block to the current test case
image must be a string representing the contents of the expected image file encoded in base64
Example of usage:const expectedImg = fs.readFileSync('expectedImg.png', { encoding: 'base64' });
...
allure.addScreenDiff('Screen Diff', expectedImg, actualImg, diffImg);
severity(value)
- adds severity labelepic(value)
- adds epic labelfeature(value)
- adds feature labelstory(value)
- adds story labelissue(value)
- adds issue labelsetDescription(description, type)
- sets a descriptionAdd an attachment to the current test case
name
[string][1] Name of the attachmentbuffer
[Buffer][2] Buffer of the attachmenttype
[string][1] MIME type of the attachmentAdds a label with the given name and value to the current test in the Allure report
name
[string][1] name of the label to addvalue
[string][1] value of the label to addAdds a parameter with the given kind, name, and value to the current test in the Allure report
kind
[string][1] kind of the parameter to addname
[string][1] name of the parameter to addvalue
[string][1] value of the parameter to addAdd a special screen diff block to the current test case
name
[string][1] Name of the screen diff blockexpectedImg
[string][1] string representing the contents of the expected image file encoded in base64actualImg
[string][1] string representing the contents of the actual image file encoded in base64diffImg
[string][1] string representing the contents of the diff image file encoded in base64.
Could be generated by image comparison lib like "pixelmatch" or alternativeA method for creating a step in a test case.
name
[string][1] The name of the step.stepFunc
[Function][3] The function that should be executed for this step. (optional, default ()=>{}
)Returns any The result of the step function.
Set description for the current test case
description
[string][1] Description for the test casetype
[string][1] MIME type of the description (optional, default 'text/plain'
)Allure reporter
![][4]
config
Creates an instance of the allure reporter
config
Config Configuration for the allure reporter (optional, default {outputDir:global.output_dir}
)Returns [Object][9] Instance of the allure reporter
FAQs
Allure plugin for CodeceptJS
The npm package @codeceptjs/allure-legacy receives a total of 18,066 weekly downloads. As such, @codeceptjs/allure-legacy popularity was classified as popular.
We found that @codeceptjs/allure-legacy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.