我有一个在java中使用Selenium Webdriver的测试自动化项目。我想使用 Grunt 任务(我是 Grunt 的新手)来开始驾驶测试。我使用grunt-selenium-webdriver插件(Git在这里:https://github.com/levexis/grunt-selenium-webdriver)
我安装了这个插件并在 Gruntfile 中添加了这个部分的网络驱动程序.js
grunt.initConfig({
webdriver: {
options: {
desiredCapabilities: {
browserName: 'chrome'
}
},
login: {
tests: ['Test/Automation/NextGenWebViewerUI/src/test/java/com/autodesk/infraworks/webviewer/tests/*.java'],
},
},
});
grunt.loadNpmTasks('grunt-selenium-webdriver');
然后,我使用此命令运行此任务
grunt webdriver
但我得到了警告:
>> Grunt script called with:
>> Tasks: webdriver
>> Options:
Warning: Task "webdriver" not found. Use --force to continue.
任何人都可以帮助我或有使用示例吗?非常感谢!
我用grunt-shell解决了这个问题,在grunt-shell中执行maven命令。