1.0.9 • Published 7 years ago
beat-report v1.0.9
How to use it:
npm install beat-report
require(‘beat-report’).AllureProperties in your conf.js file
when you call generateProperties(browserName,locale,baseEnv), it will generate test environment info in test report
Example:
var env = require('./configuration/environment.js'); var spec = require('./specs/specs.js'); var AllureProperties = require('beat-report').AllureProperties; var AllureReporter = require('jasmine-allure-reporter');
exports.config = {
specs: specs.specs,
capabilities: env.capabilities,
seleniumAddress: env.seleniumAddress,
directConnect: true,
params: {
baseEnv : 'aribabox',
timeOut : 5000,
},
framework: 'jasmine2',
jasmineNodeOpts: {
defaultTimeoutInterval: 3000000,
showColors: true
},
onPrepare: function() {
jasmine.getEnv().addReporter(new AllureReporter({
allureReport: {
resultsDir: './allure/'
}
}));
jasmine.getEnv().afterEach(function (done) {
browser.takeScreenshot().then(function (png) {
allure.createAttachment('Screenshot', function () {
return new Buffer(png, 'base64')
}, 'image/png')();
done();
})
});
var allureProperties = new AllureProperties();
allureProperties.generateProperties('chrome','US','QA_Farm');
},
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
},
};