问题描述
我有一个Maven项目,并且我不想更改POM,以便在构建项目(清洁+安装)时,在编译部分之后,将开始一组量角器测试(打开硒并做一些事情) ,并且只有在测试通过的情况下,构建本身才能通过.
I have a Maven project and I wan't to change the POM so that when I build the project (Clean + Install), after the compilation part, a set of protractor tests will start (opening selenium and doing several things), and only if the tests pass, the build itself passes.
我似乎找不到能给我这种功能的东西.有可能吗?如果可以,该如何使用?我们目前正在使用"com.github.eirslett" maven插件进行构建,我想知道是否有可能在该插件中添加量角器测试作为一个阶段.我可以看到它支持使用'Karma'进行单元测试,但不支持与量角器有关的任何东西.
I can't seem to find something that gives me this kind of functionality. Is is possible? and if so, How do I use it?We are currently using the 'com.github.eirslett' maven plugin for building and I was wondering if it is possible to add the protractor tests as a stage in this plugin. I can see that it supports unit testing with 'Karma' but not anything related to protractor.
任何帮助将不胜感激!!谢谢:)
Any help will be much appreciated!! Thanks :)
推荐答案
您可以使用以下maven插件 https://github.com/greengerong/maven-ng-protractor
You can use following maven plugin https://github.com/greengerong/maven-ng-protractor
您可以像这样使用它
<plugin>
<groupId>com.github.greengerong</groupId>
<artifactId>maven-ng-protractor</artifactId>
<version>0.0.2</version>
<configuration>
<protractor>protractor</protractor>
<configFile>yourconfig.js</configFile>
</configuration>
<executions>
<execution>
<id>ng-protractor</id>
<phase>integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
这篇关于在Maven构建过程中运行量角器测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!