【发布时间】:2020-03-07 00:03:50
【问题描述】:
我为我的应用程序设置了 CodeceptJS 框架,并且测试运行顺利。 但现在我希望他们运行无头 chrome。尝试了官方网站上提到的一些东西,但它不适合我。
我尝试使用npx codeceptjs run --verbose 运行我的测试。
我的 codecept.conf.js 文件如下所示:
exports.config = {
tests: './tests/features/**/*_test.js',
output: './tests/output',
helpers: {
WebDriver: {
smartwait: 10000,
waitForTimeout: 10000,
url: 'https://affinity.sourcefuse.com',
browser: 'chrome',
windowSize: 'maximize',
chromeOptions: {
args: [ "--headless", "--disable-gpu", "--window-size=800,600"]
}
}
},
include: {
I: './steps_file.js',
createDatasetPage: 'tests/pages/createDataset.js',
},
bootstrap: null,
mocha: {},
name: 'dashboard',
plugins: {
"allure": {
"enabled": true
},
wdio: {
enabled: true,
services: ['selenium-standalone']
}
}
}
实际:Chrome 已启动并开始运行测试。
预期:我希望它在 headless chrome 上运行。
【问题讨论】:
标签: automated-tests google-chrome-headless codeceptjs