我正在使用grunt- protractor -runner插件,在量角器目标中,我想发送包含要运行的测试的specs参数。在grunt文件中,我的目标如下所示:
testIntegration:
{
options:
{
args: {
specs: ['test1.js'],
browser: 'firefox'
}
}量角器父任务选项包含量角器配置文件的设置。
当运行这个目标时,我得到这个错误:$ grunt protractor:testIntegration运行"protractor:testIntegration“(protractor)任务启动selenium独立服务器...Selenium独立服务器启动于...警告:模式%t与任何文件都不匹配。警告:模式e与任何文件都不匹配。警告:模式%s与任何文件都不匹配。警告:模式%t与任何文件都不匹配。警告:模式%1与任何文件都不匹配。警告:模式j与任何文件都不匹配。警告:模式%s与任何文件都不匹配。
然后是更多的错误。同一行在Protractor配置文件中运行良好。尝试了其他一些变体,但没有成功。
我遗漏了什么?有什么想法吗?
发布于 2014-02-26 04:12:00
尝试此配置:
module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
protractor: {
options: {
keepAlive: true,
singleRun: false,
configFile: "PROTRACTOR_CONFIG_FILE.js"
},
run_firefox: {
options: {
args: {
browser: "firefox"
}
}
}
});
// load grunt-protractor-runner
grunt.loadNpmTasks('grunt-protractor-runner');
// register tasks
grunt.registerTask('default', 'Run Protractor using Firefox',
['protractor:run_firefox']);
};有趣的是,如果你阅读每条错误消息,它都会拼写为"test1.js“。看起来它没有正确读取配置文件,可能是因为您没有使用grunt.file.readJSON('FILENAME.json')
https://stackoverflow.com/questions/21595662
复制相似问题