我是魅力报告的新手,想要生成魅力报告。有人能帮忙吗?
我正在尝试一个简单的示例,我的项目文件夹包含 config.js 和 test.js 以及安装的魅力报告
当我运行配置文件时,它会创建一个文件夹 allure-results,在其中我可以看到屏幕截图和一个 xml 文件。我不知道从这里做什么,我正在尝试使用 Maven,但无法生成 html 报告。
我已经添加了我的示例的代码
配置文件
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: 'test.js',
onPrepare: function () {
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();
});
});
}
};
test.js
describe('angularjs homepage todo list', function () {
var todoList = element.all(by.repeater('todo in todoList.todos'));
it('should add a todo', function () {
browser.get('https://angularjs.org');
element(by.model('todoList.todoText')).sendKeys('write first protractor test');
element(by.css('[value="add"]')).click();
});
it('test 2', function () {
expect(todoList.count()).toEqual(3);
});
it('test 3', function () {
expect(todoList.get(2).getText()).toEqual('write first protractor test');
});
it('test 4', function () {
// You wrote your first test, cross it off the list
todoList.get(2).element(by.css('input')).click();
var completedAmount = element.all(by.css('.done-true'));
expect(completedAmount.count()).toEqual(2);
});
});