Skip to content

Commit 3b49f4f

Browse files
committed
Configure Cypress to not record on local dev machines, but to record under CI
1 parent 5dd6fff commit 3b49f4f

File tree

1 file changed

+75
-27
lines changed

1 file changed

+75
-27
lines changed

pom.xml

Lines changed: 75 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -289,27 +289,6 @@
289289
</execution>
290290
</executions>
291291
</plugin>
292-
<!-- Cypress is used for integration tests -->
293-
<plugin>
294-
<groupId>org.codehaus.mojo</groupId>
295-
<artifactId>exec-maven-plugin</artifactId>
296-
<executions>
297-
<execution>
298-
<phase>integration-test</phase>
299-
<goals>
300-
<goal>exec</goal>
301-
</goals>
302-
<configuration>
303-
<executable>npm</executable>
304-
<arguments>
305-
<argument>run</argument>
306-
<argument>cypress</argument>
307-
<argument>--</argument>
308-
</arguments>
309-
</configuration>
310-
</execution>
311-
</executions>
312-
</plugin>
313292
<plugin>
314293
<groupId>org.apache.maven.plugins</groupId>
315294
<artifactId>maven-gpg-plugin</artifactId>
@@ -331,12 +310,81 @@
331310
</plugins>
332311
</build>
333312

334-
<repositories>
335-
<repository>
336-
<id>exist</id>
337-
<url>https://raw.github.com/eXist-db/mvn-repo/master/</url>
338-
</repository>
339-
</repositories>
313+
<!--
314+
Cypress is used for integration tests
315+
316+
First profile enables to run Cypress without record (cypress.io) support.
317+
Second profile enables to run Cypress with record support, e.g. for CI.
318+
-->
319+
<profiles>
320+
<profile>
321+
<id>cypress-without-record</id>
322+
<activation>
323+
<property>
324+
<name>env.CI</name>
325+
<value>!true</value>
326+
</property>
327+
</activation>
328+
<build>
329+
<plugins>
330+
<plugin>
331+
<groupId>org.codehaus.mojo</groupId>
332+
<artifactId>exec-maven-plugin</artifactId>
333+
<executions>
334+
<execution>
335+
<phase>integration-test</phase>
336+
<goals>
337+
<goal>exec</goal>
338+
</goals>
339+
<configuration>
340+
<executable>npm</executable>
341+
<arguments>
342+
<argument>run</argument>
343+
<argument>cypress</argument>
344+
<argument>--</argument>
345+
</arguments>
346+
</configuration>
347+
</execution>
348+
</executions>
349+
</plugin>
350+
</plugins>
351+
</build>
352+
</profile>
353+
<profile>
354+
<id>cypress-with-record</id>
355+
<activation>
356+
<property>
357+
<name>env.CI</name>
358+
<value>true</value>
359+
</property>
360+
</activation>
361+
<build>
362+
<plugins>
363+
<plugin>
364+
<groupId>org.codehaus.mojo</groupId>
365+
<artifactId>exec-maven-plugin</artifactId>
366+
<executions>
367+
<execution>
368+
<phase>integration-test</phase>
369+
<goals>
370+
<goal>exec</goal>
371+
</goals>
372+
<configuration>
373+
<executable>npm</executable>
374+
<arguments>
375+
<argument>run</argument>
376+
<argument>cypress</argument>
377+
<argument>--</argument>
378+
<argument>--record</argument>
379+
</arguments>
380+
</configuration>
381+
</execution>
382+
</executions>
383+
</plugin>
384+
</plugins>
385+
</build>
386+
</profile>
387+
</profiles>
340388

341389
<pluginRepositories>
342390
<pluginRepository>

0 commit comments

Comments
 (0)