Installations
npm install yachr
Developer
yachr
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
8.12.0
NPM Version
6.4.1
Statistics
1 Stars
144 Commits
3 Watching
17 Branches
2 Contributors
Updated on 06 Oct 2020
Languages
TypeScript (68.83%)
HTML (21.49%)
Gherkin (5.24%)
Python (3.37%)
Shell (0.58%)
JavaScript (0.49%)
Total Downloads
Cumulative downloads
Total Downloads
9,082
Last day
-66.7%
1
Compared to previous day
Last week
-48.3%
46
Compared to previous week
Last month
31.2%
282
Compared to previous month
Last year
45.2%
2,363
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
YACHR
Note: This library is under development, there are several features outstanding.
Feel free to use it or trial it, pull requests and issues are welcome, and will be addressed as time allows.
Yet another cucumber html reporter is a simple html reporter that runs off the standard json file produced by cucumberjs.
This reporter targets cucumberjs 3.
How to use
Install yachr either as a global or dev dependency to your project:
1npm install yachr --global
To run yachr stand alone, create a js file (eg runReport.js
) with the following contents:
1var yachr = require("yachr"); 2var reporter = new yachr.Reporter(); 3 4reporter.generate({ 5 jsonFile: 'e2e-reports/results.json', // Location of the output from running cucumberjs 6 output: 'e2e-reports/yachr.html' 7});
Then execute it with node:
1node ./runReport.js
This script can then be used through your projects npm scripts:
1{ 2 "scripts": [ 3 ..., 4 "cucumber": "...", 5 "postCucumber": "node ./runReport" 6 ... 7 ] 8}
Or if you're using it with a library like protractor, it can be included in the tear down script directly:
In protractor.conf.js
1exports.config = { 2 ..., 3 onCleanUp: () => { 4 var yachr = require("yachr"); 5 var reporter = new yachr.Reporter(); 6 7 reporter.generate({ 8 jsonFile: 'e2e-reports/results.json', // Location of the output from running cucumberjs 9 output: 'e2e-reports/yachr.html' 10 }); 11 } 12 ... 13}
Sample Output
Custom Templates
yachr makes use of handlebarsjs for its templating. If there is a particular look you are going for, you can include a custom html file in your repo, and pass it in as a parameter.
Feel free to contribute it back to the project if you think the community could benefit from it. :wink:
A good place to start is looking at the default template
The data model supplied to the template can be seen starting here
Contribute
Hack on `yachr`
Clone the repo
Run npm install
Hack away.
sampleUsageFile.ts gets transpiled into the dist folder when npm build
is run, this is useful for checking how it runs with node:
From the root:
node dist/src/sampleUsageFile.js
Should produced dist/samples/report.html
Testing out changes to the html template
When making changes to the template its good to see those changes applied as you go.
One option to do this if you're using the templating system, is to get the unit tests to run as you make changes.
As a starting point, the 'should generate a report' test in the reporter.spec.ts will generate a basic looking report.
This can be run on its own by updating the test's it
to use the only function:
it.only('should generate a report', () => {
Don't commit this line though!
One last step is to comment out the code that cleans up the test and removes the generated html. This should be the last line of the test, and has a helpful comment to point it out for you.
CI
yachr is monitored by Travis-ci. when a change is detected Travis-ci will pull the repo and execute npm run ci
. Travis will run ci
before accepting a pull request.
Pre-commit hooks
To keep the build tags aligned to each branch, we're using this pre-commit setup in git. When the readme is committed, the tag will be updated to reflect the current branch.
The commit hooks for this repo can be found under the .githooks
folder. A
setup.sh
script is provided for ease of setting up local developer environments
to use these commit hooks.
As new commit hooks are added, the setup.sh
script should be maintained to ensure
that all hooks can be loaded as part of the onboarding process.
The pre-commit
hook is configured to auto-load the current version of the pre-commit.py
python script. This will ensure that any changes made to the pre-commit script
are synchronised with the developer's environment.
It should be noted that because the pre-commit hook uses a python script, python needs to be installed and accessible from the developer's PATH environment variable.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 1/16 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
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'develop'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Reason
34 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-h68q-55jf-x68w
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4
- Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-29xr-v42j-r956
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2024-11-18
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