qa-testing-parent
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-testing-parent</artifactId>
<version>1.0.9</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2024 Adrian Herscu
~
~ 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.
-->
<!--suppress ALL -->
<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>dev.aherscu.qa</groupId>
<artifactId>qa-automation</artifactId>
<version>1.0.9</version>
</parent>
<artifactId>qa-testing-parent</artifactId>
<packaging>pom</packaging>
<name>QA Testing Parent</name>
<description>
Provides default configuration for QA Automation projects.
Also provides Maven profiles for managing logs, devices, providers
and test suites. There is a special profile for generating a standalone test
executable to used in constrained environments.
</description>
<properties>
<logback.configurationFile>logback-test.xml</logback.configurationFile>
<!-- NOTE: we are not using TestNG grouping mechanism -->
<groups />
<silent>true</silent>
<environment>dev</environment>
<!-- NOTE: these properties are referenced by the failsafe plugin below -->
<surefire.suiteXmlFiles>testng.xml</surefire.suiteXmlFiles>
<provider>provider.local.</provider>
<device.type />
<application.uploading.phase>none</application.uploading.phase>
<!-- NOTE: overriden by jenkins profile below -->
<!-- NOTE: cannot use volatile properties because of caching -->
<!--build.label>${user.name}@local-${maven.build.timestamp}</build.label-->
<build.label>local</build.label>
<build.tags>functional</build.tags>
<application.filename>app</application.filename>
<test.properties.file>environments/${environment}/test.properties
</test.properties.file>
<jgiven.reports>
jgiven-reports/${build.tags}-${environment}/${device.type}/${build.label}
</jgiven.reports>
<jgiven.report.dir>
target/site/${jgiven.reports}
</jgiven.report.dir>
<jgiven.report.text>false</jgiven.report.text>
<poll.timeout>15</poll.timeout>
<poll.delay>5</poll.delay>
<dryrun />
<screenshots>true</screenshots>
<!-- NOTE for skipping tests just do not supply any testing-* profile -->
<maven.test.skip>false</maven.test.skip>
<!-- NOTE disabling maven cache due to
https://issues.apache.org/jira/projects/MBUILDCACHE/issues/MBUILDCACHE-72 -->
<maven.build.cache.enabled>false</maven.build.cache.enabled>
<title>${project.name} ${device.type} [#${build.label}]</title>
<alm.href>
https://github.com/QA-Automation-Starter/qa-automation/issues/{0}
</alm.href>
<reference.href><![CDATA[@{StringUtilsExtensions.format('${alm.href}', '(\\d+)', value)}]]></reference.href>
<reference.templatelink><![CDATA[@{StringUtilsExtensions.format('<a target="_blank" href="${alm.href}">Click here to open ALM {0}</a>', '(\\d+)', value)}]]></reference.templatelink>
<!-- NOTE: these defaults are required in order to enable Eclipse TestNG launchers -->
<saucelabs.reporter.url />
<application.workingdir />
<testobject.ipa.id />
<testobject.apk.id />
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-webdriver</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-ssh</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-rest</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-rabbitmq</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-elasticsearch</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-jdbc</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-testing-extra</artifactId>
<version>1.0.9</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.18.7</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-commons</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-reporter</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.tngtech.jgiven</groupId>
<artifactId>jgiven-html5-report</artifactId>
</dependency>
<!-- TODO ensure if really needed -->
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<scope>runtime</scope>
</dependency>
<!-- NOTE: required by the Apache HTTPComponents library for logging;
otherwise: ERROR StatusLogger Log4j2 could not find a logging implementation -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.20.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- makes test properties available at build time -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.0</version>
<executions>
<execution>
<id>read-project-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>
src/test/resources/environments/${environment}/test.properties
</file>
<file>src/test/resources/webdriver.properties</file>
</files>
</configuration>
</execution>
<execution>
<id>write-project-properties</id>
<phase>generate-resources</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
<configuration>
<outputFile>${project.build.directory}/build.properties
</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-commons</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- NOTE: we have no unit tests to run here.
Have to disable this plugin because it is defined in parent pom.
System tests are run via the failsafe plugin, see below. -->
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<suiteXmlFiles>${surefire.suiteXmlFiles}</suiteXmlFiles>
<systemPropertyVariables>
<!-- NOTE: system properties, a.k.a. -D options, should be added here -->
<logback.configurationFile>${logback.configurationFile}
</logback.configurationFile>
<poll.timeout>${poll.timeout}</poll.timeout>
<poll.delay>${poll.delay}</poll.delay>
<saucelabs.reporter.url>${saucelabs.reporter.url}
</saucelabs.reporter.url>
<provider>${provider}</provider>
<device.type>${device.type}</device.type>
<build.label>${build.label}</build.label>
<build.tags>${build.tags},${environment}</build.tags>
<application.filename>${application.filename}
</application.filename>
<application.workingdir>${application.workingdir}
</application.workingdir>
<environment.label>${environment}</environment.label>
<jgiven.report.dir>${jgiven.report.dir}</jgiven.report.dir>
<identifiers.file>${jgiven.report.dir}/identifiers.txt
</identifiers.file>
<testobject.ipa.id>${testobject.ipa.id}</testobject.ipa.id>
<testobject.apk.id>${testobject.apk.id}</testobject.apk.id>
<!-- Dry run support planned for JGiven 1.0.0 -->
<!--jgiven.report.dry-run>${dryrun}</jgiven.report.dry-run-->
<!-- meanwhile, we'll use ours -->
<dryrun>${dryrun}</dryrun>
<screenshots>${screenshots}</screenshots>
<screenshotDelayMs>500</screenshotDelayMs>
<reference.href>${reference.href}</reference.href>
<reference.templatelink>${reference.templatelink}</reference.templatelink>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.tngtech.jgiven</groupId>
<artifactId>jgiven-maven-plugin</artifactId>
<configuration>
<title>${title}</title>
<sourceDirectory>${jgiven.report.dir}</sourceDirectory>
<outputDirectory>${jgiven.report.dir}/html</outputDirectory>
</configuration>
<executions>
<execution>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>dev.aherscu.qa</groupId>
<artifactId>qa-jgiven-reporter-maven-plugin</artifactId>
<version>${project.parent.version}</version>
<configuration>
<sourceDirectory>${jgiven.report.dir}</sourceDirectory>
<outputDirectory>${jgiven.report.dir}/qa-html</outputDirectory>
<screenshotScale>0.2</screenshotScale>
</configuration>
<executions>
<execution>
<id>permethod-report</id>
<phase>post-integration-test</phase>
<goals>
<goal>permethod-report</goal>
</goals>
<configuration>
<referenceTag>Reference</referenceTag>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself.-->
<!-- https://stackoverflow.com/questions/7905501/get-rid-of-pom-not-found-warning-for-org-eclipse-m2elifecycle-mapping -->
<id>mode-eclipse</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<properties>
<!-- NOTE: TestNG/m2e integration does not parse these well -->
<reference.href />
<reference.templatelink />
</properties>
</profile>
<profile>
<id>generate-standalone</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>org.testng.TestNG</mainClass>
</manifest>
</archive>
<descriptors>
<!-- NOTE: child projects should have such descriptor -->
<descriptor>src/assembly/test-with-dependencies.xml
</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>mode-logs-simple</id>
<!-- NOTE: omits thread ids in log -->
<properties>
<logback.configurationFile>logback-dev.xml</logback.configurationFile>
</properties>
</profile>
<profile>
<id>mode-noscreenshots</id>
<properties>
<screenshots />
</properties>
</profile>
<profile>
<id>mode-dryrun</id>
<properties>
<dryrun>true</dryrun>
<build.tags>dryrun</build.tags>
<application.filename>NA</application.filename>
<device.type />
<jgiven.reports>
jgiven-reports/${build.tags}/${build.label}
</jgiven.reports>
<title>Dry-run of ${project.name} [#${build.label}]</title>
</properties>
</profile>
<profile>
<id>mode-jenkins</id>
<activation>
<property>
<name>env.BUILD_NUMBER</name>
</property>
</activation>
<properties>
<build.label>${env.JOB_NAME}-${env.BUILD_NUMBER}</build.label>
</properties>
</profile>
<profile>
<id>mode-proxy</id>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- NOTE: system properties, a.k.a. -D options, should be added here -->
<!-- ISSUE cannot reference proxy properties via
${settings.proxies.proxy(0).host} -->
<https.proxyHost>TBD</https.proxyHost>
<https.proxyPort>80</https.proxyPort>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>device-windows</id>
<properties>
<device.type>windows</device.type>
</properties>
</profile>
<profile>
<id>device-android</id>
<properties>
<device.type>android</device.type>
</properties>
</profile>
<profile>
<id>device-ios</id>
<properties>
<device.type>ios</device.type>
</properties>
</profile>
<profile>
<id>provider-selenium</id>
<properties>
<provider>provider.selenium.</provider>
</properties>
</profile>
<profile>
<id>provider-saucelabs-selenium</id>
<properties>
<provider>provider.saucelabs.</provider>
<saucelabs.reporter.url>
https://${env.SAUCELABS_USER}:${env.SAUCELABS_PASSWORD}@ondemand.saucelabs.com:443/wd/hub
</saucelabs.reporter.url>
</properties>
</profile>
<profile>
<id>provider-saucelabs-appium</id>
<properties>
<provider>provider.saucelabs.</provider>
<saucelabs.reporter.url>
https://${env.SAUCELABS_USER}:${env.SAUCELABS_PASSWORD}@ondemand.saucelabs.com:443/wd/hub
</saucelabs.reporter.url>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.cjnygard</groupId>
<artifactId>rest-maven-plugin</artifactId>
<version>0.1.4</version>
<configuration>
<method>POST</method>
<endpoint>https://saucelabs.com/rest/v1/storage/TBD</endpoint>
<headers>
<!-- TBD:TBD -->
<Authorization>Basic TBD</Authorization>
</headers>
<queryParams>
<overwrite>true</overwrite>
</queryParams>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- ISSUE: does not work via proxy
https://github.com/cjnygard/rest-maven-plugin/issues/12 -->
<id>provider-saucelabs-application-upload</id>
<build>
<plugins>
<plugin>
<groupId>com.github.cjnygard</groupId>
<artifactId>rest-maven-plugin</artifactId>
<version>0.1.4</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}</directory>
</fileset>
</filesets>
</configuration>
<executions>
<execution>
<id>uploading-android-application</id>
<phase>pre-integration-test</phase>
<goals>
<goal>rest-request</goal>
</goals>
<configuration>
<resource>${commons.saucelabs.application.filename}.apk
</resource>
<filesets>
<fileset>
<includes>
<!-- NOTE: temporary solution until will have a real CI/CD -->
<!-- additional application binaries -->
<include>bin/${application.filename}.apk</include>
</includes>
</fileset>
</filesets>
</configuration>
</execution>
<!-- ISSUE: ios version does not support automation - disabling -->
<execution>
<id>uploading-ios-application</id>
<phase>pre-integration-test</phase>
<goals>
<goal>rest-request</goal>
</goals>
<configuration>
<resource>${commons.saucelabs.application.filename}.zip
</resource>
<filesets>
<fileset>
<includes>
<include>bin/${application.filename}.zip</include>
</includes>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>