gpt4 book ai didi

javascript - Testcafe 和 allure 记者

转载 作者:行者123 更新时间:2023-11-30 08:19:18 25 4
gpt4 key购买 nike

我尝试使用在

上找到的 allure 记者

Allure reporter

我创建了运行者:

const createTestCafe = require('testcafe');
let testcafe = null;

createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
const runner = testcafe.createRunner();

return runner
.src(['tests/fixture1.js', 'tests/ingo1.js'])
.browsers(['chrome'])
.reporter('allure')
.run();
})
.then(failedCount => {
console.log('Tests failed: ' + failedCount);
testcafe.close();
});

启动脚本时,我收到消息“Allure reporter started”,完成后收到“Allure reporter finished”。但是在我的根文件夹中,我没有收到任何诱惑报告。我也尝试使用自己的配置文件

const DOC_ALLURE_CONFIG = {
CLEAN_REPORT_DIR: true,
COPY_HISTORY: true,
RESULT_DIR: '/allure/allure-results',
REPORT_DIR: '/allure/allure-report',
META: {
STORY_ID: 'STORY',
TEST_ID: 'ID',
SEVERITY: 'SEVERITY',
TEST_RUN: 'TEST_RUN'
},
STORY_LABEL: 'JIRA Story Link',
STORY_URL: 'https://jira.example.ca/browse/{{ID}}',
TEST_LABEL: 'JIRA Test Link',
TEST_URL: 'https://jira.example.ca/secure/Tests.jspa#/testCase/{{ID}}',
labels: {
screenshotLabel: 'Screenshot',
browserLabel: 'Browser',
userAgentLabel: 'User Agent',
allureStartMessage: 'Allure Ingo reporter started...',
allureClosedMessage: 'Allure Ingo reporter closed...'
}
};

module.exports = DOC_ALLURE_CONFIG;

这也行不通。不显示自定义消息,仅显示默认消息。看起来 allure 插件忽略了所有内容并且无法很好地识别我的节点模块。

我错过了什么设置才能在我的项目根目录中获取 allure 报告?

(也尝试使用 npm 链接...)

最佳答案

testcafe-allure-reporter 文件夹存储相对于安装此模块的路径生成的报告。因此,尝试在本地将 testcafe-allure-reporter 安装到您的项目并执行脚本。之后,allure/allure-results 文件夹应该出现在您的项目根目录中。

关于javascript - Testcafe 和 allure 记者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56628927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com