FluentLenium/FluentLenium

View on GitHub
examples/appium/pom.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<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>

    <artifactId>fluentlenium-examples-appium</artifactId>
    <groupId>io.fluentlenium</groupId>
    <version>6.0.0-SNAPSHOT</version>

    <name>FluentLenium Examples Appium</name>
    <description>FluentLenium Appium examples</description>
    <url>https://github.com/FluentLenium/FluentLenium</url>

    <properties>
        <fluentlenium.version>6.0.0</fluentlenium.version>
        <spring.version>6.1.6</spring.version>
        <appium.selenium.version>4.16.0</appium.selenium.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.appium</groupId>
                <artifactId>java-client</artifactId>
                <version>8.5.0</version>
            </dependency>

            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-support</artifactId>
                <version>${appium.selenium.version}</version>
            </dependency>

            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-api</artifactId>
                <version>${appium.selenium.version}</version>
            </dependency>

            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-remote-driver</artifactId>
                <version>${appium.selenium.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.googlecode.maven-download-plugin</groupId>
                    <artifactId>download-maven-plugin</artifactId>
                    <version>1.9.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.15.0</version>

                <executions>
                    <execution>
                        <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
                        <id>install node and yarn</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <!-- optional: default phase is "generate-resources" -->
                        <phase>generate-resources</phase>
                    </execution>

                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>

                        <!-- optional: default phase is "generate-resources" -->
                        <phase>generate-resources</phase>

                        <configuration>
                            <!-- optional: The default argument is actually
                            "install", so unless you need to run some other npm command,
                            you can remove this whole <configuration> section.
                            -->
                            <arguments>install</arguments>
                        </configuration>
                    </execution>

                    <execution>
                        <id>install appium driver xcuitest</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>

                        <!-- optional: default phase is "generate-resources" -->
                        <phase>generate-resources</phase>

                        <configuration>
                            <arguments>run xcuitest</arguments>
                        </configuration>
                    </execution>

                    <execution>
                        <id>install appium driver UiAutomator2</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>

                        <!-- optional: default phase is "generate-resources" -->
                        <phase>generate-resources</phase>

                        <configuration>
                            <arguments>run uiautomator2</arguments>
                        </configuration>
                    </execution>
                </executions>

                <configuration>
                    <nodeVersion>v18.15.0</nodeVersion>

                    <!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution -->
                    <npmVersion>9.6.3</npmVersion>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>

                <configuration>
                    <environmentVariables>
                        <!-- mac specific -->
                        <ANDROID_HOME>${user.home}/Library/Android/sdk</ANDROID_HOME>
                    </environmentVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.fluentlenium</groupId>
            <artifactId>fluentlenium-core</artifactId>
            <version>${fluentlenium.version}</version>
        </dependency>
        <dependency>
            <groupId>io.fluentlenium</groupId>
            <artifactId>fluentlenium-junit</artifactId>
            <version>${fluentlenium.version}</version>
        </dependency>
        <dependency>
            <groupId>io.fluentlenium</groupId>
            <artifactId>fluentlenium-assertj</artifactId>
            <version>${fluentlenium.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.4.14</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>Android</id>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>

                        <configuration>
                            <includes>
                                <include>**/appium/android/*App.java</include>
                            </includes>

                            <systemPropertyVariables>
                                <spring.profiles.active>android</spring.profiles.active>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>com.googlecode.maven-download-plugin</groupId>
                        <artifactId>download-maven-plugin</artifactId>

                        <executions>
                            <execution>
                                <id>download Android app</id>

                                <goals>
                                    <goal>wget</goal>
                                </goals>

                                <phase>generate-test-resources</phase>

                                <configuration>
                                    <url>
                                        https://github.com/King-of-Spades/AppCenter-Samples/blob/main/Appium/Android/swiftnotes.apk?raw=true
                                    </url>
                                    <outputFileName>swiftnotes.apk</outputFileName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>iOS</id>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>

                        <configuration>
                            <includes>
                                <include>**/appium/ios/*Demo.java</include>
                            </includes>

                            <systemPropertyVariables>
                                <spring.profiles.active>iphone</spring.profiles.active>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>com.googlecode.maven-download-plugin</groupId>
                        <artifactId>download-maven-plugin</artifactId>

                        <executions>
                            <execution>
                                <id>download iOS app</id>

                                <goals>
                                    <goal>wget</goal>
                                </goals>

                                <phase>generate-test-resources</phase>

                                <configuration>
                                    <url>
                                        https://github.com/King-of-Spades/AppCenter-Samples/blob/main/Appium/iOS/UITestDemo.iOS.app.zip?raw=true
                                    </url>
                                    <outputFileName>UITestDemo.iOS.app.zip</outputFileName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>

                        <executions>
                            <execution>
                                <id>unpack iOS app</id>
                                <phase>generate-test-resources</phase>
                                <configuration>
                                    <tasks>
                                        <unzip src="target/UITestDemo.iOS.app.zip" dest="target/"/>
                                    </tasks>
                                </configuration>

                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>