基于jasmine-allure-reporter生成简单的html [英] Generate simple html based on jasmine-allure-reporter

查看:492
本文介绍了基于jasmine-allure-reporter生成简单的html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jasmine-allure-reporter,报告简直太棒了。只有对记者的投诉是我错过选项,只能保存失败的屏幕截图,并可以通过电子邮件发送。



我知道这是不可能的:


I'm using jasmine-allure-reporter and the report is simply awesome. Only complaint over the reporter is that I miss option to enable only failed screenshots to be saved and possibility to send it via e-mail.

I know that is not possible: How to send an email of allure report?

My question is whether I can somehow generate a simple html file with few data based on the allure reports, so that I'll be able to send it via e-mail to relevant people.

解决方案

Hope you have added this in your conf file:

onPrepare: function () {
    browser.manage().timeouts().implicitlyWait(15000);
    var AllureReporter = require('jasmine-allure-reporter');
    jasmine.getEnv().addReporter(new AllureReporter({
        allureReport: {
            resultsDir: 'allure-results'
        }
    }));
    jasmine.getEnv().afterEach(function (done) {
        browser.takeScreenshot().then(function (png) {
            allure.createAttachment('Screenshot', function () {
                return new Buffer(png, 'base64');
            }, 'image/png')();
            done();
        });
    });

}

After running the files , go to allure-results where you can see the screenshots and xml reports.

Copy-Paste the folder i.e. allure-results to \node_modules\jasmine-allure-reporter where you can see a pom.xml file.

Install Maven in your machine (This is mandatory)

Now from same path i.e. \node_modules\jasmine-allure-reporter run the following command

mvn site -Dallure.results_pattern=allure-results

After Successfull run of above command,

Go to

\node_modules\jasmine-allure-reporter\target\site\allure-maven-plugin

and open index.html

This is how it looks:

这篇关于基于jasmine-allure-reporter生成简单的html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆