在VS Code执行WebdriverIO测试脚本报错:找不到allure报告插件
解决WebdriverIO启动测试会话失败:找不到Allure报告器插件的问题
2022-10-06T04:58:42.199Z ERROR @wdio/local-runner: 启动测试会话失败:错误:未找到插件"allure"报告器,既不是wdio作用域包"@wdio/allure-reporter",也不是社区包"wdio-allure-reporter"。请确保已安装该插件!
解决步骤
安装Allure报告器依赖
根据使用的包管理器执行对应命令:- npm:
npm install @wdio/allure-reporter --save-dev - yarn:
yarn add @wdio/allure-reporter --dev
注:新版本WebdriverIO使用
@wdio/allure-reporter,旧版本可能需要安装wdio-allure-reporter,优先选择前者。- npm:
检查wdio配置文件
在wdio.conf.js或wdio.conf.ts中,确保reporters数组包含'allure'相关配置:exports.config = { // 其他配置项... reporters: [ 'spec', ['allure', { outputDir: 'allure-results', disableWebdriverStepsReporting: true, disableWebdriverScreenshotsReporting: false }] ], // 其他配置项... }重新启动测试
依赖安装完成后,执行测试命令验证:npx wdio run wdio.conf.js
内容的提问来源于stack exchange,提问作者Dhivya N
相关产品推荐
相关产品推荐

