在 Maven 构建过程中运行量角器测试 [英] Running protractor tests as part of the Maven build process

查看:20
本文介绍了在 Maven 构建过程中运行量角器测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Maven 项目,我不想更改 POM,这样当我构建项目(清理 + 安装)时,在编译部分之后,将开始一组量角器测试(打开 selenium 并做几件事),并且只有在测试通过时,构建本身才会通过.

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 构建过程中运行量角器测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆