<?xml version="1.0" encoding="UTF-8"?>
<!--


    Copyright 2021-2025 gematik GmbH

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    *******

    For additional notes and disclaimer from gematik and in case of changes by gematik find details in the "Readme" file.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>de.gematik.test</groupId>
    <artifactId>tiger</artifactId>
    <version>4.3.1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>tiger-uitests</artifactId>
  <name>${project.artifactId}</name>
  <description>Tiger uitests modul of the tiger test platform.</description>
  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.microsoft.playwright</groupId>
      <artifactId>playwright</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>de.gematik.test</groupId>
      <artifactId>tiger-httpbin</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>de.gematik.test</groupId>
      <artifactId>tiger-test-lib</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>de.gematik.test</groupId>
      <artifactId>tiger-topology-visualizer</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.maven.surefire}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>${version.maven-jar-plugin}</version>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>start-tiger-dummy</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <id>generate-tiger-drivers</id>
                <goals>
                  <goal>generate-drivers</goal>
                </goals>
                <phase>generate-test-sources</phase>
                <configuration>
                  <!-- mandatory -->
                  <glues>
                    <glue>de.gematik.test.tiger.glue</glue>
                  </glues>
                  <driverClassName>Driver${ctr}ITMain</driverClassName>
                  <!-- optional -->
                  <featuresDir>${project.basedir}/src/test/resources/features/main</featuresDir>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <forkedProcessExitTimeoutInSeconds>18000</forkedProcessExitTimeoutInSeconds>
              <includes>
                <!-- adapt to the class names of your driver classes -->
                <include>**/Driver*ITMain.java</include>
              </includes>
              <testFailureIgnore>true</testFailureIgnore>
              <environmentVariables>
                <TIGER_TESTENV_CFGFILE>src/test/resources/playwright-main.yaml</TIGER_TESTENV_CFGFILE>
              </environmentVariables>
              <summaryFile>target/failsafe-reports/failsafe-dummy-summary.xml</summaryFile>
              <runOrder>alphabetical</runOrder>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.maven.surefire}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-playwright-test</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <includes>
                <include>**/workflowui/main/*.java</include>
              </includes>
              <summaryFile>target/failsafe-reports/failsafe-summary.xml</summaryFile>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <goals>
              <goal>generate-serenity-reports</goal>
            </goals>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>start-tiger-dummy-for-unstarted-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <id>generate-tiger-drivers</id>
                <goals>
                  <goal>generate-drivers</goal>
                </goals>
                <phase>generate-test-sources</phase>
                <configuration>
                  <!-- mandatory -->
                  <glues>
                    <glue>de.gematik.test.tiger.glue</glue>
                  </glues>
                  <driverClassName>Driver${ctr}ITReplay</driverClassName>
                  <!-- optional -->
                  <featuresDir>${project.basedir}/src/test/resources/features/replay</featuresDir>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <forkedProcessExitTimeoutInSeconds>18000</forkedProcessExitTimeoutInSeconds>
              <includes>
                <!-- adapt to the class names of your driver classes -->
                <include>**/Driver*ITReplay.java</include>
              </includes>
              <testFailureIgnore>true</testFailureIgnore>
              <environmentVariables>
                <TIGER_TESTENV_CFGFILE>src/test/resources/playwright-replay.yaml</TIGER_TESTENV_CFGFILE>
              </environmentVariables>
              <summaryFile>target/failsafe-reports/failsafe-dummy-summary.xml</summaryFile>
              <runOrder>alphabetical</runOrder>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.maven.surefire}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-playwright-test-for-unstarted-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <includes>
                <include>**/workflowui/replay/*.java</include>
              </includes>
              <summaryFile>target/failsafe-reports/failsafe-summary.xml</summaryFile>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <goals>
              <goal>generate-serenity-reports</goal>
            </goals>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>start-tiger-dummy-for-sequencediagram-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <id>generate-tiger-drivers</id>
                <goals>
                  <goal>generate-drivers</goal>
                </goals>
                <phase>generate-test-sources</phase>
                <configuration>
                  <!-- mandatory -->
                  <glues>
                    <glue>de.gematik.test.tiger.glue</glue>
                  </glues>
                  <driverClassName>Driver${ctr}ITSequencediagram</driverClassName>
                  <!-- optional -->
                  <featuresDir>${project.basedir}/src/test/resources/features/sequencediagram</featuresDir>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <forkedProcessExitTimeoutInSeconds>18000</forkedProcessExitTimeoutInSeconds>
              <includes>
                <!-- adapt to the class names of your driver classes -->
                <include>**/Driver*ITSequencediagram.java</include>
              </includes>
              <testFailureIgnore>true</testFailureIgnore>
              <environmentVariables>
                <TIGER_TESTENV_CFGFILE>src/test/resources/playwright-sequencediagram.yaml</TIGER_TESTENV_CFGFILE>
              </environmentVariables>
              <summaryFile>target/failsafe-reports/failsafe-dummy-summary-sequence.xml</summaryFile>
              <runOrder>alphabetical</runOrder>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.maven.surefire}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-playwright-test-for-sequencediagram-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <includes>
                <include>**/workflowui/sequencediagram/*.java</include>
              </includes>
              <summaryFile>target/failsafe-reports/failsafe-summary.xml</summaryFile>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <goals>
              <goal>generate-serenity-reports</goal>
            </goals>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>start-tiger-dummy-for-testselector-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <id>generate-tiger-drivers</id>
                <goals>
                  <goal>generate-drivers</goal>
                </goals>
                <phase>generate-test-sources</phase>
                <configuration>
                  <!-- mandatory -->
                  <glues>
                    <glue>de.gematik.test.tiger.glue</glue>
                  </glues>
                  <driverClassName>Driver${ctr}ITTestSelector</driverClassName>
                  <!-- optional -->
                  <featuresDir>${project.basedir}/src/test/resources/features/testselector</featuresDir>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <forkedProcessExitTimeoutInSeconds>18000</forkedProcessExitTimeoutInSeconds>
              <includes>
                <!-- adapt to the class names of your driver classes -->
                <include>**/Driver*ITTestSelector.java</include>
              </includes>
              <testFailureIgnore>true</testFailureIgnore>
              <environmentVariables>
                <TIGER_TESTENV_CFGFILE>src/test/resources/playwright-testselector.yaml</TIGER_TESTENV_CFGFILE>
              </environmentVariables>
              <summaryFile>target/failsafe-reports/failsafe-dummy-summary-testselector.xml</summaryFile>
              <runOrder>alphabetical</runOrder>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.maven.surefire}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-playwright-test-for-testselector-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <includes>
                <include>**/workflowui/testselector/*.java</include>
              </includes>
              <summaryFile>target/failsafe-reports/failsafe-summary.xml</summaryFile>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-maven-plugin</artifactId>
            <version>${project.version}</version>
            <goals>
              <goal>generate-serenity-reports</goal>
            </goals>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-playwright-test-for-topology</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${version.maven.failsafe}</version>
            <configuration>
              <includes>
                <include>**/workflowui/topology/*.java</include>
              </includes>
              <summaryFile>target/failsafe-reports/failsafe-summary.xml</summaryFile>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
