Gathering detailed insights and metrics for yachr
Gathering detailed insights and metrics for yachr
Gathering detailed insights and metrics for yachr
Gathering detailed insights and metrics for yachr
npm install yachr
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
144 Commits
3 Watching
17 Branches
2 Contributors
Updated on 06 Oct 2020
TypeScript (68.83%)
HTML (21.49%)
Gherkin (5.24%)
Python (3.37%)
Shell (0.58%)
JavaScript (0.49%)
Cumulative downloads
Total Downloads
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
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.
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}
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
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
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.
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.
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
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
Reason
project is not fuzzed
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
34 existing vulnerabilities detected
Details
Score
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