使用Grunt任务运行java自动化测试
我有一个在java中使用Selenium Webdriver的测试自动化项目。我想使用Grunt任务(我是Grunt新手)开始驾驶测试。我使用grunt selenium webdriver插件(Git here:https://github.com/levexis/grunt-selenium-webdriver)
我安装了this插件,并在GrunFile中添加了这一节webdriver。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.
有人能帮我吗?或者有用法的例子吗?。非常感谢
# 1 楼答案
我用grunt shell解决了这个问题,在grunt shell中执行maven命令