运行 使用 Grunt 任务进行自动化测试
Running automation test with Grunt task
我在 java 中有一个使用 Selenium Webdriver 的测试自动化项目。我想使用 G运行t 任务(我是 G运行t 的新手)开始驱动测试。我使用 g运行t-selenium-webdriver 插件(Git 这里:https://github.com/levexis/grunt-selenium-webdriver)
我安装了这个插件并在 Gruntfile.js
中添加了 webdriver 部分
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命令。
我在 java 中有一个使用 Selenium Webdriver 的测试自动化项目。我想使用 G运行t 任务(我是 G运行t 的新手)开始驱动测试。我使用 g运行t-selenium-webdriver 插件(Git 这里:https://github.com/levexis/grunt-selenium-webdriver)
我安装了这个插件并在 Gruntfile.js
中添加了 webdriver 部分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命令。