CodeceptJS学习笔记-入门05-生成HTML测试报告
安装mochawesome
npm i mochawesome |
如果有以下报错
"mochawesome" reporter not foundinvalid reporter "mochawesome" |
执行安装命令
npm i mocha -D |
codeceptjs.conf.js文件中加入
mocha: { reporterOptions: { reportDir: "output" } }, |
运行,执行命令
npx codeceptjs run --reporter mochawesome |
生成测试报告mochawesome.html

全部内容
const { setHeadlessWhen } = require('@codeceptjs/configure');// turn on headless mode when running with HEADLESS=true environment variable// HEADLESS=true npx codecept runsetHeadlessWhen(process.env.HEADLESS);exports.config = { output: './output', helpers: { Puppeteer: { show: true, windowSize: '1920x1080' } }, include: { }, bootstrap: null, mocha: {}, name: 'codeceptdemo', translation: 'zh-CN', mocha: { reporterOptions: { reportDir: "output" } }, plugins: { retryFailedStep: { enabled: true }, screenshotOnFail: { enabled: true } }} |

浙公网安备 33010602011771号