Skip to content

PostmanJenkins

José Bocanegra edited this page Mar 8, 2022 · 15 revisions

Ejecutar colecciones en Jenkins

  1. Instalar el paquete postman-combine-collections con el comando: npm i -g postman-combine-collections
  2. En el directorio del proyecto ejecutar el comando: postman-combine-collections --name Composed -f 'collections/*.postman_collection.json' -o it/composed.collection.json
  3. Modificar el archivo pom.xml asì:
<build>
    <plugins>
    ...
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
                <execution>
                    <id>integration-tests-composed-collection</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>
                            newman
                        </executable>
                        <commandlineArgs>
                            run it/composed.collection.json -e collections/EntornoIT.postman_environment.json
                        </commandlineArgs>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
Clone this wiki locally