我一直在webdriverIO上的wdio.config.js
文件中尝试以下内容,但无济于事。我:
reporters: ['dot',['mochawesome',{
outputDir: './Results', reportTitle: 'My Custom Title', showPassed: false, marge: '--saveHtml'
}],
],
mochawesomeOpts: {
includeScreenshots:true,
screenshotUseRelativePath:true
},
我的包。Json是这样的:
"scripts": {
"test": "echo "Error: no test specified" && exit 1 --reporter-options reportDir=Report,reportFilename=Test_Report",
"generateMochawesome":"marge --reporter-options reportDir=Report,reportFilename=Test_Report"
},
"dependencies": {
"@wdio/cli": "^7.9.1",
"mochawesome-report-generator": "^3.1.5",
"mocha-simple-html-reporter": "^2.0.0",
"mochawesome-merge": "^4.2.0",
"mochawesome-screenshots": "^1.7.3",
"npm": "^7.20.6"
},
"devDependencies": {
"@wdio/dot-reporter": "^7.9.0",
"@wdio/local-runner": "^7.9.1",
"@wdio/mocha-framework": "^7.9.1",
"chromedriver": "^92.0.1",
"wdio-chromedriver-service": "^7.2.0",
"wdio-mochawesome-reporter": "^4.0.0"
}
}
我检查了一下,最后降级了一些包,这是我的package.json
{
"name": "webdriverio-tests",
"version": "0.1.0",
"description": "",
"private": true,
"keywords": [],
"scripts": {
"test": "wdio test/wdio.conf.ts --spec ./test/specs/integration.e2e.ts",
"generateMochawesome": "marge Results/results-0-0.json --reportTitle 'My Project Results'"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@wdio/cli": "^7.27.0",
"@wdio/dot-reporter": "^7.26.0",
"@wdio/local-runner": "^7.27.0",
"@wdio/mocha-framework": "^7.26.0",
"@wdio/spec-reporter": "^7.26.0",
"chromedriver": "^107.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.9.3",
"wdio-chromedriver-service": "^8.0.0",
"wdio-mochawesome-reporter": "^4.0.0",
"wdio-wait-for": "^3.0.0"
},
"dependencies": {
"mochawesome-report-generator": "^3.1.5"
}
}