ReportFactory helps you save each of your test runs so that they are always available for reports and analytics. It consists of three parts:
Follow these instructions to get Report Factory running with Docker. The configuration is ready for production.
Install with npm as a development dependency:
$ npm install --save-dev report-factory-mocha
Before you start using this reporter, make sure you have the ReportFactory server deployed and running.
To setup this reporter to work with your Mocha tests, you need to configure it first. You can set up a root-level hook that will cause the callback to run before all your tests. For example:
const reportFactory = require('report-factory-mocha');
before(function() {
reportFactory.configure({
baseUrl: "The url of the ReportFactory server. It's 'http://0.0.0.0:3000' if you're running locally",
projectName: "The name of the project that you are testing. Needs to be previously created in ReportFactory",
tags: ['Tags', 'to', 'help', 'you', 'group', 'your', 'reports'],
authToken: "Your user X_API_KEY. Can be found in ReportFactory in your user information"
});
});
Then you can just simply run your mocha tests with --reporter report-factory-mocha
and your reports will be available on the server after each test run.
You can use mocha-multi-reporters to run it in parallel with other reporters.
After checking out the repo, run npm install
to install dependencies.
Run tests with npm run test
.
Bug reports and pull requests are welcome on GitHub at https://github.com/igor-starostenko/report-factory-mocha. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The package is available as open source under the terms of the MIT License.
Everyone interacting in the report-factory-mocha
project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.