从package.json下载所有依赖项后通过maven;然后必须自动触发量角器测试

时间:2017-11-21 05:30:51

标签: maven npm jasmine protractor npm-install

在运行时实现通过maven下载所有依赖项然后自动protractor conf.js触发POM.XML中的更改:

从package.json下载依赖项:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.3.2</version>
                    <execution>
                        <id>npm install (initialize)</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>install</argument>
                            </arguments>


                    </configuration>
                        </execution>
</plugin>

指向开始量角器测试:

<plugin>
                <groupId>com.github.greengerong</groupId>
                <artifactId>maven-ng-protractor</artifactId>
                <version>0.0.2</version>
                <configuration>
                    <protractor>protractor</protractor>
                    <configFile>./conf.js</configFile>
                </configuration>

                <executions>
                    <execution>
                        <id>ng-protractor</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>   
            </plugin> 

的package.json:

"dependencies": {
    "protractor-jasmine2-screenshot-reporter": "^0.4.0"
  },
  "devDependencies": {
    "protractor-html-reporter": "^1.3.2",
    "winston": "^2.3.1",
    "jasmine-reporters": "^2.2.1",
    "fs-extra": "^4.0.1",
    "protractor-jasmine2-screenshot-reporter": "^0.4.1"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },

当我使用自动创建的mvn clean install node-modules文件夹运行pom.xml时,该文件夹包含所有依赖项,但后来protractor conf.js未触发。

如何在下载所有依赖项后自动触发量角器测试?

0 个答案:

没有答案